Black box testing also known as “Functional Testing”. A type of software testing where internal workings of item being tested is unknown to the tester. Say for example, in Black box testing when applied to software engineering the tester has only the knowlegde of “legal” inputs not the expected output and how program actually arrives to those outputs.
Black box testing is what most of us practice and is used most widely. Black Box testing which is very close to customer experience.
Black box testing methods include equivalence partitioning, boundary value analysis, all-pairs testing, fuzz testing, model-based testing, traceability matrix, exploratory testing and specification-based testing.
For Black Box testing, test groups are often used, “Test groups are aka “professional idiots”…people those who are good at designing incorrect data. Also, do to the nature of black box testing; the test planning can begin as soon as the specifications are written.
As a test engineer if you are performing black box test cases, one thing that you need to make sure is that you do not make any assumptions about the system based on your knowledge. Assumption created in our mind because of the system knowledge could harm testing effort and increase the chances of missing critical test cases.
The only input can be for test engineer in the Black Box testing is the requirement document and functionality of system which can be get by working with the system.
Purpose of black box testing is to
1. Make sure that system is working in accordance with the system requirement.
2. Make sure that system is meeting user expectation.
For example, suppose we are testing a function that uses the quadratic formula to determine the two roots of a second-degree polynomial ax2+bx+c. For simplicity, assume that we are going to work only with real numbers, and print an error message if it turns out that the two roots are complex numbers (numbers involving the square root of a negative number).
We can come up with test data for each of the four cases, based on values of the polynomial’s discriminant (b2-4ac):
Easy data (discriminant is a perfect square):
| a | b | c | Roots |
| 1 | 2 | 1 | -1, -1 |
| 1 | 3 | 2 | -1, -2 |
Typical data (discriminant is positive):
| a | b | c | Roots |
| 1 | 4 | 1 | -3.73205, -0.267949 |
| 2 | 4 | 1 | -1.70711, -0.292893 |
Boundary / extreme data (discriminant is zero):
| a | b | c | Roots |
| 2 | -4 | 2 | 1, 1 |
| 2 | -8 | 8 | 2, 2 |
Bogus data (discriminant is negative, or a is zero):
| a | b | c | Roots |
| 1 | 1 | 1 | square root of negative number |
| 0 | 1 | 1 | division by zero |
As with glass-box testing, you should test your code with each set of test data. If the answers match, then your code passes the black-box test.