A Software Development Lifecycle Case Study on : Diet Recommendation System based on User Activities

. This paper focuses on the methods of software engineering which can be helpful to various people working on huge projects with teams. This paper considers diet application as a case study. The main aim of the proposed system (diet application) is to give its users a healthy and balanced diet. The application is made in Flutter to ensure it reaches most of the audience and maximum people can receive its benefits. This paper is mostly based on the process used to create the application and all the views, processes, and architecture of the same. Some of the methods which are mentioned in the paper are the implementation of product backlog for the proposed system in association with a planning poker activity. The paper also has various Unified Modelling Language (UML) views in order to explain the design, implementation, use case and deployment of the proposed system.


Introduction
Health monitoring has been a supreme priority for every individual especially post the 2020 Coronavirus pandemic. The Pandemic has proved how important health is. Thus working out and maintaining health should be our priority. The health situation needs to be handled wisely and maintained. The majority of individuals start working out with some goal in their mind. Workout is 30% of the work done but to get the best results from the workout, a healthy and reliable diet is very important. However, due to lack of proper dietary knowledge or dietary negligence, their workout does not give out fruitful outcomes. Workout and a healthy diet hand in hand works wonders for improving health and fitness for an individual. Thus, the proposed system found this loophole in the current system and decided to tackle this problem using the technologies available today.
In an everyday hectic schedule, it becomes a daunting task to maintain a healthy diet without it being heavy on the pocket or it is neglected completely. Thus, in order to avoid this problem the proposed system gives the users complete diet guidance according to their workout plans morphing into their daily schedule. In order to achieve this goal the system provides a personalized diet plan based on an individual's workout routine for the people unable to afford time or money for the same and to avoid dietary negligence complementing the workout. Some main objectives of the system are, creating an app-based platform for individuals to complement the diet with their workout routine. This will in turn help the user to keep track of the actual workout done. The application also plans to suggest the best diet plan according to user requirements and work done. Calculating calories and work done, and comparing it with estimated work done is also required. All this helps the users to set and achieve goals with respect to the individuals' current health and fitness. The application also plans on analyzing the user's growth and development and representing it in graphical format. If the user has certain medical conditions or needs a more personalized solution the system may connect the user to professionals for further details and queries. Finally the system will provide health and workout tips like blogs and videos for the user to understand the right practices and reap the maximum benefit.
The proposed system is a mobile application, this is to ensure that it is accessible to most of the people and is available without any hinderance. The proposed system uses Flutter as a development platform. This is a cross platform open source development platform developed by Google [1]. The main aim of this platform is to reduce the native dependency of the applications and make them as seamless to switch between different platforms as possible.

Literature Survey
As we all know from all the elders, a healthy diet is very important in each of our lives. According to a survey women in Pakistan participate in labor intensive activities such as livestock management, agricultural production, etc. These women often work for 16 -18 hours but do not get a balanced diet [2]. This has resulted in a very poor health condition of these women. A similar case can be seen in the Korean elderly which have a really high amount of carbohydrate intake but do not have a complementing protein intake causing health problems [3]. According to [4] around 60% of the adult population is overweight or obese in Australia leading them to develop type 2 diabetes and Cardiovascular diseases (CVDs). Thus, in order to avoid these circumstances a research done by the National Library of Medicine each person should incorporate the 10 guidelines for a healthy life given by the Korean Medical Association statement which includes having a healthy diet. For an average healthy human each meal should contain 55% -65% carbohydrates, 7%-20% protein and 15%-30% fat [3]. A study in a Nursing Home in Taiwan concluded that the elderly can reduce the risk of malnutrition using a electronic solution [5].
Smartphones are widely being used in health promotion, research and practice due to rapid technological advancements. Although there are many diet and nutrition-related programmes (apps) available on various smartphone platforms, only a few have been assessed in research studies to determine their effectiveness in boosting health. Obesity's rising prevalence, as well as its links to CVD, cancer, diabetes, and other chronic illnesses, has sparked interest in finding effective approaches to encourage healthy eating and weight management. The use of cell phone text messaging and smartphone software (apps) to promote healthy eating and help weight loss is gaining popularity. The authors of the report [6] discussed how we may use technology to improve our health. According to the findings of their software, such applications can promote healthy eating and weight loss, and they are expected to be a helpful and low-cost intervention for improving diet and nutrition and tackling obesity in the general population [6]. According to other projects, various other solutions have been already developed for tackling such problems, thus the proposed system is this paper aims to reduce or remove the limitations in these various applications. In [7] are commendation system has been used in order to give the user a best breakfast, lunch and dinner diet. The project uses an Ant Colony Optimization Algorithm for the recommendation system which is given by where η ∈ (0, 1) Another research shows that a Quantum Genetic Algorithm (QGA) might be a new found beacon for optimization of a nutritional diet. The paper [8] explains deeply about the applications of a QGA in Nutritional Diet Optimization and it's internal workings. It is basically a probabilistic algorithm which uses a combination of quantum computing and evolutionary algorithm theory to optimize the output. The improvement in the algorithm is in the chromosome updating algorithm.
Different applications based on dietary planning of an individual have already paved its way in the past couple of years. Description of a similar app has been mentioned in the paper by Susan Evans and Peter Clarke [9]. This application focuses on providing recipes for given ingredients on a broader scale. It presents the user with the feature of KEEP/DROP the recipe according to their convenience. It also presents an attribute of gifting recipes to fellow users or other friends. It includes a characteristic feature called Secret which presents health benefits of different dietary substances. Along with this it focuses mainly on child diet, a parents preparatory time and methods. This paper also broadly covers different issues faced while creating the app and methods to make the app more attractive to increase the usability and scalability [9]. Another paper by Nana Shinozaki and Kentaro Murakami [10] focuses on the pronouncement that Dietary intake measurement is essential for nutritional epidemiological studies and clinical practices, including dietary counseling. This paper includes an application based on a user survey. The researchers searched iOS apps via the iTunes search app program interface, which allows the use of filters and search terms to explore content within the Apple iTunes store. The search was restricted to apps available in Japanese using the filter. It uses four bases for dietary surveys, namely, identification, screening, eligibility, conclusion. The paper further conducted a survey based on different fitness and health applications used currently in Japan. It also mentions a drawback that the accuracy of the nutrient intake calculation of these apps are not necessarily guaranteed due to the minimal governmental regulation of health apps [10].
Although much research has taken a reductionist approach with a focus on particular nutrients, food groups, or other dietary constituents, the complexity of the overall diet and its relations with health and disease outcomes are increasingly being recognized and embraced. For example, the 2015-2020 Dietary Guidelines for Americans (DGA) focused on eating patterns, noting that such patterns represent the totality of the foods and drinks habitually consumed by individuals and that these dietary components may act in synergistic and cumulative ways to predict health status and disease risk [3]. The development of the DGA was informed by a review of the growing evidence on eating patterns and health outcomes, including cardiovascular disease, diabetes, cancer, and overweight and obesity [11].
The proposed system in [12] provides a snapshot of five application scenarios about health Recommendation System (HRS), which are dietary recommendation, lifestyle recommendation, training recommendation, decision-making for patients and physicians, and disease-related prediction.
In order to give the user a compliant diet which satisfies his/her needs the proposed system needs to have a basic data of the basal metabolic rate (BMS) which can be calculated using the Harris-Benedict Formula [13]. Eq. 2 gives the BMS for men [14] and Eq. 3 gives it for women.
BM R = 66.4370 + 13.7516w + 5.0033h − 6.7550a (2) BM R = 655.0955 + 9.5634w + 1.8496h − 4.6756a where, w ≡ Weight (kg) h ≡ Height (cm) a ≡ Age (years) The total calorie intake can be determined using the appropriate physical activity factor [15] If the user has a sedentary lifestyle meaning little to no activity the ideal calorie intake is given by Eq. 4 If the user has a lightly active lifestyle meaning having a light exercise, going for a walk, playing sport 1-3 times a week, etc. the ideal calorie intake is given by Eq. 5 If the user is moderately active meaning plays sports each day, has a moderate exercise routine, etc. the calorie intake is given by Eq. 6 If the user has a high amount of workout like vigorous exercises, the user must follow the calorie intake given by Eq. 7 Calorie = BM R × 1.9 Similarly, the consumption of carbohydrates(CHO), Protein and Fat for the individuals can be given by Eq. 8 Eq. 9 Eq. 10 respectively [16].
Thus, the application will take into consideration all the factors included above to create an application which will help to improve the overall diet recommendations given to the user. Another system developed by M.Geeta and C.Saravanakumar [17] focuses on an individual's health based diet recommendation system. This system uses Machine learning approach for setting up the model for the system proposed. In this system the human data is collected from various sources in different formats. The extracted features are further analyzed after analyzing them. The BMI index of the individual is calculated and it determines the appropriate level and provides accurate information for diet maintenance. The premedical history is also taken into account for accurate evaluation. Calories are estimated using the individual's BMR (Basal Metabolic Rate), which is calculated using parameters such as height, weight, and age. The features are fitted into the machine learning recommendation model, which predicts the individual's diet plan in order to maintain proper health within a given time frame. The main goal of the proposed model's in [17] is to keep the individual in good health and free of disease.  Table 1 shows the product backlog created by the team in order to work on the system. This is an excellent example of setting up a path for knowing how the project is going to move further and helps to plan out the entire timeline. Further the burn-down chart is also created from the product backlog As an authorized user, I would be glad to receive some diet and workout tips, and also a few tricks to achieve my goal faster. Table 2 is the table of the planning poker activity. This activity is basically each team member assigning the tasks in each sprint a level of difficulty in any units decided by the team. This level can have either a unit of difficulty or it can have a unit of time (like days required to complete).

Planning Poker Activity
Here the team has taken the levels in units of working hours required to complete the respective task.      Fig 14 shows an abstraction of the class diagram. This is a way of simplification of class diagram and also helps in the separation of concerns for the entire system. Component diagram is a way of representing the system and segregating the system into various logical components.  Fig 15 gives the deployment plan for the proposed system. It chalks out the complete deployment process and tools required for the same. This is an important aspect of the SDLC since the deployment of the proposed system makes it available for use in production.   Fig 17 explains the sequence in which the activities will be performed. This is a way of knowing the process and sequence of the activities occurring in the application. It is a way of knowing and detecting any clashes in the application workflow beforehand and correcting it accordingly. Figure 17. Sequence Diagram of proposed system 6.6. Activity Diagram Fig 18 explains the various activities which will be going on inside the application. The activities can be performing tasks simultaneously and multiple activities can have a common outcome. This explains the process of the application and gives the end user a brief of how to use the application. This in turn helps the software engineers to cross check that whether the needs of the user are being addressed or not.

Architecture
In any application where the data needs to be shared from one screen to another a concept of state management is used [18]. This is needed in order to share data between the various screens or pages of the application. Flutter has several state management systems including redux framework and BLoC architecture [19]. In this application BLoC architecture is used.
BLoC abbreviates to Business Logic of Components. The BLoC state management system is similar to the M-V-VM (Model View ViewModel) state management system [20], but uses various streams in order to achieve the same effect. The concept of BLoC is to have a corresponding effect for each state inside the application. Fig. 19 explains the working of BLoC Architecture. Like displayed in Fig. 19 the UI Screen loads an event on the event stream which is then carried on to the BLoC. According to this event package the BLoC interacts with the repositories and Figure 19. BLoC Workflow emits a stream of states on different stages of the interaction. This state is then carried out to the UI Screen and the required changes are made, to indicate to the user that some processes are going on in the backend.
Using the BLoC State management has several advantages like State of application can be known in any point of time which is particularly useful in the cases which have constant data fetching requirements as the proposed system. From a developer's perspective the testing of the application is easily possible if the developer uses the BLoC architecture which also greatly increases the code efficiency and reusability of the code compared to older architecture formats. Furthermore, data driven decisions can be made by recording the user behavior which helps in increasing the user comfort and make a more personalized user experience for the user.
The application uses two cubits in order to manage its state. The main difference between a cubit and a bloc is that the cubits don't use event streams but send the states on a stream. Meaning only the response of the cubit is a stream and not the input.

Conclusions
To conclude all the contents of the paper, software engineering is a process of binding the client with the design and development teams giving it a solid and transparent communication bridge. This in turn helps to reduce process redundancy, and rework on the design and development teams. It also ensures to keep the client in loop with the overall development process and makes sure that the client's needs are addressed from the design and development team. As explained in the paper through the example of the diet application, the entire application was thoroughly planned and created before the development process ever started. The entire development process was planned using the sprint cycles and progress was tracked using the burn-down chart. All the classes in the project planned and activities were modeled using the respective UML diagrams. In order to make the client understand the use case diagram was mapped. All these processes together led to the development of the entire application. The SDLC helped in following a strict timeline for the development of the application. Since all the methodologies of a ideal SDLC were followed all the user requirements were incorporated in the application and maintenance of the application is also easier.