Welcome to our fifth blog which is regarding testing of the app. Here we will discuss testing process and different approaches that we went over to
There are several testing processes which require to be done in parallel or different stages and several techniques inheret in. Test dsign techniques can be experimental based, structred based or specification based. While specification based is functional and blackbox procedure will be applied to and structure based conforms to white box procedure.
We will follow with testing
Manual Testing is the process of finding out the defects, bugs in a software program manually and not automatically. we perform user role and verify all the requirements are maintained
Black box testing is the testing method in which internal structure is unknown to the software tester. Using black box testing or functional test or external testing, we are going to test performance of application based on user stories cenarios
Requirement | Action Performed | Expected Output | Test result |
---|---|---|---|
To check whether user is redirected to login page after Registration | Toggle screen : After entering his details like username ,password the user clicks on the Regsiter button | Registered successfully message should be displayed and goes to Login page | Passed |
Requirement | Action Performed | Expected Output | Test result |
---|---|---|---|
To save transaction data | The user adds a new transaction by clicking on the + button and enters the details (amount,desc)and presses save | The transaction should reflect in the Transactions Page | Passed |
Requirement | Action Performed | Expected Output | Test result |
---|---|---|---|
To select currency of my transactions | The user clicks on the 3 dots to goto settings page .There he can change the currency from a dropdown list | The transactions (existing and new) change to the new currency | Passed |
Requirement | Action Performed | Expected Output | Test result |
---|---|---|---|
To exit the application | The user clicks on the 3 dots to find the settings page .There , he clicks on the Logout option | The user exits the application | Passed |
Requirement | Action Performed | Expected Output | Test result |
---|---|---|---|
The user should be able to view all transactions | The user logins to the applicatin and gets redirected to the transactions page | The user should be able to see all of his previous transactions | Passed |
White box testing is the testing method in which internal structure is known to the software tester.
There are test cases for five classes which four are testing Model package and one other attest sign in page.
This is based on a good rule of thumb to keep 80% of testing effort on business logic part of the code and 20% for UI. Since 100% test coverage is exhaustive and on the other hand we are following manual testing procedure, we are trying to increase the coverage and capture bugs and fix them randomly. Below You can follow five classes which we did testing for.
We are doing Unit Testing for TransactionDao using AndroidJUnit4.
Using the notation @Rule we call InstantTaskExecutorRule class which is the library provided in androidx for testing purpose. And subsequently instaces of Database class and TransactionsDao is created. Under @Test notation by using onFetching_shouldGetEmptyList_IfTable_IsEmpty() method we are testing to get nothing if database being empty
Back press button in majority of android devices make it easy to revert back to previous page but sometimes it is annoying when you filled some data in a page and mistakenly you touch it.
Here we are making backpress button to be clicked double in order to leave AddNewTransaction Page.
By overridding onBackPressed() method and using if condition inside that, we make the app to differentiate between single and double clicks likely that if the second click being after 2000 miliseconds it will not proceed and will throw a message "Press back again to cancel" to proceed accordingly
Using DatePickerFragment class and calling it in AddNewTransaction class we can pick date instead of manually writing it which is error prone. We overrided the onDataSet() methode which inside that by building instance of Calender and assigning day, month and year info we can achieve this objective
Using method userLogin() authentication to app is validated provided that correct username and password supplied. since email is used as username, if incase this field being blank, the authentication process will not proceed to validate based on database feedback but instead it will be cautched and an error message will be thrown "Email is required" and same applies to password field with the message "Password is required".
In order to persistently save transactions in database we are using saveTrans() method and in order to prevent submission of missing data, we are testing amount field, description and date to be provided otherwise a message will be shown to the user to fill required data "Please fill amount, description and pick a date".