dietfit mobile application using rule- based system …
TRANSCRIPT
DIETFIT MOBILE APPLICATION USING RULE-
BASED SYSTEM TECHNIQUE
MUHAMMAD FARID BIN NAZMI
BACHELOR OF COMPUTER SCIENCE (SOFTWARE
DEVELOPMENT) WITH HONOURS
UNIVERSITI SULT AN ZAINAL ABIDIN
2021
DIETFIT MOBILE APPLICATION USING RULE-BASED
SYSTEM TECHNIQUE
MUHAMMAD FARID BIN NAZMI
BACHELOR OF COMPUTER SCIENCE (SOFTWARE
DEVELOPMENT) WITH HONOURS
Universiti Sultan Zainal Abidin
2021
i
DECLARATION
I hereby declare that the report is based on my original work except for quotations and
citations, which have been duly acknowledged. I also declare that it has not been
previously or concurrently submitted for any other degree at Universiti Sultan Zainal
Abidin or other institutions.
farid _______________________________
Name: Muhammad Farid Bin Nazmi
Date: 1 February 2021
ii
CONFIRMATION
This is to confirm that: DietFit Mobile Application Using Rule-Based System
Technique proposal was prepared and submitted by Muhammad Farid Bin Nazmi with
Matric Number: BTAL18051138.
The research conducted and the writing of this report were under my supervision.
_______________________________
Name: Pn Norlina Binti Udin @ Kamaruddin
Date:
iii
DEDICATION
The Most Graceful and the Most Merciful in the Name of Allah.
I praise God for His goodness and grace; I can successfully prepare and complete this
article.
I want to begin by thanking my supervisor, Puan Norlina Binti Udin @ Kamaruddin. I
have the chance to prepare this study effectively with the feedback, advice and reflective
ideas.
Besides, my gratitude is also to my colleagues who share ideas, opinions, knowledge,
and reminders. They helped me answer every question that was important to me in
completing this report.
Thanks also to my beloved mother; Nor Aini Binti Husain and father; Nazmi Bin Mohd
Noor who always support and motivated me to prepare for this report for Final Year
Project.
I want to take this opportunity to thank both IT and IT Faculty lecturers for their care,
encouragement and advice in helping this study to thrive and to share thoughts.
May Allah SWT bless all the efforts made in this respect.
Thank you.
iv
ABSTRACT
Nutrition care is one of the most important parts of our life to stay fit and healthy.
Unbalance nutrition intake in our body may lead to an unhealthy lifestyle. People are
tended to search and discover more about diet as it is an alternative way to ensure they
can maintain their ideal weight but they do not have much time and also knowledge to
discover more about nutrition care. Currently there are many studies utilise rule-based
technique for nutrition care, but mostly focus on browsing and record daily calories
intake and do not have recommendation features for a whole day diet and exercise
recommendations. The research was conduct to study common problems in nutrition
care and the way to overcome the nutrition care problem in the public community. Thus,
this research aims to develop DietFit mobile application to guide people about their
nutrition care by allowing them to have digitial diet guidance with the use of rule-based
technique. DietFit not only will allow the user to guide their diet by recommending the
best meals for them but it also will allow users to get some recommendations about
exercise for their fitness activity. Developing this DietFit will result in many advantages
to many people because people can get recommended meals and exercise quickly and
faster without having to meet dietetic. In conclusion, DietFit mobile application will
contribute more to people who have problems in nutrition care where people can use
full advantages of technology to get faster and more convenient pieces of information
and recommendations about meals and exercise.
v
ABSTRAK
Penjagaan pemakanan adalah salah satu bahagian terpenting dalam hidup kita
untuk kekal cergas dan sihat. Pengambilan nutrien yang tidak seimbang di dalam badan
kita boleh menyebabkan gaya hidup yang tidak sihat. Orang cenderung mencari dan
mengetahui lebih banyak mengenai diet kerana ini adalah kaedah alternatif untuk
memastikan mereka dapat mengekalkan berat badan ideal tetapi mereka tidak
mempunyai banyak masa dan pengetahuan untuk mengetahui lebih lanjut mengenai
penjagaan pemakanan. Terdapat banyak kajian yang menggunakan teknik berdasarkan
peraturan untuk penjagaan pemakanan, tetapi kebanyakannya menumpukan perhatian
pada melayari dan merekodkan pengambilan kalori setiap hari dan tidak mempunyai
ciri cadangan untuk diet dan senaman seharian. Kajian ini dilakukan untuk mengkaji
masalah umum dalam penjagaan pemakanan dan cara mengatasi masalah penjagaan
pemakanan di masyarakat. Oleh itu, penyelidikan ini bertujuan untuk mengembangkan
aplikasi mudah alih DietFit untuk membimbing orang tentang penjagaan pemakanan
mereka dengan membiarkan mereka mendapat panduan diet awal dengan penggunaan
teknik berasaskan peraturan. DietFit bukan sahaja akan membolehkan pengguna
membimbing diet mereka dengan mengesyorkan makanan terbaik untuk mereka tetapi
akan membolehkan pengguna mendapatkan beberapa cadangan mengenai latihan
untuk aktiviti kecergasan mereka. Membangunkan DietFit ini akan menghasilkan
banyak kelebihan kepada orang kerana orang boleh mendapatkan makanan yang
disyorkan dan bersenam dengan lebih cepat tanpa harus memenuhi diet.
Kesimpulannya, aplikasi DietFit akan menyumbang lebih banyak kepada orang yang
mempunyai masalah dalam penjagaan pemakanan di mana orang dapat menggunakan
vi
kelebihan teknologi sepenuhnya untuk mendapatkan maklumat dan cadangan yang
lebih pantas dan lebih mudah mengenai makanan dan senaman.
vii
CONTENTS
PAGE
DECLARATION i
CONFIRMATION ii
DEDICATION iii
ABSTRACT iv
ABSTRAK v
CONTENTS vii
LIST OF TABLES x
LIST OF FIGURES xi
LIST OF ABBREVIATIONS xii
CHAPTER 1 INTRODUCTION 1
1.1 Introduction 1
1.2 Project Background 2
1.3 Problem Statement 3
1.4 Objectives 4
1.5 Scope 4
1.6 Limitation of Work 5
1.7 Expected Result 5
1.8 Activities, Milestones (Gantt Chart) 6
CHAPTER 2 LITERATURE REVIEW 7
2.1 Introduction 7
2.2 Literature review article 8
2.3 Existing Application Comparison 10
2.4 Approach Solution 11
2.4.1 Rule-Based System Technique 11
2.4.2 Rule-Based System Algorithm 13
viii
CHAPTER 3 METHODOLOGY 15
3.1 Introduction 15
3.2 Iterative model development 15
3.2.1 Initial Planning Phase 16
3.2.2 Planning Phase 16
3.2.3 Requirement Phase 17
3.2.4 Analysis and Design Phase 17
3.2.5 Implementation Phase 18
3.2.6 Testing Phase 18
3.2.7 Evaluation Phase 19
3.2.8 Deployment Phase 19
3.2.9 Iteration Phase 19
3.3 System Requirement 20
3.3.1 Hardware Requirement 20
3.3.2 Software Requirement 22
3.4 Framework Design 23
3.5 System Design and Modelling 24
3.6 Context Diagram (CD) 25
3.7 Data Flow Diagram (DFD) 26
3.7.1 DFD Level 0 26
3.7.2 DFD Level 1 28
3.7.2.1 Process 4.0 manage diary record for meals and exercise (User)
28
3.7.2.2 Process 6.0 manage user (Admin)
29
ix
3.7.2.3 Process 7.0 manage meals and exercises (Admin)
30
3.7.2.4 Process 8.0 manage health tips and diary data (Admin)
31
3.8 Entity Relationship Diagram (ERD) 32
3.9 Data Dictionary Table 33
3.9.1 admin 33
3.9.2 user 34
3.9.3 list_meals 35
3.9.4 list_exercises 35
3.9.5 diary 36
3.9.6 health_tips 36
REFERENCES 37
x
LIST OF TABLES
Table No. Title Page
Table 1 Gantt Chart FYP 1 6
Table 2 article on literature review (existing system same method) 8
Table 3 comparison between existing application 10
Table 4 Laptop requirement which used to develop DietFit App 20
Table 5 Smartphone requirement which used to develop DietFit App 21
Table 6 Software used in development of DietFit App 22
Table 7 Data Dictionary Table for Admin 33
Table 8 Data Dictionary Table for user 34
Table 9 Data Dictionary Table for list_meals 35
Table 10 Data Dictionary Table for list_exercises 35
Table 11 Data Dictionary Table for diary 36
Table 12 Data Dictionary Table for health_tips 36
xi
LIST OF FIGURES
Figure No. Title Page
Figure 1 Basic architecture of rule-based system 11
Figure 2 Iterative model process cycle 16
Figure 3 Framework design DietFit Mobile Application 23
Figure 4 Context Diagram of DietFit Mobile Application 25
Figure 5 DFD Level 0 DietFit Mobile Application 27
Figure 6 DFD Level 1 Process 4.0 28
Figure 7 DFD Level 1 Process 6.0 29
Figure 8 DFD Level 1 Process 7.0 30
Figure 9 DFD Level 1 Process 8.0 31
Figure 10 ERD DietFit Mobile Application 32
xii
LIST OF ABBREVIATIONS
BMI Body Mass Index
SDLC System Development Life Cycle
CD Context Diagram
DFD Data Flow Diagram
ERD Entity Relationship Diagram
RMCO Recovery Movement Control Order
MCO Movement Control Order
RBS Rule-Based System
1 | P a g e
CHAPTER 1
INTRODUCTION
1.1 Introduction
Health is very important. People are very careful about their health, especially
during this world pandemic covid-19 where people stay at home most of the time.
Pandemic covid-19 makes people more focused on self-care to avoid being exposed to
covid-19 and also makes people less move and interact with the outside world due to
the Recovery Movement Control Order (RMCO) that has been directed by the
government. From this situation, people are only going out to buy necessities, work and
important business.
According to The Star Newspaper, Movement Control Order (MCO) diets drive
up Malaysia Obesity rates. As the MCO is started, most people always order food online
by using food delivery services such as food panda and grab food. Some of them keep
ordering fast food which then leads to obesity due to continuously consuming a lot of
calories into the body. According to the World Population Review 2019, Malaysia has
the highest prevalence of obesity among adults in South-East Asia at 15.6 percent,
followed by Brunei (14.1 percent), Thailand (10.0 percent) and Indonesia (6.9 percent).
People are also worried about their eating habits because staying at home most
of the time without any encouragement to stay fit and healthy may gain weight
drastically if they do not control eating habits. Besides, people tend to get disease easier
if they consume lots of unhealthy food such as fast-food. Through the issue arising,
DietFit mobile application is introduced as an alternative way to solve diet-related
issues and help to guide people on diet in the right ways.
2 | P a g e
1.2 Project Background
Nowadays, nutrition care is the most important thing to ensure healthy life.
Nutritional care is identified as a fundamental duty to provide patients with sufficient
and suitable food and drinks. On this basis, consider the improvements in nutritional
treatment required to ensure that the nutritional needs of patients are met. The Body
Mass Index (BMI) is a basic height index used commonly in the nutrition status
measurement. People usually do not care about Body Mass Index in the way of they
want to stay healthy. When they do not care their BMI, they tend to get obese day by
day. Having knowledge in nutrition care is more important to ensure BMI is maintain
in normal state. The proposed DietFit Mobile Application will provide more
understanding to people about their nutrition care because this application will provide
recommendation based on their input information according to a few criteria which the
main is their Body Mass Index. As the conclusion for this project background, DietFit
mobile application is proposed and aims to develop a mobile application based on the
Rule-Based System to recommend the best meal and exercise for the user. The proposed
DietFit recommendation application will be created based on a few criteria of rules such
as BMI, age and active level that will be implemented using the Rule-Based System
method.
3 | P a g e
1.3 Problem Statement
People are more concerned about their health specially to gain an ideal weight.
The acting concern for their health is good. However, some of them are lacking in
knowledge which may lead to wrong diet practice and also lack of motivation to stay
healthy.
The main problem faced by Malaysian users is that users found it is hard to meet
dietetic for diet counselling. Meeting with dietetic is the best solution for most of the
people who want to get counselling for diet as dietetic will provide counselling based
on the user lifestyle story and food intake pattern. The procedure to meet dietetic is user
must make appointment. This will make some users find difficult to search for suitable
time to deal with the appointment. Besides, dietetic is always busy with their
appointment schedule. Hence, this mobile application will provide users with simple
dietetic counselling which will give best recommendation based on information input
by the user.
Other than that, another problem faced by the user is that the user cannot find
any diet guidance before meeting with dietetic. Diet guidance such as quick food
recommender, short notes about healthy food and also some of the best info for food
eating diet are important to the user as preparation before meeting with dietetic. It is
important to have diet guidance before meeting with dietetic because when the user has
diet guidance, the user tends to have better understanding during dietetic counselling
sessions. After dietetic counselling sessions, the user becomes easier to practice new
diet results from having better understanding about nutrition and diet. Hence, this
application will act as diet guidance for the user as preparation before meeting with
dietetic.
Last but not least, the problem faced by the user is that the previous online diet
system does not provide food suggestions. Through some research, most existing diet
systems do not provide direct recommendations for meals and exercise. They only
provide for browsing meals and browsing exercises with details of calories information.
The user finds it is difficult to make a decision for choosing the best meals and exercise
throughout the search. This is because although the user can see the calories information
during the search, the user cannot guess and determine which one is the best for them.
Hence, this application will provide the best recommendation for meals and exercise to
the user after the user input some information needed for the recommendation process.
4 | P a g e
1.4 Objectives
The objective of this mobile application is identified as below:
i. To propose a Mobile Application-based that will help Malaysian to choose the
best food and exercise recommendation.
ii. To study rule-based system technique for processes recommending suitable
meals and exercise for users.
iii. To test functionality of push notification feature that will remind users of few
health and exercise tips.
1.5 Scope
This application is targeted for Malaysian user. The scope of this application consists
of:
User Scope (Malaysian)
i. This application will allow user to register as new user.
ii. This application will allow user to login DietFit apps to store their personal
and health data.
iii. This application will allow user to insert their weight, height for BMI
Calculation, age and active level for recommendation process.
iv. This application will allow user to get recommendation from
recommendation tabs that result from the input recommendation information
by the user.
v. This application will allow user to update their information to get suitable
suggestions based on current information.
vi. This application will allow user to browse for the meals, exercise and health
tips.
vii. This application will allow user to manage diary record for meals and
exercise.
Admin Scope
i. This application will allow admin to login to the application.
ii. This application will allow admin to manage user account.
iii. This application will allow admin to manage meals and exercise.
iv. This application will allow admin to manage health tips and diary data.
5 | P a g e
1.6 Limitation of Work
i. Users only can search one meal at a time and also display only meals
that search.
ii. This application is only for android platform.
iii. The suggestion for meal and exercise only changes when user input new
information about recommendation.
1.7 Expected Result
The expected result for DietFit Mobile Application is shown as below:
i. This application will be able to provide user friendly applications as the main
features of the app is recommendation suitable meals and exercise.
ii. This application will be able to monitor calories burn and intake to ensure a
better daily diet plan for users.
iii. This application will be able to give smooth experience when browsing through
the recommendation tab and search tab.
6 | P a g e
1.8 Activities, Milestones (Gantt Chart)
Table 1.5 below shows project planning phase for DietFit Mobile Application. From
the table below, it contains a total of 15 weeks to complete the planning phase with
different tasks performed each week.
Table 1 Gantt Chart FYP 1
7 | P a g e
CHAPTER 2
LITERATURE REVIEW
2.1 Introduction
This chapter provides the literature review for the application that will be developed.
The main purpose in this chapter is to provide an overview of research techniques from
existing systems or applications that will be used in developing DietFit applications.
Besides, we will discuss comparison existing applications. We will discuss the
advantages and disadvantages of the application. Hence, this literature review will be
referenced in the development of the proposed application. Table 2.1 shows article on
existing application that used same method-algorithm while table 2.2 shows comparison
between two existing application in terms of advantages and disadvantages for the
existing application
8 | P a g e
2.2 Literature review article
Table 2 article on literature review (existing system same method)
No Author Title Objective
Problem
Statement
Method-
algorithm
used
Result Description/Futur
e work.
1. Prof.
Megha V.
Gupta,
Ms. Priya
Bhattacha
rjee, Ms.
NavyaKot
ian, Ms.
GrishmaV
ipat
(2017)
DANES: Diet
and Nutrition
Expert
System for
Meal
Management
and Nutrition
Counseling
The
application
aims to
provide
customized
healthy meals
and diet
plans, foods
to eat and
foods to
avoid
One
problem in
healthcare is
the lack of
availability for
frequently
health
monitoring.
Rule-
Based
System
Providing an
expert
system for
Diet and
Nutrition
adds value to
people's life
especially in
developing
countries.
The expert
system will
provide
expertise in
nutrition
consulting
DANES is
application
software that
provides the
customer
with the
information of the
importance of a
healthy lifestyle
along with a
dietician
recommended diet
2. N
Nalayini
(2008)
Design of a
Fuzzy Rule
Base Expert
System to
Predict and
Classify the
Cardiac Risk
to Reduce the
Rate of
Mortality
to predict and
forecast the
risk level of
cardiac
patients to
avoid sudden
death
The prime
objective is
to control the
growth rate
of mortality
due to high-
risk disease
like heart
attack. This
objective is
attained by
controlling
the main four
risk factors
using the rule
base system
Patients with
high-risk
disease like
cardiac arrest
require
precaution and
prevention as
early as
possible. But,
due to the
unexpected
and sudden
stop of the
functioning of
pumping
muscular
organ “THE
HEART”, the
controllable
risk factors
blood pressure,
cholesterol,
diabetic,
obesity to be
maintained
always at the
Fuzzy
logic with
Rule-
Based
System
In this study
the results
shown by the
cardiac fuzzy
inference
system
designed
helps the
experts to
determine the
duration
period, for
treating the
patient
depending
upon the
output
parameter
risk. level.
In this proposed
system, uncertainty
is captured using
rule base and
classification using
fuzzy c-means
clustering is
discussed to
overcome the risk
level, so that
emergency care can
be taken for the
cardiac patients
with high risk
9 | P a g e
normal level to
regularize the
adequate
supply and
normal flow of
blood in the
circulatory
system, the
sudden arrest
can be avoided
efficiently and
effectively.
3. Ibrahim
M.
Ahmed,
Marco
Alfonse,
Mostafa
ArefDr.A
dbel-
Badeeh
M. Salem
(2015)
Daily Meal
Planner
Expert
System for
Diabetics
Type-2
to
develop a
medical
expert system
for the
treatment of
diabetes type
2.
The main
problems
identified
include:
Shortage of
specialist; the
other medical
staff in the
Division
needed expert
knowledge and
guidance, from
the specialist,
on treatment of
diabetes
Knowledg
e-Based
System,
Rule-
Based
System
The proposed
expert
system is a
promising
helpful tool
that reduces
the
workload for
physicians
and provides
a more
comfort
for diabetic
patients.
The expert system
provides the
patients with
medical advices
and basic
knowledge on
diabetes diet.
10 | P a g e
2.3 Existing Application Comparison
Through some research, there are two example of the existing system which can be
compared in Table 3.
Table 3 comparison between existing application
Title Interface Advantages Disadvantages
MyFitnessPal
● Users can do
many things
such as make
diaries, plans,
search recipes.
● There is calories
counter to track
record of user
calorie intake
● Too much
information on
screen makes people
sometimes confused
about using this app.
● The plan tab is only
available when user
purchase
MyNutriDiari
● Users can use
the BMI
calculator
without having
to login.
● The feature food
list for searching
food also can be
used without log
in
● The application
performance is
slow; I have to wait
for a long time to
display the search
result.
● This application is
only focused on
diet.
11 | P a g e
2.4 Approach Solution
In this section, we will explain about the possible approach that will be choose
in this application. The solution can be found through process identification of
approaches whether the stated approaches is capable to implement to the application
or not. Hence, the technique that we will be using is Rule-Based System Technique.
2.4.1 Rule-Based System Technique
A rule-based system (RBS) is one kind of Artificial Intelligence which is a
system that applies human-made rules to store, sort and manipulate data. In doing so, it
mimics human intelligence.
To function, rule-based systems involve a set of facts or source of data, and a
set of rules for manipulating that data. These rules are often referred to as ‘If statements’
as they appear to follow the line of ‘IF X occurs THEN do Y’. Figure 1 shows how rule-
based system works.
Figure 1 Basic architecture of rule-based system
Source:
12 | P a g e
In this application, a rule-based system is applied to the process
recommendation when the user wants to have suggestions of meals and exercise after
they key in the calculated BMI, age, gender and active level. These requirements of
criteria are considered as rules for the recommendation. These rules are used as a set of
fact in which the IF statement that will be followed by THEN statement which is it
consequences.
There are a few benefits and a few disadvantages of Rule-Based System
technique. The biggest benefit is that there are not so many laws - ultimately a person
will understand how the model forecasts and how it makes sense. It's easy to understand.
In a given case the mechanism can be checked properly and the key variables in the
forecast can be seen.
The only downside is that rules-based approaches are typically not the best
estimation output performers. Other techniques (forests, SVM, deep networks) are
generally easier. In comparison, for data with categorical attributes, rules-based
approaches are easier. The numerical aspect poses additional difficulties since the data
must be discreted or the thresholds must be defined for the rules.
13 | P a g e
2.4.2 Rule-Based System Algorithm
Algorithms are based on information in the form of rules that are simple to
understand and very expressive from the classification model. There are a few rules to
be used in this application to make the decision-making process for the recommendation
process.
Below are some rules that involve:
• Rule 1: BMI < 18.5
• Rule 2: 18.5 <= BMI <= 24.9
• Rule 3: 25.0 <= BMI <=29.9
• Rule 4: BMI > 30
• Rule 5: Age < 20
• Rule 6: 21 <= Age <= 40
• Rule 7: Age > 41
• Rule 8: Gender == Female
• Rule 9: Gender == Male
• Rule 10: Active level == Very active
• Rule 11: Active level == Not active
• Rule 12: Active level == Normal
Along with the rule there is the consequence which we considered as THEN statement
which always changing according to the rule stated. For the 12 rules set in the above
these are the consequence or in this application label as recommendation result.
Recommendation result are:
• high carbohydrates, very low fat and high protein meals && high exercise
• low carbohydrates, normal fat and high protein meals && normal exercise
• normal carbohydates, high fat and normal protein meals && normal exercise
• normal carbohydrates, very low fat and high protein meals && normal
exercise
• normal carbohydrates, low fat, high and high protein meals && normal
exercise
• low carbohydrates, low fat and high proteins && high exercise
14 | P a g e
As a result, from the Rule and the recommendation result. These are the generation of
instruction code for rule-based system as follows:
• if BMI < 18.5 || age > 20 || active level == very active
Write out (normal carbohydrates + high fat + normal protein) meals &&
normal exercise
• if 18.5 <= BMI <= 24.9 || 21 <= age <= 40 || active level == normal
Write out (normal carbohydrates + very low fat + high protein) meals &&
normal exercise.
• if 25.0 <= BMI <= 29.9 || age < 20 || active level == not active
Write out (high carbohydrates + low fat + high protein) meals && high
exercise.
• if BMI > 30 || age > 41 || active level normal == very active
Write out (low carbohydrates + very low fat + high protein) meals && high
exercise
15 | P a g e
CHAPTER 3
METHODOLOGY
3.1 Introduction
This chapter will discuss the methodology that is being used in order to develop
this application. DietFit application will be developed based on the Rule-Based System
which states a few criteria of rules which will determine the best recommendation when
the user input the requirement information. The System Development Life Cycle
(SDLC) that will be used in this project development is Iterative Model. This chapter
will explain more details on every phase that is involved in this project development.
3.2 Iterative model development
The methodology is the explanation of each phase that involves the development
of DietFit Mobile Application. Methodology in general is a framework that is used to
organize, schedule and manage the mechanism of constructing an information system.
In this application, the Iterative model was selected as the framework used to implement
this system.
The Iterative model that was used in this project development needs to be
designed, implemented and tested. The project can be deemed to be completed if it
meets all of its specifications and the satisfaction of the customer. Rigorous evaluation
of specifications and testing of each version of the program against certain requirements
for each implementation of the model is the secret to the efficient use of the Iterative
model.
Iteration must be replicated and expanded as the program progresses with each
iteration, in order to validate each version of the software. The method would direct the
implementation of the framework by focusing on the application rather than on the
documentation. The whole phase that involves this model are initial planning,
requirements, analysis and design, implementation, testing, evaluation and deployment
as shown from Figure 2 below.
16 | P a g e
3.2.1 Initial Planning Phase
For the initial phase, I discussed with my supervisor about the title and method
that will be used in this Final Year Project. After brainstorming a few ideas, the title
DietFit has been chosen and the Rule-Based system method is the best to be used on the
application.
3.2.2 Planning Phase
Planning phase is detailed about the title, where I also refer this to my
supervisor. The discussion held to determine what are the problem statements regarding
the diet issue and also healthy life, objectives that I will gain and also scope of the
application. I made a feasibility analysis to help understand the problem statements and
their best approach. One of the implications is that the objective can be defined within
the scope of the system.
Figure 2 Iterative model process cycle
17 | P a g e
3.2.3 Requirement Phase
The requirement phase is the phase for the user requirement. In this stage the
user requirement involves Malaysian. This user requirement phase is important to
collect more information about user needs. Research on existing applications has been
done to analyze the existing system defect. By doing this research, we will gain more
knowledge about the current application and also may improve from the existing
system. The example of existing applications from the research that has been made are
MyNutriDiari2 and MyFitnessPal.
Furthermore, DietFit’s structure was also analyzed to see what details would be
treated. The opinions of the public and their own statements. DietFit is demanded to
achieve the most relevant requirements. All gathered information must first be
organized so that it can fulfil the consumer specifications of the system. The parameters
are obtained to satisfy the purpose of the method, which is the rule-based technique.
3.2.4 Analysis and Design Phase
In this step, all the information obtained was analyzed. A flaw in the present
system has to be resolved by the system to be built. The prototype is modelled on the
basis of the criteria already taken in and evaluated in the demand analysis process. The
application scope was then used to create these three diagrams which are Contextual
Diagram (CD), Data Flow Diagram (DFD) Level 0 and Level 1, and Entity Relationship
Diagram (ERD). The diagrams will help to explain the system's mechanism and flow.
The graphic user interface is built on the basis of a few existing applications. From the
observation of existing system, the graphic user interface will come with new fresh
design according to the theme of the application which is about nutrition care and
healthy lifestyle.
18 | P a g e
3.2.5 Implementation Phase
Implementation phase is also known as code generation phase where the actual
method of implementation and coding is implemented here. It involved in real system
development based on the system design that had been planned earlier. First, the main
module which is Malaysian user, where user can register and login to the application,
fill in recommendation info and view recommendation result, browse health tips, meals
and exercise and manage diary record for meals and exercise while for the second
module which is admin can manage user, manage meals and exercise, manage healths
tips and diary data. All of the module scopes are then will implement soon using Ionic
framework with google firebase as the database for this application.
3.2.6 Testing Phase
To ensure that the system runs correctly, the testing phase need to be done. To
test the system and do some checking to the system for an error, test cases are used.
After each, increment, regression testing should proceed for the testing phase. The
system will be tested by entering the valid and invalid input to check whether if error
occur, after completing development of module 1. Coding will be revised to find the
bugs and fix it, if and only if there are many errors such as failure in adding the
information into the database and it is the same with the next module. Faulty element
of the software can be quickly identified because a few changes are made within a single
increment during the testing. The black-box testing applied where the system is being
tested its functional and non-functional, without the reference to the internal structure
component of the system. As an example, each of the module is tested separately using
the web browser; providing inputs and verifying the outputs against the expected
outcome.
19 | P a g e
3.2.7 Evaluation Phase
Before the system is being deployed to the end user, the evaluation needed to be
done. Any best practices and technique that were used in the first iteration then can be
used for the next requirements and iterations.
3.2.8 Deployment Phase
To ensure that the system functions correctly or not during the deployment
stage, the application will be released to end users.
3.2.9 Iteration Phase
In this phase, the iteration process will essentially be determined by which
application is benchmarked by user. It depends on the user, if all the need is sufficient
or if more needs to be added. This phase will be skipped and an application considered
if there is no complaint received and the person in charge is satisfied. If not, either
additional requirements or adjustment of current requirements had to be reiterated in
the above phase.
20 | P a g e
3.3 System Requirement
The most critical aspect is the requirement of hardware and software because
without these two requirements, development of DietFit might be stopped. To complete
the project, the hardware and software equipment must be used according to the need.
The need of these installations depends on what has already been provided or used by
others. In this system requirement section, we will discuss about hardware and software
that are used to develop DietFit.
3.3.1 Hardware Requirement
This project will be using Laptop and Smartphone for the hardware. Table 4
shows laptop requirement while Table 5 shows smartphone requirement which both are
used to develop and test DietFit Mobile Application.
Table 4 Laptop requirement which used to develop DietFit App
Specification Description
Processor Intel(R) Core (TM) i5-8300H CPU
@ 2.30GHz 2.30 GHz
Maximum Clock speed Up to 3.99 GHz
Operating System Windows 10 Home Single
Language
Hard Disk System Storage and
Type
512 GB Sata III M.2 SSD
Memory 16 GB DDR4 2400 MHz
21 | P a g e
Table 5 Smartphone requirement which used to develop DietFit App
Specification Description
Processor Snapdragon 865 5g (7nm) 1.80 GHz
Operating System Android 11 (Oxygen OS Based on
Android 11).
Maximum Clock speed Up to 2.85GHz
Storage and Type 256 GB UFS 3.1
Memory 12 GB LPDDR4X
22 | P a g e
3.3.2 Software Requirement
There is a few software that are used to develop DietFit Mobile Application. Table 6
shows software requirement to develop DietFit Mobile Application.
Table 6 Software used in development of DietFit App
Software Explanation
Microsoft Office Word
2019
This software is used to write and edit
DietFit’s Final Year Project report.
Microsoft Office
PowerPoint 2019
This software is used to create new
slides and edit slides of FYP presentation
for progress presentation and seminar
presentation
Adobe XD This software is used to design
interface of DietFit App for user and
admin
Ionic framework This software platform is used to
develop DietFit Mobile Apps
Google Firebase This software platform is used to create
database of DietFit Mobile Apps
Adobe Photoshop This software is used to design for
poster and photo that will be put in the
DietFit and also for poster in presentation.
Microsoft Project 2019 This software is used to create gantt
chart
Notepad++ This software is used to view saved
code and also second platform to create
code for DietFit Mobile Apps
Adobe Photoshop This software is used to edit photos
regarding to the logo of the Application
23 | P a g e
3.4 Framework Design
Figure 3 below shows the framework design of DietFit Mobile Application
using Rule-based. This framework explains the main process that occurs in the system
in easiest way. There are 2 main elements which are Admin and User that will save
directly into the database where Admin will manage user account, meals and exercise
and health tips and diary data. User can register to the application, manage diary to
monitor their daily exercise and meals calories, view recommendation based on
information input to get suggestion on the best meals and exercise for them and browse
for meals and exercise to get extra information.
Figure 3 Framework design DietFit Mobile Application
24 | P a g e
3.5 System Design and Modelling
System design and modelling will explain about how the flow of the system is
well-organized to ensure the process flow is smooth during the development of the
application. The representation data that are related to the application are called as
conceptual data modelling. Conceptual data modelling is used to display the structure
of the application data. The process of data modelling requires the representation of
functions and processes in the system before system creation. Based on DietFit Mobile
Application, the Contextual Diagram (CD) and Data Flow Diagram (DFD) show the
physical structure design of the application while the Entities Relationship Diagram
(ERD) shows logical structure design of the application. System design and modelling
is one of the crucial parts in the development of the application where we need to have
clear representation data to ensure the process flow in development of the application
is smooth.
25 | P a g e
3.6 Context Diagram (CD)
Context diagram or in other word also known as high-level data flow diagram
which shows all the flow process involve in the application. Based on DietFit Mobile
Application, there are two entities which are user and admin. For the user, they can,
register and login to the application, insert recommendation info, view list of
recommendation after recommendation info insertion, view info and health tips, browse
for meals and exercise to get extra information and manage daily diary for meals and
exercises. The admin for this application can login into the application, manage
recommendation data, manage user and also generate report. The Figure 4 below shows
the context diagram for DietFit Mobile Application.
Figure 4 Context Diagram of DietFit Mobile Application
26 | P a g e
3.7 Data Flow Diagram (DFD)
Data Flow Diagram (DFD) is one of the diagrams that show processes occur
including the information of the process to the data to be stored. In DietFit Mobile
Application, there will be two level of DFD which is DFD Level 0 and DFD Level 1.
3.7.1 DFD Level 0
DFD Level 0 will show in overall process flow that occurs in DietFit Mobile
Application. There are two entities that involve in DFD Level 0 for DietFit Mobile
Application which are Admin and User which targeted for Malaysian. There are eight
total process involved for user and admin in the application. The processes for user are
register and login, fill info and view recommendation meals and exercise, browse meals,
exercise and health tips and manage diary exercises and meals for daily record. The
processes for admin are login, manage user, manage meals and exercise, manage health
tips and diary data. The major processes for the user are fill in recommendation info
and view recommendation for meals and exercise while for the admin, the processes are
managing user, manage meals and exercise, manage health tips and diary data. Figure
5 shows the DFD Level 0 for DietFit Mobile Application
28 | P a g e
3.7.2 DFD Level 1
In this section, we will expand and explain more details processes from Data
Flow Diagram Level 0 as the Data Flow Diagram Level 1 will show details of the
process that involves in DietFit Mobile Application. The processes that involve in Data
Flow Diagram Level 1 for user are manage diary record for meals and exercise, while
for the admin are manage user, manage meals and exercises, manage health tips and
diary data.
3.7.2.1 Process 4.0 manage diary record for meals and exercise (User)
In manage diary process, user can add new meal record from browsing or
recommendation list, add new exercises record, update meal record, update exercise
record and delete the record. These processes are shown in Figure 6 below.
Figure 6 DFD Level 1 Process 4.0
29 | P a g e
3.7.2.2 Process 6.0 manage user (Admin)
This process involves admin. Admin can update information to be filled by the
user and delete unactive user. Figure 7 shows all the process occurs on manage user.
Figure 7 DFD Level 1 Process 6.0
30 | P a g e
3.7.2.3 Process 7.0 manage meals and exercises (Admin)
Meals and exercises are one of the major important things where user get their
recommendation based on the dataset and also used to provide data for browsing. In this
manage meals and exercises process, admin can Add new meal data based on Body
Mass Index; add new exercise based on active level, update dataset and delete old
dataset. Figure 8 shows all process occurs in manage meals and exercises for admin
Figure 8 DFD Level 1 Process 7.0
31 | P a g e
3.7.2.4 Process 8.0 manage health tips and diary data (Admin)
In this process, health tips are where the user get their latest tips about health.
For health tips, it will involve admin where admin can add new health info related to
the nutrition care, update the health info and delete the health info. For diary data, admin
can edit the diary information that can be filled by user. In this process admin can add
new diary information that can be filled by user, update diary layout style and
information and delete old diary style. Figure 9 shows all the process occurs in manage
health tips and diary data for admin.
Figure 9 DFD Level 1 Process 8.0
32 | P a g e
3.8 Entity Relationship Diagram (ERD)
ERD is a diagram that shows the relationship between entities involve in the
application. In DietFit Mobile Application there are six entities which are admin,
list_exercises, list_meals, User, diary and health_tips. Figure 10 shows ERD with the
six entities involve in the application.
Figure 10 ERD DietFit Mobile Application
33 | P a g e
3.9 Data Dictionary Table
There are 6 tables for the data dictionary table as there are 6 entities involve in this
application. Tables below show all the data dictionary table for 6 entities; admin, user,
list_meals, list_exercises, diary, health_tips.
3.9.1 admin
Table 7 Data Dictionary Table for Admin
NO ATTRIBUTES DESCRIPTION TYPE KEY LENGTH DEFAULT NULL
1 Ad_username Username for
admin to login to
the application
varchar - 20
2 Ad_pwd Password for the
admin to login
varchar - 12
34 | P a g e
3.9.2 user
Table 8 Data Dictionary Table for user
NO ATTRIBUTES DESCRIPTION TYPE KEY LENGTH DEFAULT NULL
1 user_id Incremental id for
user to
differentiate with
another user
varchar Primary
Key
10
2 user_email Email for user to
login
varchar - 20
3 user_pwd Password for
user to login
varchar - 15
4 BMI Detail about
BMI for
recommendation
process
varchar - 5
5 age Current age of
user
varchar - 5
6 active_level Active level such
as active, not
active and
normal
varchar - 15
7 gender Male or Female varchar - 5
8 user_weight Height of
Malaysian
varchar - 10
9 user_height Weight of
Malaysian
varchar - 10
10 Malaysian_type Adult, teenage,
kids
varchar - 20
35 | P a g e
3.9.3 list_meals
Table 9 Data Dictionary Table for list_meals
NO ATTRIBUTES DESCRIPTION TYPE KEY LENGTH DEFAULT NULL
1 meal_id Incremental id for
user to
differentiate with
other meal
varchar Primary
Key
10
2 meal_name Name of the
meal
varchar - 20
3 food_type Food category
such as protein,
carbohydrate
varchar - 20
4 calories_info Value of calories
contained in a
meal
varchar - 10
3.9.4 list_exercises
Table 10 Data Dictionary Table for list_exercises
NO ATTRIBUTES DESCRIPTION TYPE KEY LENGTH DEFAULT NULL
1 ex_id Incremental id for
user to
differentiate with
other exercise
varchar Primary
Key
10
2 ex_name Name of the
exercise
varchar - 20
3 type Type of exercise
such as active,
intermediate and
normal
varchar - 20
4 calories_info Value of calories
burnt after done
that exercise
varchar - 10
5 Time_taken Usual time for an
exercise process
varchar - 10
36 | P a g e
3.9.5 diary
Table 11 Data Dictionary Table for diary
NO ATTRIBUTES DESCRIPTION TYPE KEY LENGTH DEFAULT NULL
1 diary_id Incremental id for
user to
differentiate with
another diary with
different user
varchar Primary
Key
10
2 user_id Id of user varchar Foreign
Key
10
3 ex_id Id for exercise varchar Foreign
Key
20
4 meal_id Id for meal varchar Foreign
Key
10
5 time Time records the
meal intake and
exercise done
varchar - 10
6 date Date of record
for meal intake
and exercise
done
varchar - 10
3.9.6 health_tips
Table 12 Data Dictionary Table for health_tips
NO ATTRIBUTES DESCRIPTION TYPE KEY LENGTH DEFAULT NULL
1 tips_id Incremental id for
user to
differentiate tips
with different
health tips
varchar Primary
Key
10
2 tips_desc Description
about the tips
varchar - 10000
3 tips_type Type of health
tips such as for
disease
prevention and
healthcare
varchar - 20
4 tips_name Name of the
health tips main
title
varchar - 10
37 | P a g e
REFERENCES
Ahmed, I. M. (2015). Daily Meal Planner Expert System for Diabetics Type-2. Cairo:
E leader Prague.
Aoyama, T. (2017). A customized online nutrition guidance system is effective for
treating patients with nonalcoholic fatty liver disease by supporting continuity of diet
therapy at home: A pilot study. Internal Medicine Vol 56, 1651-1656.
Gupta, M. V. (2017). DANES: Diet and Nutrition Expert System for Meal
Management and Nutrition Counseling. International Journal on Recent and
Innovation Trends in Computing and Communication , 204 - 208.
Hassan, N. (2017). Fuzzy Soft Expert System in Prediction of Coronary Artery.
International Journal of Fuzzy System Volume 19, 1546-1559.
Namgung, K. (2019). Menu Recommendation System Using Smart Plates for Well-
balanced Diet Habits of Young Children. Wireless Communications and Mobile
Computing.
Pattaraintakorn, P. (2007). Web-Based Health Recommender System Using Rough
Sets, Survival Analysis and Rule-Based Expert Systems. LNAI 4482, 1, 491-499.
Rana, K. S. (2016). Food Recommendation System Using Content Based Algorithm.
Tribhuvan: DWIT College Deerwalk Institute of Technology.
Rehman, F. (2017). Diet-Right: Smart Food Recommendation System. KSII
Transactions On Internet And Information System Vol 11 No.6.