This is an implementation and testing of a REST-based application capable of storing and displaying information about mobile phones using Flask and JMeter technologies.
In this particular task, only the following fields were considered: object (name, brand, year of release, operating system).
Install dependencies
: install the required dependencies using pip
. Run:
pip install -r requirements.txt
Alternatively, you can check it out the following tutorial on how to install Flask Framework: https://flask.palletsprojects.com/installation/ in case you face further issues.
After get done with dependencies installation, run the python application using the command:
python3 app.py
At this stage, we assume the application is running successfully
on localhost:5000
OR 127.0.0.1:5000
.
This is an API that allows to perform GET
, POST
, PUT
and DELETE
HTTP request methods to Mobile phones.
BASE URL -> http://<localhost>:<port>/phone_store/
SAMPLE BASE URL -> http://localhost:5000/phone_store/
POST http://<localhost>:<port>/phone_store/
Inserts a new phone to the database if no error is encountered.
Error code operations for adding new phone:
409 Conflict
: Duplicate phone not allowed.422 Unprocessable Entity
: Parameters not passed correctly or malformatted.400 Bad Request
: In case any other error occur.
GET http://<localhost>:<port>/phone_store/<id>
Gives back the phone with a specific ID in JSON
format.
Error code operations for adding new phone:
404 Not Found
: ID not found in the database400 Bad Request
: In case any other error occur.
GET http://<localhost>:<port>/phone_store/
List all phones stored in the database in JSON format
. Code 200 - OK
is returned to represent successful operation.
DELETE http://<localhost>:<port>/phone_store/<id>
Delete from the database the phone with specific ID in JSON format
.
Error code operations for delete operations:
404 Not Found
: ID not found in the database400 Bad Request
: In case any other error occur.
The goal of this plan is to test the application based on its specification in both the MASTER and LEVEL SPECIFIC TEST plan using the IEEE 829 Standard
.
We are testing all the features the application can perform (according to the specification provided).
By adding more than 10^8 entries in our database, the application tends to load all the mobile phones slowly due to the complexity and ammount of data which might lead to a bug.
Syntax | Level |
---|---|
Add 1 mobile phone | H |
Add another mobile phone | M |
List all mobile phones | H |
Show only the 2nd added | H |
Delete the first | H |
List all mobile phones | L |
Delete all mobile phones | H |
List again | L |
Show the 1st mobile phone | L |
Add 20 more entries | M |
List all mobile phones | L |
On risk levels, H - High
; M - Medium
; L - Low
.
404
- Bad requests are not going to be tested.
For this task, Apache JMeter is the testing software recommended to be used. Please check out JMeter Getting Started to learn in case needed. There will be about 4 regression tests. We use Retest all
and Regression test selection
. At MASTER LEVEL is expected all functionality work perfectly.
Please, be noticed that first we try to test small test cases and then move bigger ones so that when they get finished we create the full lifecycle tests.
Skipped. Check it out link
.
When running the test cases using the current version, all test cases completed
are expected as output.
It is only allowed an upper bound of 50% of defects. More than that, It is recommended to have a deep check on the solution provided before rerun the test cases.
As part of this plan, we deliver:
- Test plan document
- Test cases
- Test Design specifications
- Tools and their ouputs
No more test cases are listed in this release documentation.
We recommend running the application and test software using:
- Minimum 4G RAM
- Minimum 10GB available disk space
- Windows 10 or Ubuntu 20.04.6 LTS
- Apache JMeter 5.6.2
- Java 8+
- Python3
- Flask
In case of any questions, please contact the QA Tester
.
Many resources can be used to learn how to use all the tools mentioned; Some links were left to help on training.
The QA Tester
is in charge of everything related to this task.
This work was completed in approximately 7 days
using a flexible time schedule.
Skipped.
Skipped.
Download the test plan
and import into JMeter in order to test the running application.
Before start, configure
your JMeter.
Now please follow the steps:
- Open JMeter:
- Click on
File > Open
or pressCtrl + O
:
Then find the api_testing_view_res_tree.jmx
file and import it.
- Run the test cases. Click the
GREEN
buttonhighlighted
:
- Change the URL and PORT according to your device. By default, it is assumed to be
localhost:5000
.
Outline level:
- Fragment
- Test case
PRE_PHASE_Testing
GetAllEmptyAPI
: checks non-existence of item.
POST_Testing
Post1API
: adds the 1st entry to the database sucessfully.Post2API
: adds the 2nd entry to the database sucessfully.Post1AlreadyExistsAPI
: try to insert the 1st entry again and fails consequently.PostMore20API
: adds sucessfully 20 more entries loading from aCVS
file.
GET_Testing
GetAllAPI
: Query all mobile phone entries added.GetSingleAPI
: Checks existence of a specific mobile ID in the database.GetSingleNotFoundAPI
: Checks non-existence of an ID.
DELETE_Testing
DeleteAPI
: removes a mobile phone in the database in case it exists.DeleteNotFoundAPI
: tries to delete a mobile phone not presented in the database.
PUT_Testing
PutAPI
: asserts for a modification of a mobile data specifying the ID.PutNotFoundAPI
: tries to modify a mobile data not presented int he database.