Test Presentation
Test Presentation
● High performance.
How?
● We’ve already answered WHY?, how was a
matter of hustling within the allotted time.
● We hustled.
Tasks as a manager:
● Study
● Distribute tasks
● Supervise
Tasks:
○ Widget test
○ Unit test
○ Integration test
● External tests
○ Game groups
Methodology:
○ Widget test ~ UI
○ Unit test ~ Firebase group + Controller
Integration test:
● I’ve assigned three members for this task, myself
included.
○ Members:
■ Henok Wendimu
■ Ensermu Yigezu
Challenges:
● As always, we had to study the whole thing anew.
● Exams and Assignments
● Reluctance
Over all:
○ This phase was less stressful.
■ We’ve learned a lot through reading and
struggling to fix bugs.
■ There were a lot of memes from the start.
■ Alems has also her share of memes as well.
○ It was an experience that adds value
Integration test:
● I’ve assigned three members for this task, myself
included.
○ Members:
■ Henok Wendimu
■ Ensermu Yigezu
Widget-test
Subgroup manager:
Girmachew Azanaw
WIDGET TEST
In this presentation I will present:
14
WIDGET TEST
What is Widget test?
● It is utilized for testing a single widget, and
the objective of this test is to check
whether the widget works and looks true
to form.
● How the UI works and how it interact with
other widget
15
Challenges
16
WIDGET TEST
17
1.
Transition headline
Let’s start with the first set of slides
Widget Test
Login page
Sign up page
By :
Henok Mitku
Login page Test
In this test we verify the widget looks and interaction in the login
page
❖ We use mockito
Basic widgets in login page
20
Login page Test
To see the interaction we have three cases
21
Test code for case1
22
Test code for case3
23
Login page Test
For these tests we get the expected interaction from our app. And we get this
output
24
Sign up page Test
Sign up page has almost the same test as login page. In sign up
page we have additional widgets like name phone and additional
confirmation password widgets
25
Hello!
I am Galane Basha
I am going to present the Home
page and popular destination tests
26
Home Hotels page section: Check if the
section is displayed, clickable and
detail information about the hotel
27
Home Search Widget: Check if the
search icon on the appbar opens
the search page. Check if the result
28
Popular
Destinations Hotels page section: Check if the
Page Test
section is displayed, clickable and
detail information about the hotel
opens after clicking a single card
30
Yeshiwas
Tikimu
Widget test
Hotel detail page and attraction site page
Hotel details page widget test
Tab 1. Location : Check if the
location icon is displayed,
1. Overview: check if the
clickable and redirected to
overview tab is exists and
google map.
clickable .
2. Phone: check if the phone
2. Photo: check if the photo
icon is displayed, clickable
tab is exists and clickable .
and redirected to call dial.
3. Review: check if the review
3. Name and rating icon:check
tab is exists and clickable .
if the page displays name and
rating icon
32
33
Attraction site details page
widget test
Tabs 1. Location : Check if the location
icon is displayed, clickable and
1. Overview: check if the
redirected to google map.
overview tab is exists and
2. Phone: check if the phone icon is
clickable .
displayed, clickable and redirected
2. Photo: check if the photo
to call dial.
tab is exists and clickable .
3. Button : check if the find guide
3. Review: check if the review
elevated button exists ,clickable
tab is exists and clickable .
and redirected to guides page.
34
This is a slide title
35
In two or three columns
Blue Red
Is the colour of the Is the color of blood,
clear sky and the and because of this it
deep sea. It is located has historically been
between violet and associated with
green on the optical sacrifice, danger and
spectrum. courage.
36
1.
Transition headline
Let’s start with the first set of slides
Natnael Dereje
Widget Testing
1. Edit profile page
2. Favorites page
38
Widget Testing
Widget(component) testing is used for testing a single widget, and the objective of this test
is to check whether the widget works and looks true to form.
To test widget classes, we need a few additional tools provided by the flutter_test package.
The flutter_test package provides the following tools for testing widgets:
39
1. Add the flutter_test dependency :- Before writing tests, i have
included the flutter_test dependency in the dev_dependencies section of
the pubspec.yaml.
void main() {
testWidgets('Testing for edit profile page', (WidgetTester tester) async {
41
42
Hey!
My name is maedin seid
I have done widget test related to the
admin app
43
Admin page widget test
widgets User Expectation
interaction
Check outputs
code snippets
expect(find.byType(widgetName),findsOneWidget)
46
Add city page widget test
widgets User Expectation
interaction
47
Implementation of the code to test the widgets mentioned
Check outputs
code snippets
expect(find.byType(widgetName),findsOneWidget)
48
UNIT TEST
Controller class unit test
Subgroup Manager
Samuel Negalign
Group members
● Samuel negalign * Daniel Abera
● Tigist Solomon * Natnael Fitsum
● Nigatu paulos
● Robenus Belete
49
What is going to be covered
● Introduction
● Our role as a group
● Challenges
● How do we face challenges
Introduction
What is Unit Test
❖ UNIT TESTING is a type of software testing where individual
units of components of a software are tested
❖ Unit Test isolates a section of code and verify its correctness.A
unit may be an individual function, method,procedure,module,
or object
❖ The purpose is to validate that each unit of the software code
performs as expected.
❖ There are many available tools for unit testing
but we use Mockito package.
❖ What mockito does is that, it emulates a live web service
or database and return results depending on the situation
Our role as a group
❖ Our role is mainly unit testing every logic business’s
method (controller class’s method).
❖ Getting defects as possible as we can by creating test
Classes
❖ And to do that we create Test classes that contains
tests of the method and through expect method verify
expected result with test result
Challenges
❖ Understanding how to unit test and how
to use mockito properly was our main challenge
❖ As a manager to this group I faced some challenge on
dividing the tasks equally because some classes have more
methods than the other
❖ Also the time is not good for us since there were mid exams and
other projects
How do we face Challenges
❖ We solve the first issue by reading flutter documentation
on how to unit test using mockito
❖ I solved the second issue by trying to give them equal tasks based
on their weigh by checking each methods on every class
❖ By using our time properly
Nigatu Paulos
State Management sub group
Worked on testing:
❖ 1. Favorite_Attraction_Controller
❖ 2. Favorite_Hotel_Controller
❖ 3. Favorite_Guide_Controller
❖ 4. Detail_Item_Controller
Implementation
Worked on testing:
❖ 1. Hotel Page Controller
❖ 2. Sign up Controller
❖ 3. Search Controller
❖ 4. Tour guide authentication Controller
❖ 5. Reset Password Controller (Admin)
1. Hotels Controller
Methods Test Error Comment
tested result summary
69
Edit_profile controller
has method called
Validate but this
method only validate
empty field it takes
any string for phone Place your screenshot here
and language.
70
Methods Test Comment
tested Result When
connection
is lost.
#getTourGui
de method
73
Authentication Controller
Methods Test Result Comment
tested
Subgroup Manager :
Samiya hamid
Group members
● Ababu Alemu
● Yordanos Teku
● Dagmawi Gebrewold
● Betemariam Assaminew
● Abel Alem
I will be presenting:
● Our group’s task
● Unit test overview
● Challenges
● Task distribution
Our group’s task :
● Our group’s main task was performing a unit test on the
data layer or module of the app using flutter’s test
package.
Unit test
● What is a Unit test?
○ is a software testing method by which individual units
of source code are tested to determine whether they
are fit for use and behaves as intended.
Challenges:
● To logically isolate a unit of code in the app.
● Using stubs and mocks objects to resolve isolation
issues.
Unit test
● Why a Unit test?
● to ensure that our app continues to work as we
add more features or change existing functionality.
● Ensures that all codes meets quality standards
before it’s deployed.
● It is very handy.
Task distribution
● Ababu tested model classes.
● Betemariam and Abel tested GooglePlacesApi service.
● Dagmawi and Yordanos tested FirebaseRepository.
Testing Model Classes
To test a model class, we need a database. We already have the one we
use for our development, but it is always a good habit to create a
dedicated one for our tests.
This can be done with the help of Mockito. Mockito is used to mock
interfaces so that a dummy functionality can be added to a mock
interface that can be used in unit testing.
91
API provider test class
92
In the code on the previous page,in the main() function
there is the test method in which first a description of
our test is given then an object of that api_provider
class is created and by using its reference variable we
can change the client() object into MockClient()
actually MockClient is a package provided by ‘
package:http/testing.dart’ which imitates an HTTP
request instead of real request to the server as you can
see in the above code
93
Hey, I Am Abel Alem
94
Unit Testing Using Mockito
95
Basic steps to follow to do widget test
Mockito is a popular mock framework which can be used in conjunction with JUnit. Mockito
allows you to create and configure mock objects. Using Mockito greatly simplifies the
development of tests for classes with external dependencies.
If you use Mockito in tests you typically:
● Mock away external dependencies and insert the mocks into the code under test
● Execute the code under test
● Validate that the code executed correctly
96
To use the mockito package, add it to the pubspec.yaml file along with the flutter_test
dependency in the dev_dependencies section.
This example also uses the http package, so define that dependency in the dependencies
section.
mockito: 5.0.0 supports Dart’s null safety thanks to code generation. To run the required code
generation, add the build_runner dependency in the dev_dependencies section.
97
1. Provide an http.Client to the function. This allows providing the correct http.Client
depending on the situation. For Flutter and server-side projects, provide an http.IOClient.
2. Use the provided client to fetch data from the internet, rather than the static http.get()
method, which is difficult to mock.
98
Test case ID Summary of Defect if any comments
makecompleteUrl This task was successful no In this case we have tested if the function make complete
defect was detected. Url delivers a complete url to our http request this function
was successful it worked it is ready for prior release.
Fetchhotels This task was successful no At this case we have tested if fetchhotels fetch the right data
defect was detected. from the google API and present that to our json parser this
task successfully worked this case have fetched a correct
data and gave us what we asked.
FetchAttraction Our defect was that the This case we have found some bugs to solve and we solved
fetched data included some that by using a concept related to filtering the outputs and
unwanted data that is not presenting the correct outputs to the widget.
related to the concept that
unwanted data was present
in the attraction site part so
we solved this defect by
excluding content of such
types. 99
Test The Functionality of Demo App
100
API
Betemariam Assaminew
Today I will be presenting about my
work in testing phase.
101
How is a request sent ?
102
In testing we don’t want our code to make any
request to any outside API why?
1. Any time we want to make a network request it takes some amount of
time if we have many test in our project we don’t want to be waiting for
them to make request to the outside ApIs it will make our test delay.
2. Sometimes our outside API might be down in that case we might not test
our product.
3. We never know what data we will get the APIs might change so based on
this reasons we avoided using real requests in our testing.
103
the testing diagram will look like
104
Mock client
When we use Mock client if we try to run some code that execute a request
this request never actually goes to the outside APIs there is no actual
network request completed instead the Mock client instantly complete the
request for us so this way we have the ability to control the data that gets
returned from the mock client.
Mock client
105
Http: package & client class
Http: package
This package contains a set of high level functions and classes that make
it easy to consume Http resources Its multi-platform and supports mobile
desktop and the browser.
import 'package:http/http.dart' as http;
Client class
The interface for HTTP client class that take care of maintaining persistent
connections across multiple requests to the same user.
Client httpClient = http.Client();
106
We used the flutter test
package which is MockClient
to not make the request to
external APIs .
107
Test case ID Summary of Defect if any comments
FetchNextpage This task was successful no In this case we have tested if the next page fetches
defect was detected. the place id form the Json formatted file and inputs it
to the next page which will bring the detail of that
specific attraction.
FetchItemDetail In fetching the details of the In this case we have tested and found a bug in which
hotels and the attraction the the item description was not being fetched and being
descriptions were not in its organized to be displayed so what we did was we
place so the description site prepared a collection of inputs which we fetched and
was filled with a dummy text. joined them to be read as a description.
ParseItemDetail This task was successful no In this case we have tested if the previously fetched
defect was detected. data was correctly being parsed. This test returned a
successful output telling us all the data that are
fetched as the item details are parsed with style.
108
I’m Dagmawi
Gebrewold
Worked on testing Firebase repository on user side
109
The Firebase repository is an abstract class where all units that paves path for exchanging
data with the could firestore. I was then assigned to test whether all data is being
successfully sent to and read from the database.
The app has local database and loads list of favorite items from the firebase to store and
make them available offline. I had to test whether the units in the two classes
synchronized properly or not.
The Mockito package is used to create Rest API to perform the test being passed by
custom made fake data, as described earlier by team members.
110
Test The Functionality of Demo App
111
Let’s review some concepts
Yellow Blue Red
Is the color of gold, butter Is the colour of the clear sky Is the color of blood, and
and ripe lemons. In the and the deep sea. It is because of this it has
spectrum of visible light, located between violet and historically been associated
yellow is found between green on the optical with sacrifice, danger and
green and orange. spectrum. courage.
112
Yordanos
Teku Place your screenshot here
Testing firebase
repository on admin side
113
Test case ID Pass/fail Comments
Henok Wondimu:
User app: Place your screenshot here
Integration test:
117
Some automated tests we made :
● Login
● Navigation And respective functionality tests for each pages of the
following:
○ Home -> popular Destinations -> Attraction ->
Find a Guide -> Click on a Guide -> phone call
○ Home -> Attraction site -> Attraction site detail ->
○ Home-> Account page -> Edit Profile page
○ Home -> Favorites -> Hotels -> Hotel detail page
○
● Autocomplete search functionality test
118
Sample Code: LogIn
119
Sample Code: Home -> City -> Attraction -> find aguide
120
Integration-test
Ensermu Yigezu:
Admin app: Place your screenshot here
Integration test:
122
Login:
● Tested whether the form validates or not.
○ When invalid, tested whether the snackbar
notifies.
● Tested when correct input is given navigates to the
homepage successfully.
● Tested the forgot password text button and
navigates into buttonsheet when link will be sent to
the user.
123
● Since we worked on one script, we automated the
whole process from login to add and remove admin
functionalities.
● The script is the same as that of the user.
124
● We’ve been working together on the same file
dividing each functionality and test case
scenarios as we did.
●
125
On the manager:
126
On Alem:
127
On Alem:
128
Thanks!
129