APDP Assignment Final TYYS
APDP Assignment Final TYYS
Student ID – RF 17809
3
HND-50 Toe Yuya San
Introduction
I'm dedicated to helping Myan Pro Solutions develop and enhance its software
solutions as a junior mobile developer. In addition to creating mobile applications,
my job also includes improving our internal documentation procedures. For our
internal libraries to be reused and maintained across several projects, effective
documentation is essential.
I was recently tasked with creating and implementing a mobile application for
Prestige Automobiles Company Limited (PAC), which is authorized to import and
distribute genuine BMW parts as well as automobiles in Myanmar. For this project,
a thorough grasp of programming concepts, the use of design patterns, and
adherence to SOLID guidelines are required. The main goal is to develop a
productive and easy-to-use app that enables PAC to easily manage their inventory
of cars.
I will discuss the value of UML diagrams and design patterns, provide an
example of how SOLID principles are applied, and show off clean coding techniques
in this document. The PAC app will be better off thanks to these approaches, which
will also help junior developers comprehend and use these best practices in other
projects.
4
HND-50 Toe Yuya San
OOP languages are typically class-based, which means that an instance of a class
serves as a blueprint for creating objects, which are instances of the class, and
defines the attributes of the data.
Many independent objects that interact with one another in intricate ways may be
represented by a single class. The class-based programming languages C++,
Python, and Java are widely used. (Herrity, 2023)
5
HND-50 Toe Yuya San
be contained within a private variable in the class so that it is inaccessible
from outside code. The function may use the data variable as needed if you
write a method in the person class to carry out a bank transaction. In this
instance, the class effectively encapsulates the individual's private
information.
6
HND-50 Toe Yuya San
the dog and cat child classes inherit by using polymorphism. Alternatively, you
can set this function to "bark" for dogs and "meow" for cats. An animal object
that passes through the interface will either "meow" or "bark" in response to
its surroundings.
Association
An association is a loosely connected class relationship in which each class
exists independently of the others. It frequently serves to depict a straightforward
connection between two objects. As an example,
7
HND-50 Toe Yuya San
A Student class and a Course class are associated in this example. Although a
Student may register for more than one course, each course is a separate entity.
Inheritance
A fundamental concept in object-oriented programming (OOP) is inheritance,
which allows a new class take on the attributes and actions of an old class. Code
reuse is encouraged and a "is-a" relationship is represented. As an illustration,
consider this:
The Animal base class in this example has a speak() function and a name
property. In addition to inheriting from Animal, the Dog class also has a bark()
method and a breed property.
8
HND-50 Toe Yuya San
Composition
One class is composed of other classes, and the existence of the parts is
necessary for the existence of the whole, illustrating a strong relationship between
the classes. It's employed to combine simpler objects to create more complex ones.
This is an example,
An Engine makes up the Car class in this example. The Engine is an integral part
of the Car and is necessary for the Car to operate.
Aggregation
Although the pieces can exist separately, aggregation is a weaker relationship
in which one class contains other classes. It is applied to parts that can be shared
by several entire objects and have their own life cycle. As an example, take a look
at this:
9
HND-50 Toe Yuya San
These instructions set forth best practices for creating software while taking
into account its ongoing maintenance and expansion as the project develops. Using
these techniques can also aid in the development of Agile or Adaptive software, the
avoidance of code smells, and code rewriting.
S - Single-responsibility Principle
O - Open-closed Principle
10
HND-50 Toe Yuya San
I - Interface Segregation Principle
Refactor When Necessary: It's critical to refactor a class or function that begins
to take on excessive responsibility. Break the code up into smaller, more
manageable parts, each handling a single task. This separation improves the code's
manageability while also making it simpler.
Use Mixins and Composition: Use mixins or composition to prevent the creation
of monolithic "god classes" that manage several tasks. By separating concerns,
these techniques let each section of the code concentrate on a specific facet of the
overall functionality.
Writers can write code that is easier to read and maintain by using SRP. This idea is
fundamental to building reliable software that can change subtly over time.
Code example,
11
HND-50 Toe Yuya San
Design Classes and Modules for Extension: Make sure the modules and classes
you create can have additional features added to them in the future. Clear interfaces
and abstract classes that capture common behavior must be defined in order to
facilitate future development without requiring modifications to the original code.
Flutter application developers can create more flexible and manageable applications
by following the Open-Closed Principle. This methodology guarantees the code's
durability and adaptability to modifications, promoting the software's ongoing
enhancement and development.
Code example,
13
HND-50 Toe Yuya San
Use Dart's Type System: To effectively use the type system in Dart, define
contracts using interfaces or abstract classes. Incorporating the anticipated behavior
of the base class into subclasses is enforced through this.
Follow Method Contracts: Make sure subclass overriding methods respect the
base class's contract. It is expected that the overridden methods adhere to the
behavior of the base class in addition to matching the method signatures.
Code example,
14
HND-50 Toe Yuya San
Make customized user interfaces that address the requirements of the clients who
utilize them.
Don't make interfaces that are too big and have too many methods.
When necessary, implement several smaller interfaces and allow clients to select
the interfaces they require.
Code example,
15
HND-50 Toe Yuya San
Code example
17
HND-50 Toe Yuya San
Clean Code is code that is structured and consistent so that it is easy to read,
maintain, understand, and change. It is also strong and safe so that it can meet
performance needs. It gets the most value out of software by making sure it is clear,
easy to maintain, and reliable.
18
HND-50 Toe Yuya San
Example:v
The updated code is simpler to read since it makes use of descriptive variable names
(numbers for l and numbers for i).
Example:
19
HND-50 Toe Yuya San
The updated code makes it simple to add new report types without changing the
existing code by using specific implementations (PDFReport, CSVReport) and an
abstract class called Report.
Maintainability - It's also easier to keep clean code up to date. It's easier to find
and fix problems in code that is well-structured and follows standard practices. This
reduces the overall time and effort required to maintain a codebase.
Example:
20
HND-50 Toe Yuya San
Duplicate values are avoided and the function improves with the new addToList
function, which makes sure the value is added only if it does not already exist in the
list.
Efficiency: Lastly, it is more efficient to write clean code. Clean code takes less
time to read and comprehend, which helps with change requests and problem
solving. This can lower maintenance costs and accelerate overall development.
Example:
21
HND-50 Toe Yuya San
In general, a software project's success depends heavily on the quality of the
code that is written. It results in improved readability, maintainability, scalability,
and efficiency, which facilitates the efficient and manageable delivery of high-quality
products.
Rather than using hard-coded values, use named constants. This procedure makes
code modification easier and more clear.
22
HND-50 Toe Yuya San
Use the DRY (Don't Repeat Yourself) Principle
Functions, classes, modules, libraries, and other abstractions can be used to reuse
code and prevent code duplication. By lowering the likelihood of mistakes and bugs,
this technique improves the efficiency, consistency, and maintainability of code.
Principles of OOP
Design Pattern
23
HND-50 Toe Yuya San
Reusable solutions for recurring issues in software design are known as design
patterns. They give developers a common language and encapsulate best practices.
The three primary categories of design patterns are structural, behavioral, and
creative patterns. In order to provide effective and adaptable instantiation,
creational patterns concentrate on object creation mechanisms. By using simpler
components to create complex structures, structural patterns address object
composition. Behavioral patterns help to clarify and maintain code behavior by
defining how objects interact and communicate.
The uniformity that design patterns offer enhances the readability and
maintainability of code. They aid developers in producing more readable,
understandable code, which promotes teamwork. Additionally, since many common
25
HND-50 Toe Yuya San
problems have already been solved using design patterns, using them often results
in less code and eliminates the need to start from scratch.
Creational Patterns
Creational patterns, as the name implies, are closely related to the creation
of objects. These patterns are intended to be used when creating new classes. The
software design may become more complex or even have design flaws if the
necessary objects are created in the traditional format. By regulating the creation
of objects, creational design patterns provide a solution to this issue.
26
HND-50 Toe Yuya San
software and have to choose between different classes during runtime instead of
compilation.
A few examples of creational design patterns are the Factory Method, Object
Pool, Prototype, Abstract Factory, and Singleton.
27
HND-50 Toe Yuya San
Structural Patterns
When building larger structures from smaller, individual parts that are
generally of different classes, structural patterns can be helpful. Because these
patterns identify a fundamental technique for identifying relationships among
entities, they can also be used to simplify the design. The basic goal of applying
structural patterns is to improve the software's functionality for the classes that are
a part of it without significantly altering its basic structure.
28
HND-50 Toe Yuya San
Bridge - To establish a clear division between the interface and its implementation,
the Bridge design pattern is employed.
Composite - useful for organizing simple and composite objects into a proper tree-
like structure. This is beneficial because it allows you to depict the software design
using hierarchies, with each node in the tree structure having the ability to carry
out a particular function.
Façade - By giving the client an interface and concealing the intricacies of the
system, the facade design pattern keeps a cover on.
Private Class Data - Access to private class data is restricted for mutators and
accessors.
Proxy - In this design pattern, objects stand in for other objects. For example, a
college student can provide an attendance report for another student.
Behavioral patterns
Design patterns that characterize and identify how various objects interact
with one another are known as behavioral patterns. By utilizing behavioral design
patterns, complex software design flowcharts can be simplified to show the
relationships between different class objects.
Null Object - The goal of this design pattern is to produce a null object that
represents an object's absence.
30
HND-50 Toe Yuya San
State - When an object's behavior varies according to its internal state, the state
design pattern is applied.
Strategy - The policy pattern, also referred to as the strategy design pattern, aids
in the runtime algorithm selection.
Visitor - An algorithm and the object structure it operates on are separated by this
design pattern. In essence, it leads to no modifications other than the addition of
new operations to the current classes.
31
HND-50 Toe Yuya San
Clean, maintainable, and scalable code is produced when SOLID principles are
applied, greatly improving the object-oriented application development process.
A class should only have one duty or purpose, which implies that it should
have one reason to change.
SRP is demonstrated in the UML by making sure every class has a unique,
single responsibility. This is an example of a basic class diagram that complies with
SRP:
33
HND-50 Toe Yuya San
Code example
The `User` class in the given Dart code encapsulates basic user data and
provides methods to access attributes. It represents a user entity with attributes
{name} and {email}. It adheres to the Single Responsibility Principle by
concentrating only on user data management. With a `saveUser` method to store
user data, the `UserStorage` class manages the task of storing `User` objects.
Code maintainability and flexibility are improved by this separation, which
guarantees that each class has a specific role: `User` manages user data, while
34
HND-50 Toe Yuya San
`UserStorage` manages data storage. As the application grows, this adherence to
SRP encourages easier scalability and clearer code organization.
Classes, modules, functions, and other software entities need to be closed for
modification but open for extension.
Code example
35
HND-50 Toe Yuya San
The Shape abstract class in the provided Dart code defines an abstract area()
method that makes sure every subclass implements its own area calculation. While
the Rectangle subclass determines its area based on width and height, the Circle
subclass extends Shape and determines its area based on the radius. By
encouraging code reuse, preserving flexibility, and enabling the addition of new
shapes without altering already-written Shape code, this configuration complies with
the Open/Closed Principle of SOLID principles. This design uses inheritance and
polymorphism to bring shape-related operations under a single interface, ensuring
that each shape type encapsulates its unique behavior.
Subtypes must be able to be substituted for their base types without affecting
the program's correctness.
Subclasses that can take the place of the base class without affecting functionality
are used as an example of LSP.
36
HND-50 Toe Yuya San
Code example
The `Bird` abstract class in the Dart code provided acts as a template for
different kinds of birds, specifying a standard behavior with the `fly()` method that
subclasses need to implement. A sparrow-specific concrete implementation of
`fly()` is provided by the `Sparrow` class, which is an extension of `Bird`. By
guaranteeing that every subclass (including hypothetical future subclasses like
{Eagle} or {Penguin}) can seamlessly substitute their base class ({Bird}) without
affecting the program's correctness, this setup serves as an example of the Liskov
Substitution Principle (LSP) of the SOLID principles. The `fly()` behavior can be
expanded by any subclass while still being compatible with the `Bird` interface,
allowing for more code flexibility and scalability in the application's bird-related
features.
It is not appropriate to make clients rely on interfaces they do not use. In other
words, a class should only implement the methods that it finds useful.
37
HND-50 Toe Yuya San
UML class diagram
Split large interfaces into smaller, more focused interfaces to demonstrate ISP.
Code example
38
HND-50 Toe Yuya San
Classes implementing the Workable and Eatable abstract classes are required
to follow the specific behaviors defined by their work() and eat() methods,
respectively. Workable is implemented by the Robot class, which offers a customized
version of the work() method for tasks pertaining to robots. The Interface
Segregation Principle (ISP) of the SOLID principles, on the other hand, is
demonstrated by the Human class, which implements both Workable and Eatable
and makes sure that classes only rely on interfaces that are relevant to them. This
design ensures that each class has a minimal and well-defined set of responsibilities
and promotes code cohesion by allowing the Robot and Human classes to
independently define and execute their respective functionalities (eat() and work()).
39
HND-50 Toe Yuya San
Modules at higher levels shouldn't rely on modules at lower levels.
Abstractions should be the basis for both. Details shouldn't influence abstractions.
Abstractions should drive details.
Introduce abstractions (interfaces or abstract classes) that are necessary for both
high-level and low-level modules to function in order to demonstrate DIP.
Code example
40
HND-50 Toe Yuya San
41
HND-50 Toe Yuya San
Singleton pattern
Code example
42
HND-50 Toe Yuya San
To make sure that there can only be one instance of the class, the Singleton
class is implemented. This is accomplished by initializing a static final instance
(_instance) upon class loading and utilizing a private named constructor
(Singleton._internal()). This one instance can be accessed globally through the
getter method instance. By printing a message, the doSomething method shows
how the Singleton instance works. The Singleton pattern's goal of offering a single,
consistent instance throughout the application is demonstrated in the main function
by calling the Singleton instance's doSomething method and accessing it through
the Singleton.instance getter.
Although the Factory Method pattern specifies an interface for object creation,
subclasses are free to modify the kind of objects that are generated.
Code example
43
HND-50 Toe Yuya San
We use the Factory Method design pattern in this Dart code to generate
various products via a shared interface. All concrete products must implement the
`doStuff` method, which is defined by the `Product` abstract class. Concrete
classes {ConcreteProductA} and `ConcreteProductB} implement `Product` and
give `doStuff` particular behaviors. The `Creator` abstract class contains the
method `someOperation} that utilizes the product produced by `factoryMethod` to
carry out an operation, as well as the `factoryMethod` that is in charge of creating
`Product` objects. The subclasses {ConcreteCreatorA} and `ConcreteCreatorB} of
`Creator} return instances of `ConcreteProductA} and {ConcreteProductB},
44
HND-50 Toe Yuya San
respectively, by overriding `factoryMethod}. `ConcreteCreatorA} and
`ConcreteCreatorB} instances are created and their `someOperation` method is
called in the `main} function, illustrating how the Factory Method pattern enables
the creation of various products through a consistent interface. The Open/Closed
Principle is upheld by this method, which encourages loose coupling and permits the
addition of new product types without changing the existing code.
Adapter Pattern
By converting a class's interface into a different interface that the client
expects, the adapter pattern makes it possible for incompatible interfaces to exist
together.
Code example
45
HND-50 Toe Yuya San
Decorator Pattern
46
HND-50 Toe Yuya San
Individual objects can have behavior added to them statically or dynamically
using the decorator pattern, all without affecting the behavior of other objects in the
same class.
Code example
47
HND-50 Toe Yuya San
Observer Pattern
48
HND-50 Toe Yuya San
UML class diagram
Code example
49
HND-50 Toe Yuya San
Strategy Pattern
51
HND-50 Toe Yuya San
Code example
52
HND-50 Toe Yuya San
53
HND-50 Toe Yuya San
strategy of ‘ConcreteStrategyA’, a `Context’ instance is created in the `main’
function. Its `executeStrategy` method is then called, printing "Algorithm A". Then,
using `setStrategy’, the strategy is modified to `ConcreteStrategyB’, and
`executeStrategy` is called once more, displaying "Algorithm B". This pattern
facilitates reuse and flexibility by enabling dynamic runtime changes to the context's
behavior without altering the code of the context.
Singleton Patterns
54
HND-50 Toe Yuya San
The Singleton design pattern, which ensures a class has only one instance and
offers a global point of access to it, is best illustrated by the Library class. In this
instance of implementation:
Static Instance: The class starts with a single instance of Library and keeps a private
static instance of itself.
Factory Method: To guarantee uniform access to the single instance throughout the
application, the factory Library() method returns the singleton instance _instance.
Observer Pattern: Makes use of the Observer pattern by keeping track of observers
(observers) who receive notifications via _notifyObservers() whenever a book is
added or removed.
Because of the way the application is designed, all components share a single
instance of Library, which makes it easier to manage books centrally and enables
observers to respond to changes in the library's status.
55
HND-50 Toe Yuya San
The Dart code shows how to create different kinds of books (textbook and
novel) from an abstract Book class by using the inheritance hierarchy and Factory
Method pattern.
Abstract Book Class: All concrete book types inherit this abstract base class, which
defines common methods (getTitle(), getAuthor(), and getISBN()) and common
attributes (title, author, and isbn). This follows the guidelines of object-oriented
programming and encourages the reuse of code.
Textbook and Novel are Concrete Book Classes that extend the Book class by
extending its constructor to initialize particular attributes (title, author, isbn) using
the super keyword. This specialization enables unique characteristics and behavior
suited to various book genres.
BookFactory: The creation logic for various book kinds (textbooks and novels) is
contained in the BookFactory class. Based on a given type parameter, it dynamically
instantiates and returns the appropriate subclass using the createBook() method.
This centralizes the creation process and decouples client code from the details of
object creation, improving scalability and flexibility.
Adapter Pattern
56
HND-50 Toe Yuya San
The CatalogItem class serves as a target interface and has three methods that
return empty strings: getTitle(), getAuthor(), and getISBN(). The contract that
clients expect is defined by this interface.
BookAdapter Class: A class that extends CatalogItem and modifies a Book instance
to comply with the CatalogItem specification. In order to return the relevant
properties from the Book instance, it implements the getTitle(), getAuthor(), and
getISBN() methods and contains a Book object. This makes it possible to use Book
objects instead of the original Book class in situations where CatalogItem instances
are anticipated.
57
HND-50 Toe Yuya San
Decorator Pattern
BorrowableBook Class: This class adds functionality to track the book's borrower
and accepts an instance of Book as a parameter. By assigning these calls to the
encapsulated Book instance, it implements the CatalogItem interface and provides
implementations for getTitle(), getAuthor(), and getISBN(). It also introduces two
methods: returnBook(), which resets the borrower attribute, and borrowBook(),
which sets the borrower attribute to the borrower's name that is provided. With the
help of this extension, a Book can have borrowing capabilities "decorated" without
changing the original Book class.
58
HND-50 Toe Yuya San
Observer Pattern
The LibraryObserver class is an abstract class that specifies the update method that
all concrete observers need to implement. By enforcing a common interface, this
design enables uniform notification of changes to all observers.
59
HND-50 Toe Yuya San
Strategy Pattern
The SearchStrategy class is an abstract class that defines a search method that
accepts a query string and a list of Book objects as parameters. This class allows for
interchangeability and flexibility by defining the common interface for all search
strategies.
61
HND-50 Toe Yuya San
62
HND-50 Toe Yuya San
FirebaseDataService Class
Register Class
The application's main entry point, the Register class, configures the
CarForm's theme and navigation. In order to ensure an organized application
structure, this class is in charge of configuring the initial state and routing.
CarForm Class
The stateful widget known as the CarForm class controls the inputs and
interactions of the car form. It respects the principle of single responsibility and
encourages clear separation of concerns by managing state and user input.
uploadData Method
The uploadData method uses the DataService to upload the data after
gathering it from the form fields. It makes sure users are aware of the operation's
success by using Fluttertoast to provide user feedback. The focused responsibility
of this method improves maintainability and clarity.
_buildTextField Method
A text field widget is created using the _buildTextField method, which also
takes a label and controller as input. This builder pattern-compliant encapsulation
of widget creation encourages modularity and reuse.
_buildButton Method
A styled button with the supplied text, a onPressed callback, and an optional
width is created by the _buildButton method. This approach improves the modularity
and maintainability of the code by encapsulating the creation of buttons.
63
HND-50 Toe Yuya San
_buildButtonRow Method
CarForm class: Defines UI interactions and the state of the car form.
64
HND-50 Toe Yuya San
Following the same interface, FirebaseDataService can be used anywhere
DataService is expected.
Just the essential methods for data operations are provided by the narrow and
uncomplicated DataService interface.
Design Patterns
Factory Pattern
The Factory Pattern can be applied easily because of the DataService interface's
abstraction, even though it isn't implemented explicitly. This design pattern
encourages flexibility and scalability by making it easier to create and inject various
data service implementations as needed.
Dependency Injection
The Dependency Injection pattern is shown by the CarForm class, which uses its
constructor to obtain an instance of DataService. By separating the class from
particular data service implementations, this method improves testability and makes
switching between implementations simple.
65
HND-50 Toe Yuya San
Builder Pattern
Meaningful Names
The code illustrates how variables, functions, and classes are named meaningfully,
improving readability and maintainability. For instance, the class CarForm, the
variables modelController, and uploadData have descriptive names that make it
obvious what they do and how they work.
Following the principle that a function should only be in charge of one task, every
method in the code focuses on a single functionality. For example, the uploadData
method's exclusive purpose is to manage data upload and give the user feedback,
guaranteeing the code's design clarity and simplicity.
Minimize Procedures
Small, targeted methods are maintained throughout the code; _buildTextField and
_buildButton are two examples. These techniques are clear and focused on
producing particular user interface elements, which encourages modularity and
readability.
66
HND-50 Toe Yuya San
Consistent Formatting
Throughout the code, standard naming conventions, spacing, and indentation are
used. This formatting consistency makes work easier to collaborate on and maintain,
in addition to making the text easier to read.
Error Handling
67
HND-50 Toe Yuya San
The structure of a mobile application aimed to manage BMW vehicle
information is shown in this UML class diagram. The diagram shows the interactions
between the various app components.
68
HND-50 Toe Yuya San
69
HND-50 Toe Yuya San
CarForm relies on DataService for data operations; this is indicated by
the dependency injection attribute dataService of type DataService in
the CarForm class. An instance of _CarFormState is returned by the
createState function, connecting the StatefulWidget to its state class.
This UML class diagram clearly shows the difference between StatelessWidget and
StatefulWidget, demonstrating an organized method for developing a Flutter
application. The diagram also shows how data operations are abstracted using
service classes and how state is managed independently from the UI components
using State subclasses. Because of the design's emphasis on modularity, the code
is simpler to maintain and expand. The foundation of this application's functionality
is the use of TextEditingController for form inputs and methods for managing user
interactions (such as login and data upload).
UI Design Explanation
Login Page
70
HND-50 Toe Yuya San
The logo and branding of the provided UI design suggest that it is a login
screen for a BMW-related application. Applications that need user authentication
frequently have this screen. A comprehensive overview of each element and its
function can be read below:
Logo
The BMW logo can be seen clearly in the top center of the screen. For the user, this
acts as a visual cue that shows the association with BMW right away.
The words "SHEER DRIVING PLEASURE" are shown beneath the logo, reiterating the
brand's tagline and extending a warm greeting to the user.
Form field
Login button
71
HND-50 Toe Yuya San
The "LOGIN" button is a blue button that appears beneath the form fields. The
user can submit their login credentials by clicking this button. It starts the
authentication procedure when clicked.
There is a link labeled "Forgot Password?" below the login button. In the event that
users forget their password, they can get it by clicking on this link. Usually, it starts
a recovery process or reroutes the user to a password recovery screen.
Register Page
Section Header
There is a back navigation arrow on the left side of the top section.
The BMW logo in the center most likely indicates the brand connected to this car
inventory app.
72
HND-50 Toe Yuya San
Input field
"Enter Model" allows users to enter the model of the car, such as "BMW X5".
"Enter Name" allows the user to enter the name of the car (BMW)
"Enter Purchase Price (USD)" allows users to enter the car's purchase price in US
dollars.
"Enter Category": This field probably lets users choose the type of car they want
(sedan, SUV, etc.).
"Enter Year of Manufacture": This field allows users to enter the year that the car
was produced.
Action button
Four buttons that are horizontally aligned are located at the bottom of the interface:
"Update"- Probably used to update data regarding cars that are currently on the
road.
73
HND-50 Toe Yuya San
An arrow pointing left most likely points to the previous page's navigation or back
button.
Car list
Several BMW car models are listed in the main content area.
74
HND-50 Toe Yuya San
Search Data
There's a text input field beneath the title with the placeholder text "Enter Model."
Users have the option to search for a specific car model by typing its name.
Action button
"Search"- Clicking it is probably going to start a search for the car model you
entered.
"Delete"- Using this button will either erase any previous search results or clear the
input field.
75
HND-50 Toe Yuya San
Information about a car model that is searched in above field is shown in an outlined
box:
Update Page
Navigation bar
76
HND-50 Toe Yuya San
The top of the screen is where the navigation bar is located. There are two icons in
it.
Left Back Arrow: This icon probably enables users to return to a previous step or
screen.
Users can perform related actions or edit settings by tapping the Edit Icon (Right).
Input field
Two input fields are available for user interaction: "Search Car Model" allows users
to enter the name of a particular car model they're looking for.
The field labeled "Enter New Price (USD)" enables users to enter a new car price in
US dollars.
Buttons
The "Search" button, when clicked, probably starts a search based on the car model
that was entered.
"Update" Button: This button most likely uses the value entered in the second input
field to update the price of the car.
Unit testing
Integration testing
This kind of testing involves combining and testing different software
components. This offers a chance to check how well the new module interacts with
other parts and integrates with the shared code base.
System testing
This is an extensive test to see how well the software works as an integrated
unit. QA engineers determine how the completed application satisfies the specified
requirements by conducting various testing methods for various program modules.
(Poliarush, 2023)
78
HND-50 Toe Yuya San
Katalon Studio
Katalon Studio is an
additional open-source on the
web, mobile, and API testing
suite. With features like
recording, auto-generating test
scripts, and robust integrations,
it is one of the most
comprehensive testing suites
on the list.
Even non-programmers can easily start using this testing framework because it is
robust enough to support scalability.
Extant CI/CD configurations are well-suited for Katalon Studio. For example,
integrating it with Github or Gitlab's continuous testing tools is simple. It's ideal for
Agile teams because of this.
OpenTest
79
HND-50 Toe Yuya San
Keyword-driven testing, parallel testing, data-driven testing, and mobile testing
using Appium and Selenium are a few of its most notable features.
Cypress
Because tests can be grouped by browser type, environment, package type, and
other criteria, its dashboard increases testing power and speed. The parallelization
functionality makes it simple for developers to test more features and run more
tests. (Vergara, 2020)
Gatekeeper
80
HND-50 Toe Yuya San
Large businesses that require
unrestricted storage and broad access
can use this VMS. With more than 200
contracts, Gatekeeper's cloud-based
solution provides seamless vendor
lifecycle management. In addition, it
offers e-sign capabilities, vendor
requests, and onboarding automation
options for contract approvals.
Cflow
81
HND-50 Toe Yuya San
approvals, reminders, and notifications for procurement orders, and the ability to
create customized reports are just a few of the main benefits of utilizing Cflow.
Genuity
Comparison Table
82
HND-50 Toe Yuya San
Updates Managed by the Regular updates from the
development team vendor
Integration testing
Integration testing, which usually comes after unit testing, makes sure that
all of the functionalities work together seamlessly to provide smoothly operating
software as a whole. Integration testing can be approached in a number of ways,
including the Sandwich, Top-Down, Bottom-Up, and Big Bang techniques.
Widget testing
The tested Widget should, for instance, be able to execute layout, instantiate
child widgets, and receive and respond to user events and actions. For this reason,
a widget test is more thorough than a unit test. But a widget test uses a simplified
implementation instead of a complete UI system, just like a unit test does. (docs,
2024)
83
HND-50 Toe Yuya San
Clear Purpose: It is evident that the test's goal is to confirm that buttons and text
fields two types of user interface elements are present in the Updatedata widget
and that their placement in the widget tree is accurate.
84
HND-50 Toe Yuya San
Cons of widget testing
Although "Presence of email and password text fields" is mentioned in the test
description, the automobile search and price fields are the actual keys that are being
evaluated. Confusion may result from this.
The test may fail if in the future, more widgets with the same keys (search_field,
price_field, update_button) are added to the widget tree. It is preferable to scope
keys with more precision.
Limited Scope
The test does not examine the widgets' starting values, states, or interactions—all
of which are critical components of a thorough test suite—it merely confirms the
widgets' existence.
Unit testing
85
HND-50 Toe Yuya San
Modular Function
Because the calculating logic is contained in a distinct method called calculate selling
price, the code is more reusable and simpler to test on its own.
86
HND-50 Toe Yuya San
The precise and uncomplicated test case guarantees that, given the inputs, the
selling price computation is accurate.
Readable Code
The test case and the function are both written in a clear, accessible style that
facilitates understanding of the implementation and goal by others.
The test has the anticipated value (54600000) hardcoded. This value will need to
be updated manually, which can be error-prone if the calculation's logic changes.
There is only one case covered in the test. Testing a variety of scenarios, including
edge cases (such as zero or negative values), would be more reliable.
Demonstration
https://drive.google.com/file/d/13ywItJNVPlL_M4a49hdTeVt9alR3WavA/view?usp
=sharing
87
HND-50 Toe Yuya San
88
HND-50 Toe Yuya San
References
blog.codacy, 2023. What Is Clean Code? A Guide to Principles and Best Practices. [Online]
Available at: https://blog.codacy.com/what-is-clean-code
[Accessed 2 7 2024].
cflowapps, 2024. Top 5 Vendor Management Tools Every Organization Needs to Consider.
[Online]
Available at: https://www.cflowapps.com/top-vendor-management-tools/
[Accessed 9 7 2024].
Hadiyanto, Z., 2021. Types of Relation Between Classes in Object Oriented Programming.
[Online]
Available at: https://dev.to/fajarzuhrihadiyanto/types-of-relation-between-classes-in-
object-oriented-programming-551m
[Accessed 19 6 2024].
89
HND-50 Toe Yuya San
Poliarush, M., 2023. Types of Automated Testing Explained Within Test Strategy. [Online]
Available at: https://testomat.io/blog/types-of-automated-testing-explained-within-test-
strategy/
[Accessed 9 7 2024].
Team., T. R., 2023. Design pattern: what is it and why use it?. [Online]
Available at: https://ryax.tech/design-pattern-what-is-it-and-why-use-it/
[Accessed 19 6 2024].
Vergara, R., 2020. The Best Automation Testing Tools For Developers. [Online]
Available at: https://www.freecodecamp.org/news/best-automation-testing-tools-for-
developers/
[Accessed 9 july 2024].
Walia, S. O. a. A. S., 2024. SOLID: The First 5 Principles of Object Oriented Design.
[Online]
Available at: https://www.digitalocean.com/community/conceptual-articles/s-o-l-i-d-the-
first-five-principles-of-object-oriented-design
[Accessed 20 6 2024].
90