Sunday, December 25, 2011

Types of Testing - Black box testing


Let's see about BLACK BOX testing.


Black box testing


Black box testing is to verify whether the software is functioning as expected or it fails to produce expected output for a defined input irrespective of the way how it is made to produce the result(say the code, programming language used, loops used) nothing matters but we need the expected output from the software. The tester does not need to have the basic knowledge about the programming language used to develop the software, code pattern, methods used but he expects the output for a given set of inputs. The black box testing is also called as closed box testing.


Black box testing does not consider the internal design but requires the functional specifications. The test cases, inputs to the system, expected output are defined based on the functional specifications. 


Black box testing treats the system as a “black-box”, so it doesn’t explicitly use Knowledge of the internal structure or code. Or in other words the Test engineer need not know the internal working of the “Black box” or application.


For example, when we are using the calculator in windows, what we would expect while entering 7+2, we expect the output as 9, but we don't care about how it produce the result, what is the code pattern, how long it takes to produce the result and all. This is Black box testing


We can otherwise call the black box testing as closed box testing


Where we can use the black box testing -  The black box testing can be used in System integration testing(IST), unit testing and User acceptance testing(UAT).


How long it is reliable to use black box testing - It is quite reliable in terms of functionality of a software, but when it comes to performance(Turn around time - The time between input given and output produced, quality of code) we can not rely on it.


Can it be used in all the applications - Of course the black box testing can be used in kinds of applications.


Why is it called as black box - Because we do not see/need what is happening inside an application but we just want expected output for an input.


Tools used for Black Box testing:

Black box testing tools are mainly record and playback tools. These tools are used for regression testing that to check whether new build has created any bug in previous working application functionality. These record and playback tools records test cases in the form of some scripts like VB script, Java script, Perl.




Methods of Black box Testing:
Graph Based Testing Methods:
Each and every application is build up of some objects. All such objects are identified and graph is prepared. From this object graph each object relationship is identified and test cases written accordingly to discover the errors.
Error Guessing:
This is purely based on previous experience and judgment of tester. Error Guessing is the art of guessing where errors can be hidden. For this technique there are no specific tools, writing the test cases that cover all the application paths.
Boundary Value Analysis:
Many systems have tendency to fail on boundary. So testing boundry values of application is important. Boundary Value Analysis (BVA) is a test Functional Testing technique where the extreme boundary values are chosen. Boundary values include maximum, minimum, just inside/outside boundaries, typical values, and error values.
Extends equivalence partitioning
Test both sides of each boundary
Look at output boundaries for test cases too
Test min, min-1, max, max+1, typical values
BVA techniques:
1. Number of variables
For n variables: BVA yields 4n + 1 test cases.
2. Kinds of ranges
Generalizing ranges depends on the nature or type of variables
Advantages of Boundary Value Analysis
1. Robustness Testing – Boundary Value Analysis plus values that go beyond the limits
2. Min – 1, Min, Min +1, Nom, Max -1, Max, Max +1
3. Forces attention to exception handling
Limitations of Boundary Value Analysis
Boundary value testing is efficient only for variables of fixed values i.e boundary.
Equivalence Partitioning:
Equivalence partitioning is a black box testing method that divides the input domain of a program into classes of data from which test cases can be derived.
How is this partitioning performed while testing:
1. If an input condition specifies a range, one valid and one two invalid classes are defined.
2. If an input condition requires a specific value, one valid and two invalid equivalence classes are defined.
3. If an input condition specifies a member of a set, one valid and one invalid equivalence class is defined.
4. If an input condition is Boolean, one valid and one invalid class is defined.

Advantages of Black box testing

  • Tester can be non technical in terms of technology used to develop the application(c, c++)
  • It is efficient when used in large systems
  • Since the developer and tester are independent, testing is balanced and unprejudiced.
  • Testing aids to identify the vagueness and contradictions in functional specifications.
  • The test is done from the user point of view, because the end user should accept the system.
  • Test cases can be designed as soon as the functional specifications are complete.
  • The testing can measure the functionality of the software completely.

Disadvantages of the Black box testing

  • It is difficult to identify tricky inputs if the test cases are not developed based on specifications.
  • Designing test cases are complex unless we are very clear about he functional knowledge of the 
  • There are chances of having unidentified paths during the test process as we are not aware of the code and its accessible input methods.
  • There is high possibility of repeating tests if it is already tested by the developer.
Happy testing......!


No comments:

Post a Comment