The programme test cases in black box testing are based on the system specification. Inputs from the test data may reveal anomalous outputs (ie. defects). Test planning can begin early in the software development process. The main problem with black box testing in the selection of inputs.
This when the system inputs and outputs are partitioned into equivalence sets. If an input should be between four and ten, then choose a number less than four, a numbr between four and ten and a number greater than ten.
Choose test cases at the boundaries of these sets.
Compared to white-box testing
- Potential combinatorial explosion of test cases (valid and invalid data).
- Often not clear whether the selected test cases uncover a particular error.
Sometimes this is called structural testing or glass box testing. It is the derivatiion of test cases according to the programme structure. The objective is to exercise all programme statements (not all path combinations). There are four types of white-box testing:
- Statement testing - test single statements.
- Loop testing.
- Path testing - execute every path.
- Branch testing - every outcome from every condition is tested.
Compared to black-box testing
- Potentially infinite number of paths to be tested.
- White-box testing often tests what is done, instead of what should be done.
- Cannot detect missing use cases.
This is verifying the conformance of a software system and its specification without executing the code. It involves analysis of source text by humans or software on any documents produced as part of the software process. It discovers errors early in the software process. There are two main techniques for static verification:
- Walkthroughs - four to six people examine the code and list perceived problems, then meet to discuss afterwards.
- Programme inspections - a more formal approach using checklists.
This is usually more cost effective than testing for defect detection at the unit and module level. Over 60% of programme errors can be detected in software inspections.