The word “TEST” is derived from the latin word “Testum” meaning a pottery vessel used to measure or assess. Area of software testing is one of the key process areas of project life cycle in ensuring the quality of the software.
There are various testing technique as follows,
- Structural & Functional
- Verification & Validation
- Static & Dynamic
- White-box & Black-box
Different levels of testing :
- Unit Testing
- Integration Testing
- System Testing
- Acceptance Testing
- Black-box Testing
- White-box Testing
The universe of testing automation can be neatly split into two predominant testing techniques known as black-box and white-box testing. Black-box testing is testing technique having no knowledge of the internal structure of system. Whereas, the focus of white-box testing is on the logic of implementation.
Difference between Black-box and White-box testing
Black-box testing | White-box testing | |
---|---|---|
Programming knowledge | In this testing knowledge of programming is not necessarily essential. White Box Testing | In this form of testing knowledge of programming is must means it is essential |
Responsibilty | Independent software testers | Software developers |
Technically strong | may or may not be technically sound. | technically sound good |
Main focus | Functionality of the system | Structure means program/code of the system |
Requirement focus | Focuses on what is performing/ carried out | Focuses on how it is performing/ carried out |
Meaning | Functional test or external test. | Structural test or interior test |
Black-Box Testing
Black box testing is the Software testing method which is used to test the software without knowing the internal structure of code or program. Basically software under test is called as “Black-Box”. While testing the tester only knows about the input and expected outputs of the software, they are not aware of how the software or application actually processes the input and outputs. The main purpose of the Black Box is to check whether the software is working as per user expectations.
Test case ID | Scenario | Data Value1 | Data Value2 | Expected Result | Test Result |
---|---|---|---|---|---|
1 | As a User, I want to add activities so that I can monitor them over a period of time | Click on the add button → Enter values → add | Click on the add button → press back button | Data Value1: Display the activity in list
Data value 2: Come back to home page |
Pass |
2 | As a User, I want some default categories so that I can group my activities accordingly | Click on add category → choose sports → add | Click on add → Display < select category > in add activity screen. | Data value1: Default category (sports) should be selected.
Data value2:Go to add activity screen → Display < select category > |
Pass |
3 | As a User, I want to create categories so that I can have user-specific categories | Click on add → Display < select category > in add activity screen. | Click on add category | Data value1: Go to add activity screen → Display < select category <
Data value2: Pop up add Category → enter Name |
Pass |
4 | As a User, I want to input time and date when adding an activity so that I can have a Time stamp | Click on select Date → select date from calendar → add | View date for created activity in home screen | Data value1: pop up calendar
Data value2: view Time stamp in Home screen for particular activity |
Pass |
5 | As a User, I want to delete activities so | Long press on Activity in home screen | Click on delete | Data value1: pop up delete
Data value 2: Remove the activity selected from home screen |
Pass |
White-Box Testing
White Box Testing is a software testing method in which the internal structure/ design/ implementation of the item being tested is known to the tester. The tester chooses inputs to exercise paths through the code and determines the appropriate outputs.
A tester, usually a developer as well, studies the implementation code of a certain field on a webpage, determines all legal AND illegal inputs and verifies the outputs against the expected outcomes, which is also determined by studying the implementation code.
White Box Testing is like the work of a mechanic who examines the engine to see why the car is not moving.
Test Case 1: showTimePickerDialog(View v) method displays a dialog where the user can pick the time. In the app we have start time and end time options, so we call this function two times. Using a if condition on View 'v' we check whether the user clicked on Start Time button or the Stop Time button and then update the database accordingly. We tested this method by passing resource id of button as an argument to the function instead of View object itself, just to make sure that the database is updated appropriately. And then we also tested the method by passing View object as an argument and the result was satisfactory.
Test Case 2: In the DatabaseHelper class, the CreateActivity() method is used to create a new activity when the user fills in the details and clicks on the Add button. The method uses the Activity class of the Model Package, where the schema of the database is defined. We tested this method by providing input from the console window and making sure that all the attributes are added to the database correctly.
Test Case 3: The deleteActivity() method under the DatabaseHelper class is used to delete the activity entries from the database, we tested this method by passing ROW_ID as an argument to the method and we made sure that the expected rows are deleted not the other ones.
Test Case 4: getActivities_filtered() method is used to fetch the queried rows from the database, so that the filtered activities can be displayed to the user. It takes from_date and to_date as inputs and it returns the Cursor object, which can then be used to display the list of activities to the user. We tested this method by providing different from and to dates. The test failed initially because we were not following the standard way of representing date (YYYYMMDD) and thus we were unable to sort the items properly. We then changed our date representation and obtained satisfactory results.
Test Case 5: The onItemSelected() method in CreateActivity class is used to perform an action when the user selects an item on the spinner list. The initial test we performed on this method failed as we were passing the position of the item selected incorrectly, we realized this mistake after testing and corrected it.
White-box testing is performed early in the testing process, while black-box testing is applied during later stages.
Summary of changes
- We added provision to filter activities
- We added an option to sort activities
- We added possibility to delete activities
THANKS FOR VISITING OUR BLOG,
Team BlueSky