0% found this document useful (0 votes)
602 views96 pages

BLACK BOOK GYM Sagar

The document describes a project report for a Gym Management System. It includes an introduction, background, objectives, purpose and scope of the project. The introduction provides an overview of fitness apps and how they can help users track fitness goals and health progress. The background discusses features of gym and club management systems. The objectives are to develop software to facilitate data storage, maintenance and retrieval for a gym. The purpose and scope is to simplify running a fitness business through online scheduling, billing, administrative tasks and reporting through integrated software.

Uploaded by

arshadkalam94
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
602 views96 pages

BLACK BOOK GYM Sagar

The document describes a project report for a Gym Management System. It includes an introduction, background, objectives, purpose and scope of the project. The introduction provides an overview of fitness apps and how they can help users track fitness goals and health progress. The background discusses features of gym and club management systems. The objectives are to develop software to facilitate data storage, maintenance and retrieval for a gym. The purpose and scope is to simplify running a fitness business through online scheduling, billing, administrative tasks and reporting through integrated software.

Uploaded by

arshadkalam94
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 96

A PROJECT REPORT ON

GYM MANAGEMENT SYSTEM

SUBMITTED BY

SAGAR MANOJ NISHAD

SEAT NO: (4018431)

BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY

(SEMESTER VI)

PROJECT GUIDE

PROF. MANJU SURESH

SUBMITTED TO

UNIVERSITY OF MUMBAI

KHAR EDUCATION SOCIETY’S COLLEGE OF COMMERCE & ECONOMICS

S.V. ROAD NEXT TO KHAR POLICE STATION,

KHAR (W), MUMBAI-400052.

(2022-2023)

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 1
ACKNOWLEDGEMENT

The satisfaction and euphoria that accompany the successful completion of any
task would be incomplete without mentioning the names of people who made it
possible, whose constant guidance and encouragement crowns all the efforts with
success.

I would take this opportunity to express my deep sense of gratitude to the


Khar Education Society’s College of Commerce and Economics and all the

My sincere thanks to Prof. MANJU SURESH, the Project Guide, without


their support, it wouldn't have been possible to develop the project. She provided
me with excellent infrastructure and awesome environment that laid potentially
strong foundation for my professional life. She helped me in every aspect, and I
am very thankful to her for believing in me. I express my thanks to our Principal
Dr. NANDINI DESHMUKH for her support and encouragement so each and
every student excel in studies.

I also like to thank our BSC.IT Coordinator. Prof. MANJU SURESH, for
guiding and correcting various documents of mine with attention and care. She
has taken pain to go through the project and make necessary correction as and
when needed.

Student Name: ____________________

Seat Number: _____________________

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 2
DECLARATION

I hereby declare that the project entitled, "Gym Management System" done
at Khar Education Society’s College of Commerce and Economics, has not
been in any case duplicated to submit to any other university for the award of any
degree. To the best of my knowledge other than me, no one has submitted to any
other university.

The project is done in partial fulfilment of the requirements for the award of
the degree of BACHELOR OF SCIENCE (INFORMATION
TECHNOLOGY) to be submitted as a final semester project as part of our
curriculum.

Name and Signature of the Student

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 3
TABLE OF CONTENT

Sr. No. Topic Pg. No


Chapter 1
1 Introduction
1.2 Background
1.3 Objectives
1.4 Purpose and Scope
1.4.1 Purpose
1.4.2 Scope

Chapter 2
2.1 Existing System
2.2 Proposed System
2.3 Requirement Analysis
2.4 Hardware Requirements
2.5 Software Requirements
2.6 Justification of Selection of Technology

Chapter 3
3.1 Module Division
3.2 Data Dictionary
3.3 ER Diagram
3.4 DED/UML Diagram

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 4
Chapter 4
4.1 Code (Place Core Segment)
4.2 Testing Approach
4.2.1 Unit Testing (Test cases and test results)
4.2.2 Integration System (Test cases and test results)

Chapter 5
5.1 Results and Discussions (Output Screen)

Chapter 6
6.1 Conclusion and Future Work

Chapter 7
7.1 Reference

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 5
LIST OF FIGURES
Sr.No. Figures Name Page. No
1 Use Case Diagram
2 Activity Diagram
3 Class Diagram
4 ER Diagram
5 Data Flow Diagram

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 6
Chapter 1
Introduction
A fitness app is a mobile application that helps users track and manage their fitness
activities and health goals. These apps often include features such as workout tracking, meal
planning, goal setting, and progress monitoring

Fitness apps have become increasingly popular in recent years as more people look to
technology to help them stay motivated and on track with their fitness goals. They can be a
convenient way to stay accountable to a workout routine, access expert advice, and connect
with other users for support and motivation.

Many fitness apps also integrate with wearable technology, such as smartwatches or fitness
trackers, to provide even more detailed insights into a user's fitness progress. Some apps even
use artificial intelligence and machine learning algorithms to analyze user data and provide
personalized recommendations for workouts, nutrition, and overall health.

Overall, a fitness app can be a valuable tool for anyone looking to improve their physical health
and well-being, providing a convenient and personalized way to track progress and stay
motivated towards their fitness goals.

1.1 Background

● In this module the user is provided with the facility for Adding Gyms or updating the
existing Gyms. ( the number of Gyms for a product can be very large this system is
provided with efficient filtering. "the user can filter the Gyms based on the priority,
database, operating system and status. filter the list of Gyms are displayed from the
database

● Gym and club management systems provide fitness businesses the functionality to
manage schedules, memberships, and facilities. The capabilities of gym management
systems include storing member information in a database, managing financial records,
scheduling classes, and reserving facilities.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 7
● To help you choose the right gym management software for your business, here are
some tools and features to look out for.

● Customer site and member app.

● Gym booking software and scheduling solutions. ...

● Attendance and progress trackers. ...

● Automated billing and payment. ...

● Reliable gym management reporting and analytics.

● Gym Management System provides an easy to use interface for the users and a database
for the admin to maintain the records of gym members.

1.2 Objectives
● The main objective of the project is to develop software that facilitates the data storage,
data maintenance and its retrieval for the gym in an igneous way.
● To store the record of the customers, the staff that has the privileges to access, modify
and delete any record and finally the service gym provides to its customers.
● Also, only the staff has the privilege to access any database and make the required
changes, if necessary.
● To develop easy to use software which handles the customer staff relationship in an
effective manner.
● Develop a user friendly system that requires minimal user training. Most of features
and function are similar to those on any windows platform.
● The main objective is to save time of user.
● It help to get proper trainer according to test.
● Fast and accurate results.
● Provide better service to the user.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 8
1.3 Purpose and Scope

1.3.1 Purpose

● Customer site and member app

● Gym booking software and scheduling solutions

● Attendance and progress trackers

● Automated billing and payment

● Reliable gym management reporting and analytics

● Accessibility and flexibility

● Integration

● Gym management system software is designed to simplify the running of a fitness


club from online gym scheduling and automated billing to administrative tasks the
software pulls all data into one place so that you can run you’re your business
efficiently

● Gym management system software is one of the effective ways to modern gyms to
achieve success and optimize their business potential and it has great future scope
as well This technology has progressed well beyond checking member into gym
and processing dues

● They required software which will store data member’s , employees, machine,
salary, diet of member etc. And lock up with graphical user interface (GUI) The
system will check validity of information provided by user, Stores information of
member according to their id and generate reports for different id

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 9
Being physically active can improve your brain health hp manage weight reduce the risk of
disease strengthen bones and muscles and improve your ability to do everyday Adults who sit
less

1.3.2 Scope

A gym app can have a wide scope depending on the features and functionalities it offers.
Some of the most common features of a gym app include:

Workout tracking: Users can track their workout progress and monitor their fitness
goals.

Exercise library: A collection of exercises with instructions and videos can be included
to help users perform workouts correctly.

Personalized training programs: Based on the user's fitness level, goals, and
preferences, customized workout programs can be created.

Nutrition tracking: Users can track their daily food intake and monitor their calorie
consumption.

Community support: Users can connect with other gym-goers for motivation and
support.

Integration with wearables: Users can sync their gym app with wearable fitness devices
to track their activity levels.

Booking system: Users can book gym sessions or classes through the app.

Virtual coaching: Users can receive personalized coaching and feedback from certified
trainers via video chat.

Overall, a gym app can provide a comprehensive fitness experience for users by
offering a range of features to help them achieve their fitness goals.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 10
Regenerate response

1.3.3 Applicability

The term "gym" can refer to different things depending on the context, but in general, it is a
place or facility where people go to exercise or participate in physical activities. The
applicability of a gym depends on various factors, including the individual's fitness goals,
availability of equipment and facilities, location, and cost.

For individuals who are interested in improving their overall fitness, a gym can be an excellent
option as it provides access to a wide range of equipment, including cardio machines, weight
lifting equipment, and functional training tools. Gyms also offer a variety of classes such as
yoga, Pilates, and group fitness sessions, which can help individuals achieve their fitness goals.

For athletes who require specialized training, a gym can provide the necessary equipment and
facilities to improve their performance in their sport. For example, a powerlifter may require a
gym with a powerlifting-specific equipment such as a squat rack, bench press, and deadlift
platform.

However, not everyone may find a gym suitable for their needs. Some individuals may prefer
outdoor activities such as running or cycling, while others may prefer a more personalized
approach such as working with a personal trainer or attending smaller fitness studios.

Overall, the applicability of a gym depends on an individual's fitness goals and preferences. It
is essential to consider factors such as location, cost, equipment, and facilities before deciding
on a gym membership.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 11
Chapter 2
System Analysis

2. Survey of Technology
Sure, I can help you with that. Here are some potential survey questions related to gym apps
and technology:

How often do you use gym apps to track your fitness progress and goals?

What types of gym apps do you use most frequently (e.g., workout planners, calorie trackers,
activity monitors, social networks)?

Which features of gym apps do you find most helpful or motivating?

Have you ever encountered technical issues or bugs while using a gym app? If so, how did you
address them?

How important is the design and user interface of a gym app to you?

Have you ever used virtual or augmented reality technology in a gym app? If so, what was your
experience like?

Would you be willing to pay for a premium version of a gym app with additional features or
services?

Have you ever participated in a fitness challenge or competition through a gym app

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 12
2.1 Main Objectives of this project

The main objective of a gym app project may vary depending on the specific goals and
requirements of the project. However, some of the common objectives of a gym app project
may include:

Providing a platform for users to track their fitness goals and progress: The gym app can
provide features that allow users to set fitness goals, track their workouts, monitor their
progress, and receive feedback on their performance.

Offering personalized workout plans and recommendations: Based on user's goals, fitness
level, and preferences, the gym app can suggest personalized workout plans and
recommendations that can help users achieve their fitness goals.

Enhancing the user's overall gym experience: The gym app can provide features that make it
easier and more convenient for users to access the gym, such as online class scheduling,
equipment reservation, and social features that allow users to connect with other gym-goers.

Providing a platform for gym trainers and coaches to connect with clients: The gym app can
provide features that allow trainers and coaches to create and manage workout plans for their
clients, monitor their progress, and provide feedback and support.

Overall, the main objective of a gym app project is to provide a platform that enhances the
user's fitness experience and helps them achieve their fitness goals Similar Work Done by
Others.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 13
2.3 Currently used System
As an AI language model, I do not have access to information about your personal usage
of the gym app. However, if you are looking for information about currently popular gym
apps, here are a few:

Nike Training Club: A free app that offers over 185 workouts and custom training programs
based on your fitness level and goals.

MyFitnessPal: A free app that allows you to track your workouts and nutrition, set goals,
and connect with friends for support.

Peloton: An app that offers on-demand and live classes for cycling, running, strength
training, yoga, and more.

7 Minute Workout: A simple app that offers quick, high-intensity workouts that can be
done anywhere, anytime.

It's important to note that the effectiveness of any gym app will depend on your personal
fitness goals, preferences, and level of commitment to your fitness routine. It's always a
good idea to consult with a fitness professional before starting any new exercise program.

2.4 Existing System


● Now days to without using a Gym management system it is very difficult to manage
a member’s ( membership details /Trainer) because without it takes lot of
paperwork to manage all the records of member’s, records of trainer and workout
plan, managing the gym scheduling the for the Admin because it consist lots and
lots of data like personal details of gym member’s, member’s personal details ,
member’s previous personal details of faculty and more many records.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 14
2.5 Proposed System
As an AI language model, I don't have access to any specific proposed system gym app.
However, I can provide some general information on what features a gym app could
include:

User profiles: Users should be able to create profiles within the app, which can store their
personal information, goals, fitness level, and workout history.

Workout plans: The app could offer users personalized workout plans based on their fitness
goals, experience level, and other factors. These plans could include exercises, sets, reps,
and rest periods.

Exercise library: A comprehensive library of exercises with detailed instructions and videos
can be included to ensure that users perform exercises correctly.

Tracking and monitoring: Users can track their progress with the app by logging workouts
and tracking progress over time. The app can also integrate with wearables or fitness
trackers to monitor other metrics such as heart rate, calories burned, and steps taken.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 15
2.6 Requirement Analysis
In order to make the most out of this project it was necessary to be aware of all the
requirements that our targeted user must have. Requirements were taken through google
forms which significantly helped for the structure of the website.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 16
T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 17
2.4 Hardware Requirements
Hard disk space: . 32 GB or more
Processor: 2 GHz Intel Pentium Dual Core or later
RAM: 2 GB or more
Internet: Ethernet Cable, Wi-Fi or data connection

2.5 Software Requirements


Operating System: Microsoft Windows 10
For Front-End: Android Studio
For Back-End: Java
Languages Used : Java
Database Used: SQL Server
Documentation tool: MS Word, MS Excel, Star Uml, Draw.IO

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 18
2.6 JUSTIFICATION OF PLATFORM

Android Studio: Android Studio is the official integrated development environment


(IDE) for Google's Android operating system, built on JetBrains IntelliJ IDEA software
and designed specifically for Android development. It is available for download on
Windows, macOS and Linux based operating systems. It is a replacement for the Eclipse
Android Development Tools (E-ADT) as the primary IDE for native Android application
development

Structured Query Language: Abbreviated as SQL S-Q-L, sometimes sequel for historical
reasons) is a domain-specific language used in programming and designed for managing data
held in a relational database management system (RDBMS), or for stream processing in a
relational data stream management system (RDSMS). It is particularly useful in handling
structured data incorporating relations among entities and variables.

JAVA : A high-level, class-based, object-oriented programming language that is designed to


have as few implementation dependencies as possible. It is a general-purpose programming
language intended to let programmers write once, run anywhere meaning that compiled Java
code can run on all platforms that support Java without the need to recompile. Java applications
are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless
of the underlying computer architecture. The syntax of Java is similar to C and C++, but has
fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities
(such as reflection and runtime code modification) that are typically not available in traditional
compiled languages. As of 2019, Java was one of the most popular programming languages in
use according to particularly for client–server web applications.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 19
Chapter 3
System Design
3.1 Module Division

3.2 Data Dictionary


Data Dictionary Table for User

Sr.no. Column Name Data Type Constraint Description


1 User _id int(3) Primary Key It is unique id of the user
2 User _name varchar() not null It is the unique name for each user
3 Date of birth int(2) not null It is the unique age for each user
4 Mobile _no int(10) not null It is the unique mobile no for each user
5 Address varchar() not null It is the unique address for each user
6 Password int () not null It is the unique password for each user

Data Dictionary Table for Admin

Sr.no Column Name Data Type Constraint Description


1 Admin _ id int(5) Primary Key It is the unique id for Admin
2 Admin _ name varchar() not null It is the unique name for Admin

Data Dictionary Table for Gym

Sr.no Column Name Data Type Constraint Description


1 Name varchar() Primary Key It is the unique name
2 Agent Mobile No. int() not null It is the unique mobile no
5 Trainer int() Not Null It is the unique gym
6 Date int() Not Null It is the unique date gym
7 workout varchar() Not Null It is the unique destination for gym

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 20
3.3 ER Diagram

An Entity Relationship (ER) Diagram is a type of flowchart that illustrates how "entities"
such as people, objects or concepts relate to each other within a system. ER Diagrams are
most often used to design or debug relational databases in the fields of software engineering,
business information systems, education and research. Also known as ERDs or ER Models,
they use a defined set of symbols such as rectangles, diamonds, ovals and connecting lines
to depict the interconnectedness of entities, relationships and their attributes.

Importance of ERDs and their uses

Entity relationship diagrams provide a visual starting point for database design that can also
be used to help determine information system requirements throughout an organization.
After a relational database is rolled out, an ERD can still serve as a reference point, should
any debugging or business process re-engineering be needed later. However, while an ERD
can be useful for organizing data that can be represented by a relational structure, it can't
sufficiently represent semi-structured or unstructured data. It's also unlikely to be helpful on
its own in integrating data into a pre-existing information system.

How to create an ERD

ERDs are generally depicted in one or more of the following models:

• A conceptual data model lacks specific detail but provides an overview of the scope
of the project and how data sets relate to one another.
• A logical data model, which is more detailed than a conceptual data model, illustrates
specific attributes and relationships among data points. While a conceptual data
model does not need to be designed before a logical data model, a physical data
model is based on a logical data model.
• A physical data model provides the blueprint for a physical manifestation -- such as
a relational database -- of the logical data model. One or more physical data models
can be developed based on a logical data model.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 21
There are five basic components of an entity relationship diagram. Similar components will
be designated by the same shape. For example, all entity types might be enclosed in a
rectangle, while all attributes are enclosed in a diamond. The components include

• Entities are objects or concepts that can have data stored about them. Entities refer
to tables used in databases.
• Attributes are properties or characteristics of entities. An ERD attribute can be
denoted as a primary key, which identifies a unique attribute, or a foreign key, which
can be assigned to multiple attributes.
• The relationships between and among those entities.

• Actions describe how entities share information in the database.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 22
3.4 Data Flow/UML Diagram
UML is an acronym that stands for Unified Modeling Language. Simply put, UML is a
modern approach to modelling and documenting software. In fact, it’s one of the most
popular business process modelling techniques. It is based on diagrammatic
representations of software components. As the old proverb says: “a picture is worth a
thousand words”. By using visual representations, we are able to better understand
possible flaws or errors in software or business processes. UML was created as a result of
the chaos revolving around software development and documentation.

UML diagrams are visual representations of complex software systems' architecture,


design, and implementation. They help developers better understand how all the parts
work together. UML diagrams are often used to communicate with other developers or
users of your system. UML Diagrams are a great way to communicate any technical
requirement with developers, customers, and non-technical people. They can be used to
describe the functionality of a system as well as document your design. With cloud-based
diagramming feature, you have access to a large library of pre-designed diagrams for your
projects, so you can start creating immediately rather than spending time searching for the
right code elements in an existing template.

3.8 Planning and Scheduling

Gantt chart: - Gantt chart provides a graphical illustration of a schedule that helps to plan,
coordinate, and track specific tasks in a project.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 23
Spiral Model
● Spiral Model is a combination of a waterfall model and iterative model. Each phase in
spiral model begins with a design goal and ends with the client reviewing the progress.
Barry Boehm first mentioned the spiral model in his 1986 paper. The development team
in Spiral-SDLC model starts with a small set of requirement and goes through each
development phase for those set of requirements. The software engineering team adds
functionality for the additional requirement in every-increasing spirals until the
application is ready for the production phase.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 24
Data-Flow Diagram
A Data Flow Diagram (DFD) is a graphical representation of how data flows through a
system. It is a tool used by analysts to model and describe the flow of data through a system,
including inputs, outputs, and the various processing steps that occur.

DFDs are typically composed of four main elements:

Entities: These are the sources and destinations of data, such as people, organizations, or
other systems that interact with the system being modelled.

Processes: These are the steps that transform the data as it flows through the system.
Processes can represent anything from simple calculations to complex algorithms.

Data Flows: These are the paths that data takes as it moves through the system, from one
process to another or from a process to an entity.

Data Stores: These are the repositories which data is stored and retrieved from.

DFDs can be used to analyze and improve existing systems, as well as design new systems.
They are particularly useful in identifying inefficiencies or bottlenecks in a system and
suggesting areas for improvement.

There are four types of Data Flow Diagrams (DFDs):

• Context Diagram: A context diagram is the highest-level DFD that represents the entire
system as a single process, and shows the interactions between the system and external
entities. It provides an overview of the system without going into detail about the internal
workings of the system.
• Level 0 DFD: A Level 0 DFD shows the main processes of the system, and how they
interact with each other. It represents the first level of decomposition from the context
diagram.
• Level 1 DFD: A Level 1 DFD shows the more detailed sub-processes of each of the main
processes identified in the Level 0 DFD. It represents the next level of decomposition
from the Level 0 DFD.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 25
• Level 2 (and beyond) DFDs: Level 2 and beyond DFDs provide more detailed views of
the sub-processes identified in the Level 1 DFD. They can continue to decompose the
system into further levels of detail, as necessary.

Each level of the DFD represents a higher level of detail and provides a more detailed view of
the system being modelled. The levels can continue to be decomposed until the desired level
of detail has been reached.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 26
T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 27
Class Diagram
The class diagram is one of the types of UML diagrams which is used to represent the
static diagram by mapping the structure of the systems using classes, attributes, relations,
and operations between the various objects. A class diagram has various classes; each has
threepart; the first partition contains a Class name which is the name of the class or entity
which is participated in the activity, the Second partition contains class attributes that
show the various properties of the class, the third partition contains class operations
which shows various operations performed by the class, relationships shows the relation
between two classes.

Why Should We Use Class Diagram?

The structure of a system is defined by a Class Diagram by showing its attributes,


relationships among objects, and so on. It is the backbone of object-oriented modelling
and could also be used for Data modelling. Class Diagrams help in making pre-plans which
eases the programming process. Moreover, you could always make changes to the Class
Diagram as it’s kind of annoying to code different functionality after facts. It is a design
plan based on which a system is built. It is easy to understand without much technical
knowledge required.

Class Diagram provides a static view of the application, and its mapping ability with
object-oriented language makes it ready to be used in construction. Unlike the sequence
diagram, activity diagram, etc., the class diagram is the most popular UML diagram.

Below is the purpose of a Class diagram.

• The static view of an application is designed and analyzed.


• A system’s responsibilities are described by it.
• The components and the deployment diagram’s base are the class diagram.
The forward and reverse engineering is influenced by the Class Diagram .

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 28
T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 29
Use-case Diagram

A UML use case diagram is a type of diagram in the Unified Modeling Language (UML) that
represents the interaction between a system and its external actors (users, other systems,
or devices) in terms of use cases. Use cases are descriptions of specific interactions
between the system and an actor that achieve a specific goal. The use case diagram shows
the relationships between actors and use cases, as well as the relationships between use
cases themselves. The use case diagram is typically used during the requirements gathering
and analysis phase of software development to capture and document the functionality of
a system. It helps to identify the actors and use cases that need to be included in the system
and provides a high-level overview of the system's behaviour.

The UML use case diagram consists of the following elements:

• Actors: These are external entities (such as users, systems, or devices) that interact with
the system and trigger the use cases.
• Use Cases: These are specific interactions between the system and an actor that
achieve a specific goal. Each use case should have a unique name that describes the
goal.
• Associations: These are lines that connect actors to use cases, indicating that the actor
is involved in the use case.
• System Boundary: This is a rectangle that defines the boundary of the system,
separating the internal components from the external actors.
• Includes/Extends: These are optional relationships that show how one use case can be
included or extended by another use case. The includes relationship indicates that one
use case is always executed as part of another use case, while the extends relationship
indicates that one use case can be optionally executed as an extension of another use
case.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 30
T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 31
Activity Diagram

A UML activity diagram is a type of diagram in the Unified Modeling Language (UML)
that shows the flow of activities in a system or process. It is a graphical representation of a
workflow or business process that shows the sequence of actions, decisions, and transitions
required to complete a task or achieve a goal. Activity diagrams are used to model complex
systems and business processes, and they can help to identify inefficiencies, redundancies,
and potential errors. They are commonly used in software engineering to model the
behaviour of software systems, but they can also be used in other fields, such as business
process modelling and project management.

The UML activity diagram consists of the following elements:

• Activity: An activity represents a step in a process or workflow, and it can be further


broken down into sub-activities.

• Action: An action is a specific task or operation that is performed as part of an


activity. It can be represented as a rectangle with rounded corners.

• Decision: A decision is a branching point in the process where the flow is


determined based on a condition or set of conditions. It can be represented as a
diamond.

• Control Flow: A control flow is a line that connects the activities and shows the
sequence in which they are performed.
• Object Flow: An object flow is a line that shows the movement of objects between
activities.

• Swimlanes: Swimlanes can be used to group related activities or to indicate which


organization or department is responsible for each activity.

• Start and End Points: A start point indicates where the process or workflow begins,
and an end point indicates where it ends.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 32
UML activity diagrams are useful for analyzing and improving complex processes, and for
communicating the details of a process or workflow to stakeholders. They can also be used
to model the behaviour of software systems and to develop test cases and other types of
documentation.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 33
Sequence Diagram
The sequence diagram represents the flow of messages in the system and is also termed as an
event diagram. It helps in envisioning several dynamic scenarios. It portrays the
communication between any two lifelines as a time-ordered sequence of events, such that these
lifelines took part at the run time. In UML, the lifeline is represented by a vertical bar, whereas
the message flow is represented by a vertical dotted line that extends across the bottom of the
page. It incorporates the iterations as well as branching.

Purpose of Sequence Diagram

1. To model high-level interaction among active objects within a system.

2. To model interaction among objects inside a collaboration realizing a use case.


3. It either models generic interactions or some certain instances of interaction.

Notations of Sequence Diagram

Lifeline

An individual participant in the sequence diagram is represented by a lifeline. It is positioned


at the top of the diagram.

Actor

A role played by an entity that interacts with the subject is called an actor. It is out of the scope
of the system. It represents the role, which involves human users and external hardware or
subjects.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 34
Activation

It is represented by a thin rectangle on the lifeline. It describes that time period in which an
operation is performed by an element, such that the top and the bottom of the rectangle is
associated with the initiation and the completion time, each respectively.

Messages

The messages depict the interaction between the objects and are represented by arrows. They
are in the sequential order on the lifeline. The core of the sequence diagram is formed by
messages and lifelines.

Following are types of messages enlisted below:

Call Message: It defines a particular communication between the lifelines of an interaction,


which represents that the target lifeline has invoked an operation.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 35
Return Message: It defines a particular communication between the lifelines of interaction
that represent the flow of information from the receiver of the corresponding caller message .

Self Message: It describes a communication, particularly between the lifelines of an


interaction that represents a message of the same lifeline, has been invoked.

Recursive Message: A self message sent for recursive purpose is called a recursive message.
In other words, it can be said that the recursive message is a special case of the self message as
it represents the recursive calls.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 36
Create Message: It describes a communication, particularly between the lifelines of an
interaction describing that the target (lifeline) has been instantiated.

Destroy Message: It describes a communication, particularly between the lifelines of an


interaction that depicts a request to destroy the lifecycle of the target.

Duration Message: It describes a communication particularly between the lifelines of an


interaction, which portrays the time passage of the message while modeling a system.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 37
T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 38
Chapter 4
Implementation and Testing
4.1 Code
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.easyfitness">

<uses-permission android:name="android.permission.VIBRATE" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
/>

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"

android:maxSdkVersion="28" />

<uses-permission android:name="android.permission.ACTION_HEADSET_PLUG" />

<uses-feature

android:name="android.hardware.camera.any"

android:required="false" />

<uses-feature

android:name="android.hardware.camera.autofocus"

android:required="false" />

<application

android:allowBackup="true"

android:icon="@mipmap/ic_launcher"

android:label="@string/app_name"

android:requestLegacyExternalStorage="true"

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 39
android:theme="@style/AppTheme"

android:preserveLegacyExternalStorage="true"> <!--for when


requestLegacyExternalStorage will be removed-->

<activity

android:name=".MainActivity"

android:configChanges="orientation|screenSize"

android:label="@string/app_name"

android:windowSoftInputMode="stateUnchanged">

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

<action android:name="android.intent.action.VIEW" />

</intent-filter>

</activity>

<activity

android:name=".intro.MainIntroActivity"

android:theme="@style/Theme.Intro" />

package com.csvreader;

import java.io.BufferedReader;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.IOException;

import java.io.InputStream;

import java.io.InputStreamReader;

import java.io.Reader;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 40
import java.io.StringReader;

import java.nio.charset.Charset;

import java.nio.charset.StandardCharsets;

import java.text.NumberFormat;

import java.util.HashMap;

/**

* A stream based parser for parsing delimited text data from a file or a

* stream.

*/

public class CsvReader {

/**

* Double up the text qualifier to represent an occurance of the text

* qualifier.

*/

public static final int ESCAPE_MODE_DOUBLED = 1;

/**

* Use a backslash character before the text qualifier to represent an

* occurance of the text qualifier.

*/

public static final int ESCAPE_MODE_BACKSLASH = 2;

// this holds all the values for switches that the user is allowed to set

private final UserSettings userSettings = new UserSettings();

private final DataBuffer dataBuffer = new DataBuffer();

private final ColumnBuffer columnBuffer = new ColumnBuffer();

private final RawRecordBuffer rawBuffer = new RawRecordBuffer();

private final HeadersHolder headersHolder = new HeadersHolder();

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 41
private Reader inputStream = null;

private String fileName = null;

// this will be our working buffer to hold data chunks

// read in from the data file

private Charset charset = null;

private boolean useCustomRecordDelimiter = false;

private boolean[] isQualified = null;

// these are all more or less global loop variables

// to keep from needing to pass them all into various

// methods during parsing

private String rawRecord = "";

private boolean startedColumn = false;

private boolean startedWithQualifier = false;

private boolean hasMoreData = true;

private char lastLetter = '\0';

private boolean hasReadNextLine = false;

private int columnsCount = 0;

private long currentRecord = 0;

private String[] values = new String[StaticSettings.INITIAL_COLUMN_COUNT];

private boolean initialized = false;

private boolean closed = false;

/**

* Creates a {@link com.csvreader.CsvReader CsvReader} object using a file

* as the data source.

* @param fileName The path to the file to use as the data source.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 42
* @param delimiter The character to use as the column delimiter.

* @param charset The {@link java.nio.charset.Charset Charset} to use while

* parsing the data.

*/

public CsvReader(String fileName, char delimiter, Charset charset)

throws FileNotFoundException {

if (fileName == null) {

throw new IllegalArgumentException(

"Parameter fileName can not be null.");

if (charset == null) {

throw new IllegalArgumentException(

"Parameter charset can not be null.");

if (!new File(fileName).exists()) {

throw new FileNotFoundException("File " + fileName

+ " does not exist.");

this.fileName = fileName;

this.userSettings.Delimiter = delimiter;

this.charset = charset;

isQualified = new boolean[values.length];

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 43
/**

* Creates a {@link com.csvreader.CsvReader CsvReader} object using a file

* as the data source. Uses ISO-8859-1 as the

* {@link java.nio.charset.Charset Charset}.

* @param fileName The path to the file to use as the data source.

* @param delimiter The character to use as the column delimiter.

*/

public CsvReader(String fileName, char delimiter)

throws FileNotFoundException {

this(fileName, delimiter, StandardCharsets.ISO_8859_1);

/**

* Creates a {@link com.csvreader.CsvReader CsvReader} object using a file

* as the data source. Uses a comma as the column delimiter and

* ISO-8859-1 as the {@link java.nio.charset.Charset Charset}.

* @param fileName The path to the file to use as the data source.

*/

public CsvReader(String fileName) throws FileNotFoundException {

this(fileName, Letters.COMMA);

/**

* Constructs a {@link com.csvreader.CsvReader CsvReader} object using a

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 44
* {@link java.io.Reader Reader} object as the data source.

* @param inputStream The stream to use as the data source.

* @param delimiter The character to use as the column delimiter.

*/

public CsvReader(Reader inputStream, char delimiter) {

if (inputStream == null) {

throw new IllegalArgumentException(

"Parameter inputStream can not be null.");

this.inputStream = inputStream;

this.userSettings.Delimiter = delimiter;

initialized = true;

isQualified = new boolean[values.length];

/**

* Constructs a {@link com.csvreader.CsvReader CsvReader} object using a

* {@link java.io.Reader Reader} object as the data source. Uses a

* comma as the column delimiter.

* @param inputStream The stream to use as the data source.

*/

public CsvReader(Reader inputStream) {

this(inputStream, Letters.COMMA);

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 45
}

/**

* Constructs a {@link com.csvreader.CsvReader CsvReader} object using an

* {@link java.io.InputStream InputStream} object as the data source.

* @param inputStream The stream to use as the data source.

* @param delimiter The character to use as the column delimiter.

* @param charset The {@link java.nio.charset.Charset Charset} to use while

* parsing the data.

*/

public CsvReader(InputStream inputStream, char delimiter, Charset charset) {

this(new InputStreamReader(inputStream, charset), delimiter);

/**

* Constructs a {@link com.csvreader.CsvReader CsvReader} object using an

* {@link java.io.InputStream InputStream} object as the data

* source. Uses a comma as the column delimiter.

* @param inputStream The stream to use as the data source.

* @param charset The {@link java.nio.charset.Charset Charset} to use while

* parsing the data.

*/

public CsvReader(InputStream inputStream, Charset charset) {

this(new InputStreamReader(inputStream, charset));

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 46
/**

* Creates a {@link com.csvreader.CsvReader CsvReader} object using a string

* of data as the source. Uses ISO-8859-1 as the

* {@link java.nio.charset.Charset Charset}.

* @param data The String of data to use as the source.

* @return A {@link com.csvreader.CsvReader CsvReader} object using the

* String of data as the source.

*/

public static CsvReader parse(String data) {

if (data == null) {

throw new IllegalArgumentException(

"Parameter data can not be null.");

return new CsvReader(new StringReader(data));

package com.csvreader;

import java.io.BufferedWriter;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.OutputStream;

import java.io.OutputStreamWriter;

import java.io.Writer;

import java.nio.charset.Charset;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 47
import java.nio.charset.StandardCharsets;

/**

* A stream based writer for writing delimited text data to a file or a stream.

*/

public class CsvWriter {

/**

* Double up the text qualifier to represent an occurrence of the text

* qualifier.

*/

public static final int ESCAPE_MODE_DOUBLED = 1;

/**

* Use a backslash character before the text qualifier to represent an

* occurrence of the text qualifier.

*/

public static final int ESCAPE_MODE_BACKSLASH = 2;

// this holds all the values for switches that the user is allowed to set

private final UserSettings userSettings = new UserSettings();

private final String systemRecordDelimiter = System.getProperty("line.separator");

private Writer outputStream = null;

private String fileName = null;

private boolean firstColumn = true;

private boolean useCustomRecordDelimiter = false;

private Charset charset = null;

private boolean initialized = false;

private boolean closed = false;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 48
/**

* Creates a {@link com.csvreader.CsvWriter CsvWriter} object using a file

* as the data destination.

* @param fileName The path to the file to output the data.

* @param delimiter The character to use as the column delimiter.

* @param charset The {@link java.nio.charset.Charset Charset} to use while

* writing the data.

*/

public CsvWriter(String fileName, char delimiter, Charset charset) {

if (fileName == null) {

throw new IllegalArgumentException("Parameter fileName can not be null.");

if (charset == null) {

throw new IllegalArgumentException("Parameter charset can not be null.");

this.fileName = fileName;

userSettings.Delimiter = delimiter;

this.charset = charset;

/**

* Creates a {@link com.csvreader.CsvWriter CsvWriter} object using a file

* as the data destination. Uses a comma as the column delimiter and

* ISO-8859-1 as the {@link java.nio.charset.Charset Charset}.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 49
*

* @param fileName The path to the file to output the data.

*/

public CsvWriter(String fileName) {

this(fileName, Letters.COMMA, StandardCharsets.ISO_8859_1);

/**

* Creates a {@link com.csvreader.CsvWriter CsvWriter} object using a Writer

* to write data to.

* @param outputStream The stream to write the column delimited data to.

* @param delimiter The character to use as the column delimiter.

*/

public CsvWriter(Writer outputStream, char delimiter) {

if (outputStream == null) {

throw new IllegalArgumentException("Parameter outputStream can not be null.");

this.outputStream = outputStream;

userSettings.Delimiter = delimiter;

initialized = true;

/**

* Creates a {@link com.csvreader.CsvWriter CsvWriter} object using an

* OutputStream to write data to.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 50
*

* @param outputStream The stream to write the column delimited data to.

* @param delimiter The character to use as the column delimiter.

* @param charset The {@link java.nio.charset.Charset Charset} to use while

* writing the data.

*/

public CsvWriter(OutputStream outputStream, char delimiter, Charset charset) {

this(new OutputStreamWriter(outputStream, charset), delimiter);

public static String replace(String original, String pattern, String replace) {

final int len = pattern.length();

int found = original.indexOf(pattern);

if (found > -1) {

StringBuilder sb = new StringBuilder();

int start = 0;

while (found != -1) {

sb.append(original.substring(start, found));

sb.append(replace);

start = found + len;

found = original.indexOf(pattern, start);

sb.append(original.substring(start));

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 51
return sb.toString();

} else {

return original;

package com.easyfitness.bodymeasures;

import android.content.Context;

import android.database.Cursor;

import android.view.LayoutInflater;

import android.view.View;

import android.view.ViewGroup;

import android.widget.CursorAdapter;

import android.widget.ImageView;

import android.widget.TextView;

import androidx.cardview.widget.CardView;

import com.easyfitness.BtnClickListener;

import com.easyfitness.DAO.bodymeasures.DAOBodyMeasure;

import com.easyfitness.R;

import com.easyfitness.enums.Unit;

import com.easyfitness.utils.DateConverter;

import java.util.Date;

public class BodyMeasureCursorAdapter extends CursorAdapter {

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 52
private final LayoutInflater mInflater;

BtnClickListener mClickListener = null;

private Context mContext = null;

public BodyMeasureCursorAdapter(Context context, Cursor c, int flags,


BtnClickListener mD) {

super(context, c, flags);

mContext = context;

mClickListener = mD;

mInflater = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

@Override

public void bindView(View view, Context context, Cursor cursor) {

TextView t0 = view.findViewById(R.id.LIST_BODYMEASURE_ID);

t0.setText(cursor.getString(0));

TextView t1 = view.findViewById(R.id.LIST_BODYMEASURE_DATE);

Date date =
DateConverter.DBDateStrToDate(cursor.getString(cursor.getColumnIndex(DAOBodyMeasu
re.DATE)));

String dateStr = DateConverter.dateToLocalDateStr(date, mContext);

t1.setText(dateStr);

float measure =
cursor.getFloat(cursor.getColumnIndex(DAOBodyMeasure.MEASURE));

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 53
Unit unit =
Unit.fromInteger(cursor.getInt(cursor.getColumnIndex(DAOBodyMeasure.UNIT)));

String t2Str = String.format("%.1f", measure) + unit.toString();

TextView t2 = view.findViewById(R.id.LIST_BODYMEASURE_WEIGHT);

t2.setText(t2Str);

CardView cdView = view.findViewById(R.id.CARDVIEW);

int mFirstColorOdd = 0;

if (cursor.getPosition() % 2 == mFirstColorOdd) {

cdView.setCardBackgroundColor(context.getResources().getColor(R.color.record_backgrou
nd_even));

} else {

cdView.setCardBackgroundColor(context.getResources().getColor(R.color.record_backgrou
nd_odd));

ImageView editImg = view.findViewById(R.id.editButton);

editImg.setTag(cursor.getLong(cursor.getColumnIndex(DAOBodyMeasure.KEY)));

editImg.setOnClickListener(v -> {

if (mClickListener != null)

mClickListener.onBtnClick(v);

});

ImageView deletImg = view.findViewById(R.id.deleteButton);

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 54
deletImg.setTag(cursor.getLong(cursor.getColumnIndex(DAOBodyMeasure.KEY)));

deletImg.setOnClickListener(v -> {

if (mClickListener != null)

mClickListener.onBtnClick(v);

});

@Override

public View newView(Context context, Cursor cursor, ViewGroup parent) {

return mInflater.inflate(R.layout.bodymeasure_row, parent, false);

package com.easyfitness.bodymeasures;

import android.app.AlertDialog;

import android.app.DatePickerDialog;

import android.content.DialogInterface;

import android.database.Cursor;

import android.os.Bundle;

import android.view.Gravity;

import android.view.LayoutInflater;

import android.view.View;

import android.view.View.OnClickListener;

import android.view.ViewGroup;

import android.widget.AdapterView.OnItemLongClickListener;

import android.widget.DatePicker;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 55
import android.widget.EditText;

import android.widget.ImageButton;

import android.widget.ImageView;

import android.widget.TextView;

import android.widget.Toast;

import androidx.appcompat.widget.Toolbar;

import androidx.cardview.widget.CardView;

import androidx.fragment.app.Fragment;

import androidx.lifecycle.ViewModelProvider;

import com.easyfitness.BtnClickListener;

import com.easyfitness.DAO.Profile;

import com.easyfitness.DAO.bodymeasures.BodyMeasure;

import com.easyfitness.DAO.bodymeasures.BodyPart;

import com.easyfitness.DAO.bodymeasures.BodyPartExtensions;

import com.easyfitness.DAO.bodymeasures.DAOBodyMeasure;

import com.easyfitness.DAO.bodymeasures.DAOBodyPart;

import com.easyfitness.MainActivity;

import com.easyfitness.AppViMo;

import com.easyfitness.R;

import com.easyfitness.SettingsFragment;

import com.easyfitness.ValuesEditorDialogbox;

import com.easyfitness.enums.Unit;

import com.easyfitness.enums.UnitType;

import com.easyfitness.utils.DateConverter;

import com.easyfitness.utils.ExpandedListView;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 56
import com.easyfitness.utils.UnitConverter;

import com.easyfitness.utils.Value;

import com.easyfitness.views.EditableInputView;

import com.easyfitness.views.GraphView;

import com.github.mikephil.charting.data.Entry;

import com.onurkaganaldemir.ktoastlib.KToast;

import java.util.ArrayList;

import java.util.Date;

import java.util.List;

public class BodyPartDetailsFragment extends Fragment implements


DatePickerDialog.OnDateSetListener {

private final String mCurrentPhotoPath = null;

private TextView addButton = null;

private EditableInputView nameEdit = null;

private ExpandedListView measureList = null;

private Toolbar bodyToolbar = null;

private GraphView mDateGraph = null;

private DAOBodyMeasure mBodyMeasureDb = null;

private DAOBodyPart mDbBodyPart;

private BodyPart mInitialBodyPart;

private final EditableInputView.OnTextChangedListener onTextChangeListener =


this::requestForSave;

private AppViMo appViMo;

private final BtnClickListener itemClickDeleteRecord = view -> {

switch (view.getId()) {

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 57
case R.id.deleteButton:

showDeleteDialog((long) view.getTag());

break;

case R.id.editButton:

showEditDialog((long) view.getTag());

break;

};

private final OnClickListener onClickAddMeasure = new OnClickListener() {

@Override

public void onClick(View v) {

BodyMeasure lastBodyMeasure =
mBodyMeasureDb.getLastBodyMeasures(mInitialBodyPart.getId(), getProfile());

final Value lastValue = lastBodyMeasure == null

? new Value(0f, getValidUnit(null))

: getValueWithValidUnit(lastBodyMeasure);

ValuesEditorDialogbox editorDialogbox = new


ValuesEditorDialogbox(getActivity(), new Date(), "", new Value[]{lastValue});

editorDialogbox.setTitle(R.string.AddLabel);

editorDialogbox.setPositiveButton(R.string.AddLabel);

editorDialogbox.setOnDismissListener(dialog -> {

if (!editorDialogbox.isCancelled()) {

Date date = DateConverter.localDateStrToDate(editorDialogbox.getDate(),


getContext());

final Value newValue = editorDialogbox.getValues()[0];

mBodyMeasureDb.addBodyMeasure(date, mInitialBodyPart.getId(),
newValue, getProfile().getId());

refreshData();

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 58
}

});

editorDialogbox.show();

};

private final OnItemLongClickListener itemlongclickDeleteRecord = (listView, view,


position, id) -> {

// Get the cursor, positioned to the corresponding row in the result set

//Cursor cursor = (Cursor) listView.getItemAtPosition(position);

final long selectedID = id;

String[] profilListArray = new String[1]; // un seul choix

profilListArray[0] = getActivity().getResources().getString(R.string.DeleteLabel);

AlertDialog.Builder itemActionBuilder = new AlertDialog.Builder(getActivity());

itemActionBuilder.setTitle("").setItems(profilListArray, (dialog, which) -> {

// Delete

if (which == 0) {

mBodyMeasureDb.deleteMeasure(selectedID);

refreshData();

KToast.infoToast(getActivity(),
getActivity().getResources().getText(R.string.removedid).toString() + " " + selectedID,
Gravity.BOTTOM, KToast.LENGTH_SHORT);

});

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 59
itemActionBuilder.show();

return true;

};

private final View.OnClickListener onClickToolbarItem = v -> {

// Handle presses on the action bar items

if (v.getId() == R.id.deleteButton) {

delete();

};

private ImageButton deleteButton;

private TextView editDate;

private EditText editText;

private ImageView bodyPartImageView;

/**

* Create a new instance of DetailsFragment, initialized to

* show the text at 'index'.

*/

public static BodyPartDetailsFragment newInstance(long bodyPartID, boolean


showInput) {

BodyPartDetailsFragment f = new BodyPartDetailsFragment();

// Supply index input as an argument.

Bundle args = new Bundle();

args.putLong("bodyPartID", bodyPartID);

args.putBoolean("showInput", showInput);

f.setArguments(args);

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 60
return f;

private void delete() {

// afficher un message d'alerte

AlertDialog.Builder deleteDialogBuilder = new


AlertDialog.Builder(this.getActivity());

deleteDialogBuilder.setTitle(getActivity().getResources().getText(R.string.global_confirm));

deleteDialogBuilder.setMessage(getActivity().getResources().getText(R.string.delete_bodyp
art_confirm));

// Si oui, supprimer la base de donnee et refaire un Start.

deleteDialogBuilder.setPositiveButton(this.getResources().getString(R.string.global_yes),
(dialog, which) -> {

// Suppress the machine

mDbBodyPart.delete(mInitialBodyPart.getId());

// Suppress the associated Fontes records

deleteRecordsAssociatedToMachine();

getActivity().onBackPressed();

});

deleteDialogBuilder.setNegativeButton(this.getResources().getString(R.string.global_no),
(dialog, which) -> {

// Do nothing

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 61
dialog.dismiss();

});

AlertDialog deleteDialog = deleteDialogBuilder.create();

deleteDialog.show();

private void deleteRecordsAssociatedToMachine() {

DAOBodyMeasure mDbBodyMeasure = new DAOBodyMeasure(getContext());

Profile lProfile = getProfile();

List<BodyMeasure> listBodyMeasure =
mDbBodyMeasure.getBodyPartMeasuresList(mInitialBodyPart.getId(), lProfile);

for (BodyMeasure record : listBodyMeasure) {

mDbBodyMeasure.deleteMeasure(record.getId());

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container,

Bundle savedInstanceState) {

// Inflate the layout for this fragment

View view = inflater.inflate(R.layout.bodytracking_details_fragment, container, false);

mDbBodyPart = new DAOBodyPart(getContext());

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 62
addButton = view.findViewById(R.id.buttonAdd);

nameEdit = view.findViewById(R.id.BODYPART_NAME);

measureList = view.findViewById(R.id.listWeightProfil);

bodyToolbar = view.findViewById(R.id.bodyTrackingDetailsToolbar);

bodyPartImageView = view.findViewById(R.id.BODYPART_LOGO);

CardView nameCardView = view.findViewById(R.id.nameCardView);

mDateGraph = view.findViewById(R.id.bodymeasureChart);

/* Initialisation BodyPart */

long bodyPartID = getArguments().getLong("bodyPartID", 0);

mInitialBodyPart = mDbBodyPart.getBodyPart(bodyPartID);

// Hide Values Input if needed.

/*if (!getArguments().getBoolean("showInput", true)) {

addButton.setVisibility(View.GONE);

} else {

addButton.setVisibility(View.VISIBLE);

}*/

if (mInitialBodyPart.getBodyPartResKey() != -1) {

bodyPartImageView.setVisibility(View.VISIBLE);

bodyPartImageView.setImageDrawable(mInitialBodyPart.getPicture(getContext()));

} else {

bodyPartImageView.setImageDrawable(null); // Remove the image, Custom is not


managed yet

bodyPartImageView.setVisibility(View.GONE);

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 63
/* Initialisation des boutons */

if (mInitialBodyPart.getType() == BodyPartExtensions.TYPE_WEIGHT) {

nameEdit.ActivateDialog(false);

nameEdit.setOnTextChangeListener(onTextChangeListener);

addButton.setOnClickListener(onClickAddMeasure);

measureList.setOnItemLongClickListener(itemlongclickDeleteRecord);

/* Initialisation des evenements */

mBodyMeasureDb = new DAOBodyMeasure(view.getContext());

((MainActivity) getActivity()).getActivityToolbar().setVisibility(View.GONE);

nameEdit.setText(mInitialBodyPart.getName(getContext()));

bodyToolbar.setNavigationIcon(R.drawable.ic_back);

bodyToolbar.setNavigationOnClickListener(v -> getActivity().onBackPressed());

deleteButton = view.findViewById(R.id.deleteButton);

deleteButton.setOnClickListener(onClickToolbarItem);

if (mInitialBodyPart.getType() == BodyPartExtensions.TYPE_WEIGHT) {

deleteButton.setVisibility(View.GONE); // Weight bodypart should not be deleted.

appViMo = new ViewModelProvider(requireActivity()).get(AppViMo.class);

// Observe the LiveData, passing in this activity as the LifecycleOwner and the
observer.

appViMo.getProfile().observe(getViewLifecycleOwner(), profile -> {

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 64
// Update the UI, in this case, a TextView.

refreshData();

});

return view;

@Override

public void onStart() {

super.onStart();

refreshData();

package com.easyfitness.bodymeasures;

import android.content.Context;

import android.view.LayoutInflater;

import android.view.View;

import android.view.ViewGroup;

import android.widget.ArrayAdapter;

import android.widget.ImageView;

import android.widget.TextView;

import com.easyfitness.DAO.Profile;

import com.easyfitness.DAO.bodymeasures.BodyMeasure;

import com.easyfitness.DAO.bodymeasures.BodyPart;

import com.easyfitness.DAO.bodymeasures.DAOBodyMeasure;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 65
import com.easyfitness.R;

import com.easyfitness.graph.MiniDateGraph;

import com.easyfitness.utils.DateConverter;

import com.easyfitness.utils.ImageUtil;

import com.github.mikephil.charting.data.Entry;

import java.util.ArrayList;

import java.util.List;

public class BodyPartListAdapter extends ArrayAdapter<BodyPart> implements


View.OnClickListener {

Context mContext;

private Profile mProfile = null;

public BodyPartListAdapter(ArrayList<BodyPart> data, Context context) {

super(context, R.layout.bodypart_row, data);

this.mContext = context;

@Override

public void onClick(View v) {

/*

int position = (Integer) v.getTag();

Object object = getItem(position);

BodyPart dataModel = (BodyPart) object;*/

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 66
@Override

public View getView(int position, View convertView, ViewGroup parent) {

// Get the data item for this position

BodyPart dataModel = getItem(position);

// Check if an existing view is being reused, otherwise inflate the view

ViewHolder viewHolder; // view lookup cache stored in tag

if (convertView == null) {

viewHolder = new ViewHolder();

LayoutInflater inflater = LayoutInflater.from(getContext());

convertView = inflater.inflate(R.layout.bodypart_row, parent, false);

viewHolder.txtID = convertView.findViewById(R.id.LIST_BODYPART_ID);

viewHolder.txtName = convertView.findViewById(R.id.LIST_BODYPART);

viewHolder.txtLastMeasure =
convertView.findViewById(R.id.LIST_BODYPART_LASTRECORD);

viewHolder.logo = convertView.findViewById(R.id.LIST_BODYPART_LOGO);

viewHolder.miniGraph = new MiniDateGraph(getContext(),


convertView.findViewById(R.id.LIST_BODYPART_MINIGRAPH), "");

convertView.setTag(viewHolder);

} else {

viewHolder = (ViewHolder) convertView.getTag();

//Animation animation = AnimationUtils.loadAnimation(mContext, (position >


lastPosition) ? R.anim.up_from_bottom : R.anim.down_from_top);

//result.startAnimation(animation);

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 67
//lastPosition = position;

viewHolder.txtID.setText(String.valueOf(dataModel.getId()));

viewHolder.txtName.setText(dataModel.getName(getContext()));

if (dataModel.getLastMeasure() != null)

viewHolder.txtLastMeasure.setText(String.valueOf(dataModel.getLastMeasure().getBodyMe
asure().getValue()));

else

viewHolder.txtLastMeasure.setText("-");

if (!dataModel.getCustomPicture().isEmpty()) {

ImageUtil.setPic(viewHolder.logo, dataModel.getCustomPicture());

} else {

if (dataModel.getBodyPartResKey() != -1)

viewHolder.logo.setImageDrawable(dataModel.getPicture(getContext()));

else

viewHolder.logo.setImageDrawable(null); // Remove the image, Custom is not


managed yet

convertView.post(() -> {

DAOBodyMeasure mDbBodyMeasure = new


DAOBodyMeasure(getContext());

List<BodyMeasure> valueList =
mDbBodyMeasure.getBodyPartMeasuresListTop4(dataModel.getId(), getProfile());

if (valueList != null) {

// Recupere les enregistrements

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 68
if (valueList.size() < 1) {

viewHolder.miniGraph.getChart().clear();

} else {

ArrayList<Entry> yVals = new ArrayList<>();

if (valueList.size() > 0) {

for (int i = valueList.size() - 1; i >= 0; i--) {

Entry value = new Entry((float)


DateConverter.nbDays(valueList.get(i).getDate()),
valueList.get(i).getBodyMeasure().getValue());

yVals.add(value);

viewHolder.miniGraph.draw(yVals);

);

package com.easyfitness.DAO.bodymeasures;

import com.easyfitness.utils.Value;

import java.util.Date;

/* DataBase Object */

public class BodyMeasure {

private final Date mDate;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 69
private final int mBodypart_id;

private final long mProfile_id;

private long mId;

private Value mMeasure;

public BodyMeasure(long id, Date pDate, int pBodypart_id, Value pMeasure, long
pProfile_id) {

super();

mId = id;

mDate = pDate;

mBodypart_id = pBodypart_id;

mMeasure = pMeasure;

mProfile_id = pProfile_id;

public long getId() {

return mId;

public void setId(long id) {

mId = id;

public Date getDate() {

return mDate;

public int getBodyPartID() {

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 70
return mBodypart_id;

public Value getBodyMeasure() {

return mMeasure;

public void setBodyMeasure(Value bodyMeasure) {

mMeasure = bodyMeasure;

public long getProfileID() {

return mProfile_id;

public static int getBodyLogoID(int pBodyID) {

switch (pBodyID) {

case ABDOMINAUX:

case DELTOIDS:

case DORSEAUX:

return R.drawable.ic_chest;

case ADDUCTEURS:

case MOLLETS:

case QUADRICEPS:

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 71
case ISCHIOJAMBIERS:

return R.drawable.ic_leg;

case BICEPS:

case TRICEPS:

return R.drawable.ic_arm;

case PECTORAUX:

return R.drawable.ic_chest_measure;

case LEFTBICEPS:

case RIGHTBICEPS:

return R.drawable.ic_arm_measure;

case LEFTTHIGH:

case RIGHTTHIGH:

return R.drawable.ic_thigh_measure;

case LEFTCALVES:

case RIGHTCALVES:

return R.drawable.ic_calf_measure;

case WAIST:

return R.drawable.ic_waist_measure;

case NECK:

case TRAPEZIUS:

case SHOULDERS:

return R.drawable.ic_neck;

case BEHIND:

return R.drawable.ic_hip_measure;

case OBLIQUES:

return R.string.obliques;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 72
return -1;

public static UnitType getUnitType(int pBodyID) {

switch (pBodyID) {

case WEIGHT:

return UnitType.WEIGHT;

case FAT:

case BONES:

case WATER:

case MUSCLES:

return UnitType.PERCENTAGE;

default:

return UnitType.SIZE;

}package com.easyfitness.DAO.cardio;

import android.content.Context;

import android.database.Cursor;

import android.database.sqlite.SQLiteDatabase;

import android.database.sqlite.SQLiteException;

import com.easyfitness.DAO.DAOBase;

import com.easyfitness.DAO.DAOProfile;

import com.easyfitness.DAO.DAOUtils;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 73
import com.easyfitness.DAO.Profile;

import java.text.ParseException;

import java.text.SimpleDateFormat;

import java.util.ArrayList;

import java.util.Date;

import java.util.List;

public class DAOOldCardio extends DAOBase {

// Contacts table name

public static final String TABLE_NAME = "EFcardio";

public static final String KEY = "_id";

public static final String DATE = "date";

public static final String EXERCICE = "exercice";

public static final String DISTANCE = "distance";

public static final String DURATION = "duration";

public static final String PROFIL_KEY = "profil_id";

public static final String NOTES = "notes";

public static final String DISTANCE_UNIT = "distance_unit";

public static final String VITESSE = "vitesse";

public static final String TABLE_CREATE = "CREATE TABLE " + TABLE_NAME

+ " (" + KEY + " INTEGER PRIMARY KEY AUTOINCREMENT, "

+ DATE + " DATE, "

+ EXERCICE + " TEXT, "

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 74
+ DISTANCE + " FLOAT, "

+ DURATION + " INTEGER, "

+ PROFIL_KEY + " INTEGER, "

+ NOTES + " TEXT, "

+ DISTANCE_UNIT + " TEXT, "

+ VITESSE + " FLOAT);";

public static final String TABLE_DROP = "DROP TABLE IF EXISTS " +


TABLE_NAME + ";";

private Cursor mCursor = null;

private Context mContext = null;

public DAOOldCardio(Context context) {

super(context);

mContext = context;

// Getting All Records

private List<OldCardio> getRecordsList(String pRequest) {

List<OldCardio> valueList = new ArrayList<>();

SQLiteDatabase db = this.getReadableDatabase();

// Select All Query

mCursor = null;

mCursor = db.rawQuery(pRequest, null);

// looping through all rows and adding to list

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 75
if (mCursor.moveToFirst()) {

do {

//Get Date

Date date;

try {

date = new
SimpleDateFormat(DAOUtils.DATE_FORMAT).parse(mCursor.getString(mCursor.getColu
mnIndex(DAOOldCardio.DATE)));

} catch (ParseException e) {

e.printStackTrace();

date = new Date();

// Get Profile

DAOProfile lDAOProfile = new DAOProfile(mContext);

Profile lProfile =
lDAOProfile.getProfile(mCursor.getLong(mCursor.getColumnIndex(DAOOldCardio.PROFI
L_KEY)));

OldCardio value = new OldCardio(date,

mCursor.getString(mCursor.getColumnIndex(DAOOldCardio.EXERCICE)),

mCursor.getFloat(mCursor.getColumnIndex(DAOOldCardio.DISTANCE)),

mCursor.getLong(mCursor.getColumnIndex(DAOOldCardio.DURATION)),

lProfile);

value.setId(Long.parseLong(mCursor.getString(mCursor.getColumnIndex(DAOOldCardio.K
EY))));

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 76
// Adding value to list

valueList.add(value);

} while (mCursor.moveToNext());

// return value list

return valueList;

// Getting All Records

public List<OldCardio> getAllRecords() {

// Select All Query

String selectQuery = "SELECT * FROM " + TABLE_NAME + " ORDER BY "

+ KEY + " DESC";

// return value list

return getRecordsList(selectQuery);

// Getting Profils Count

public int getCount() {

String countQuery = "SELECT * FROM " + TABLE_NAME;

open();

SQLiteDatabase db = this.getReadableDatabase();

Cursor cursor = db.rawQuery(countQuery, null);

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 77
int value = cursor.getCount();

cursor.close();

close();

// return count

return value;

public boolean tableExists() {

boolean isExist = true;

Cursor res;

SQLiteDatabase db = this.getReadableDatabase();

try {

res = db.rawQuery("SELECT * FROM " + TABLE_NAME, null);

res.close();

} catch (SQLiteException e) {

isExist = false;

return isExist;

public boolean dropTable() {

SQLiteDatabase db = this.getReadableDatabase();

db.execSQL(TABLE_DROP);

return true;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 78
}

package com.easyfitness.enums;

public enum DisplayType {

FREE_WORKOUT_DISPLAY,

PROGRAM_RUNNING_DISPLAY,

HISTORY_DISPLAY,

PROGRAM_PREVIEW_DISPLAY,

PROGRAM_EDIT_DISPLAY;

public static DisplayType fromInteger(int x) {

switch (x) {

case 0:

return FREE_WORKOUT_DISPLAY;

case 1:

return PROGRAM_RUNNING_DISPLAY;

case 2:

return HISTORY_DISPLAY;

case 3:

return PROGRAM_PREVIEW_DISPLAY;

case 4:

return PROGRAM_EDIT_DISPLAY;

return null;

}package com.easyfitness.enums;

public enum DistanceUnit {

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 79
KM("km"),

MILES("miles");

private String mDisplayName = "";

//Constructeur

DistanceUnit(String displayName) {

this.mDisplayName = displayName;

public static DistanceUnit fromInteger(int x) {

switch (x) {

case 0:

return KM;

case 1:

return MILES;

return null;

public static DistanceUnit fromString(String x) throws Exception{

if (x.equals(KM.mDisplayName)) return KM;

else if (x.equals(MILES.mDisplayName)) return MILES;

throw new Exception("Illegal record type string");

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 80
public String toString() {

return mDisplayName;

public Unit toUnit() {

switch (ordinal()) {

case 0:

return Unit.KM;

case 1:

return Unit.MILES;

return null;

package com.easyfitness.enums;

public enum ExerciseType {

STRENGTH("strength"),

CARDIO("cardio"),

ISOMETRIC("isometric");

private String mDisplayName = "";

ExerciseType(String displayName) {

this.mDisplayName = displayName;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 81
public String toString() {

return mDisplayName;

public static ExerciseType fromInteger(int x) {

switch (x) {

case 0:

return STRENGTH;

case 1:

return CARDIO;

case 2:

return ISOMETRIC;

return null;

public static ExerciseType fromString(String x) throws Exception{

if (x.equals(STRENGTH.mDisplayName)) return STRENGTH;

else if (x.equals(CARDIO.mDisplayName)) return CARDIO;

else if (x.equals(ISOMETRIC.mDisplayName)) return ISOMETRIC;

throw new Exception("Illegal record type string");

package com.easyfitness.enums;

import android.content.res.Resources;

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 82
import com.easyfitness.R;

import java.util.ArrayList;

import java.util.Arrays;

import java.util.Collections;

import java.util.HashMap;

import java.util.HashSet;

import java.util.Iterator;

import java.util.List;

import java.util.Map;

import java.util.NoSuchElementException;

import java.util.Set;

import java.util.SortedMap;

import java.util.TreeMap;

public enum Muscle implements Comparable<Muscle> {

ABDOMINALS(R.string.abdominaux, 0),

BACK(R.string.dorseaux, 1),

BICEPS(R.string.biceps, 2),

CALVES(R.string.mollets, 3),

CHEST(R.string.pectoraux, 4),

DELTOIDS(R.string.deltoids, 5),

GLUTES(R.string.glutes, 6),

HAMSTRINGS(R.string.ischio_jambiers, 7),

OBLIQUES(R.string.obliques, 8),

QUADRICEPS(R.string.quadriceps, 9),

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 83
SHOULDERS(R.string.shoulders, 10),

THIGHS(R.string.adducteurs, 11),

TRAPEZIUS(R.string.trapezius, 12),

TRICEPS(R.string.triceps, 13);

private final int resourceId;

private final int newId;

Muscle(int resourceId, int newId) {

this.resourceId = resourceId;

this.newId = newId;

public static Muscle fromId(int id) {

for (Muscle muscle : Muscle.values()) {

if (muscle.newId == id) {

return muscle;

throw new IllegalArgumentException("No muscle with that id is present");

public String nameFromResources(Resources resources) {

return resources.getString(this.resourceId);

public static Set<Muscle> setFromBodyParts(String bodyParts, Resources resources) {

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 84
if (bodyParts.equals("")) {

return new HashSet<>();

Set<Integer> bodyPartIds = muscleDatabaseIdsFromBodyPartString(bodyParts);

return new HashSet<Muscle>() {{

for (int bodyPartId : bodyPartIds) {

add(fromDatabaseId(bodyPartId, resources));

}};

private static Set<Integer> muscleDatabaseIdsFromBodyPartString(String


bodyPartString) {

Set<String> bodyParts = new HashSet<>(Arrays.asList(bodyPartString.split(";")));

return new HashSet<Integer>() {{

for (String bodyPartString : bodyParts) {

add(Integer.parseInt(bodyPartString));

}};

public static String migratedBodyPartStringFor(Set<Muscle> muscles) {

if (muscles.size() == 0) {

return "";

List<Integer> sortedMuscleIds = sortedListOfMuscleIdsFrom(muscles);

return bodyPartStringFor(sortedMuscleIds);

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 85
public static Set<Muscle> setFromMigratedBodyPartString(String bodyPartString) {

if (bodyPartString.equals("")) {

return new HashSet<>();

String[] bodyParts = bodyPartString.split(";");

return new HashSet<Muscle>() {{

for (String bodyPart : bodyParts) {

add(Muscle.fromId(Integer.parseInt(bodyPart)));

}};

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 86
4.2 Testing Approach

4.2.1. Unit Testing


Unit Testing is a type of software testing where individual units or components of the
software are tested. The purpose is to validate that each unit of the software code performs
as expected. Unit Testing is done during the development (coding phase) of an application
by the developers. Unit Tests isolate a section of code and verify its correctness. A unit
may be an individual function, method, procedure, module, or object.

Unit testing is an important step in the development process because if done correctly, it can
help detect early flaws in code which may be more difficult to find in later testing stages. A
unit test is a way of testing a unit - the smallest piece of code that can be logically isolated in
a system. In most programming languages, that is a function, a subroutine, a method or a
property. The isolated part of the definition is important. In his book "Working Effectively
with Legacy Code", author Michael Feathers states that such tests are not unit tests when they
rely on external systems: “If it talks to the database, it talks across the network, it touches the
file system, it requires system configuration, or it can't be run at the same time as any other
test."

How unit tests work


A unit test typically comprises of three stages: plan, cases and scripting and the unit test
itself. In the first step, the unit test is prepared and reviewed. The next step is for the test
cases and scripts to be made, and then the code is tested. Test-driven development requires
that developers first write failing unit tests. Then they write code and refactor the
application until the test passes. TDD typically results in an explicit and predictable code
base.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 87
Types of unit testing

Unit tests can be performed manually or automated. Those employing a manual method
may have an instinctual document made detailing each step in the process; however,
automated testing is the more common method for unit tests. Automated approaches
commonly use a testing framework to develop test cases. These frameworks are also set to
flag and report any failed test cases while also providing a summary of test cases.

4.2.2 Integration Testing

Integration testing is a software testing technique where individual software components are
combined and tested as a group to ensure that they function properly together. The purpose
of integration testing is to identify defects in the interactions between these components,
which may not be apparent during unit testing.

Integration testing is important because it verifies that the individual software components
can work together as expected and that the interfaces between them are correctly
implemented. It also helps to identify any issues related to performance, reliability, and
security that may arise when multiple components are combined.

To perform integration testing, you need to first identify the individual components of the
software system that need to be integrated. Then, you need to create test cases that cover all
the possible interactions between these components. These test cases should be designed to
test the functionality and the interface of each component when it is integrated with other
components.

The process of integration testing can be performed manually or using automated tools.
Automated testing tools can help to streamline the testing process and can also provide more
accurate and reliable results. Once the testing is complete, any defects or issues that are
identified should be documented and addressed by the development team.

In summary, integration testing is a critical part of software testing that ensures that the
individual components of a software system can work together seamlessly. By performing

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 88
integration testing, you can identify and address any issues before the software is released to
users, which can help to ensure the reliability, performance, and security of the system.

Why integration testing is a necessity:

1. Verify System Functionality: Integration testing ensures that the software system
works as intended when all components are combined. This helps to ensure that the
software performs all the necessary functions and meets the stakeholders'
requirements.
2. Detect Defects Early: Integration testing can identify defects in the software system
early in the development process. This allows the development team to address issues
before software release, saving time and resources.
3. Ensure System Stability: Integration testing helps to ensure system stability and
performance under different conditions. This is critical because it prevents system
crashes, data loss, and other issues that impact the user experience.
4. Identify Interface Issues: Integration testing identifies interface issues between
components, such as compatibility issues and communication problems. These issues
can be addressed before the software is released, preventing costly errors down the
line.
5. Improve User Experience: Integration testing ensures that the software system
provides a seamless and intuitive user experience. This is significant because it
improves user satisfaction, adoption, and retention.

4.2.3 White-Box Testing

The box testing approach of software testing consists of black box testing and white box
testing. We are discussing here white box testing which also known as glass box is testing,
structural testing, clear box testing, open box testing and transparent box testing. It tests
internal coding and infrastructure of a software focus on checking of predefined inputs against
expected and desired outputs. It is based on inner workings of an application and revolves
around internal structure testing. In this type of testing programming skills are required to
design test cases. The primary goal of white box testing is to focus on the flow of inputs and
outputs through the software and strengthening the security of the software.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 89
The term 'white box' is used because of the internal perspective of the system. The clear box or
white box or transparent box name denote the ability to see through the software's outer shell
into its inner workings.

Developers do white box testing. In this, the developer will test every line of the code of the
program. The developers perform the White-box testing and then send the application or the
software to the testing team, where they will perform the black box testing and verify the
application along with the requirements and identify the bugs and sends it to the developer.

The developer fixes the bugs and does one round of white box testing and sends it to the testing
team. Here, fixing the bugs implies that the bug is deleted, and the particular feature is working
fine on the application.

Here, the test engineers will not include in fixing the defects for the following reasons:

o Fixing the bug might interrupt the other features. Therefore, the test engineer should
always find the bugs, and developers should still be doing the bug fixes.
o If the test engineers spend most of the time fixing the defects, then they may be unable
to find the other bugs in the application.

4.2.4 Black-Box Testing

Black box testing is a technique of software testing which examines the functionality of
software without peering into its internal structure or coding. The primary source of black box
testing is a specification of requirements that is stated by the customer.

In this method, tester selects a function and gives input value to examine its functionality, and
checks whether the function is giving expected output or not. If the function produces correct
output, then it is passed in testing, otherwise failed. The test team reports the result to the

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 90
development team and then tests the next function. After completing testing of all functions if
there are severe problems, then it is given back to the development team for correction.

Generic steps of black box testing


o The black box test is based on the specification of requirements, so it is examined in
the beginning.

o In the second step, the tester creates a positive test scenario and an adverse test scenario
by selecting valid and invalid input values to check that the software is processing them
correctly or incorrectly.
o In the third step, the tester develops various test cases such as decision table, all pairs
test, equivalent division, error estimation, cause-effect graph, etc.
o The fourth phase includes the execution of all test cases.
o In the fifth step, the tester compares the expected output against the actual output.
o In the sixth and final step, if there is any flaw in the software, then it is cured and tested
again.

Test procedure

The test procedure of black box testing is a kind of process in which the tester has specific
knowledge about the software's work, and it develops test cases to check the accuracy of the
software's functionality.

It does not require programming knowledge of the software. All test cases are designed by
considering the input and output of a particular function. A tester knows about the definite
output of a particular input, but not about how the result is arising. There are various techniques
used in black box testing for testing like decision table technique, boundary value analysis
technique, state transition, All-pair testing, cause-effect graph technique, equivalence
partitioning technique, error guessing technique, use case technique and user story technique.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 91
4.4.5 Grey Box Testing
White box testing involves complete knowledge of the inner workings of a system under test
and black box involves no knowledge. Grey box testing, however, is a compromise – testing a
system with partial knowledge of its internals. It is most commonly used in integration testing,
end-to-end system testing, and penetration testing.

Grey box testing combines inputs from developers and testers and can result in more effective
testing strategies. It reduces the overhead required to perform functional testing of a large
number of user paths, focusing testers on the paths most likely to affect users or result in a
defect.

Grey box testing combines the benefits of black box and white box testing:

● Ensuring that tests are performed from the user’s perspective, like in black box testing.
● Leveraging inside knowledge to focus on the problems that matter most, and to identify
and resolve internal weaknesses of the system, like in white box testing.

In the world of Application Security Testing , the grey box testing approach is called Interactive
Application Security Testing (IAST). IAST combines:

● SAST — which performs white box testing by evaluating static application code.
● Dynamic Application Security Testing (DAST) — which performs black box testing, by
interacting with running applications and discovering faults and vulnerabilities like a user
or external attacker would.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 92
Chapter 5
Results and Discussion

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 93
T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 94
T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 95
6.Bibliography

1. "MyFitnessPal." MyFitnessPal, Under Armour Connected Fitness, Inc.,


https://www.myfitnesspal.com/.
2. "Fitbit." Fitbit, Inc., https://www.fitbit.com/.
3. "Nike Training Club." Nike, Inc., https://www.nike.com/ntc-app.
4. "JEFIT." JEFIT Inc., https://www.jefit.com/.

T.Y.B.Sc(IT)/Semester-VI/2022-23/KES College 96

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy