Black Box Testing

What is Black Box Testing?

Unlike White Box Testing, which is focusing on the code or syntax stuff, Black Box Testing is focusing on functional requirements, and it compliments White Box Testing. it only concerns with testing the specification, and cannot guarantee that all parts of the implementation have been tested.

Thus black box testing is testing against the specification and will discover faults of omission, indicating that part of the specification has not been fulfilled. White box testing is testing against the implementation and will discover faults of commission, indicating that part of the implementation is faulty. In order to fully test a software product, both black and white box testing are required.

Black box testing attempts to find out: (1) incorrect or missing functions, (2) interface errors, (3) errors in data structures or external database access, (4) performance errors, and (5) initialisation and termination errors.

 

Advantages of black box testing?

  • The test will be unbiased because the developer and tester are independent of each other;
  • The tester does not need to know deeply the specific programming languages;
  • The test can be done from the perspective of end user, instead of developer.

 

Disadvantages of black box testing?

  • The test can be redundant if the developer has already run a test case;
  • The test cases are sometimes difficult to design;
  • Testing every possible input stream is unrealistic because it would take an inordinate amount of time. Therefore, many program paths will go untested.
  • Only test the performance or functions, sometimes the errors exist in the code cannot be found. Maybe will cause further problems which cannot be disclosed now.

 

Black Box Testing methods:

  1. Equivalence Partitioning
  2. Boundary Value Analysis.
  3. Cause Effect Graphing Techniques.
  4. Comparison Testing

 

Equivalence Partitioning:

is a typical black box testing technique which divides the input domain of a program into classes of data from which test cases can be derived. Equivalence partitioning method strives to define a test case that uncovers classes of errors, thereby reducing the total number of test cases that must be developed.

  • equivalence partitions are <10,000, 10,000-99,999 and >100, 000
  • Test cases would be selected from each equivalence class i.e. 00000, 09999, 10000, 99999, 100001

Choose the most representative one for each set.

Boundary Value Analysis:

is a black box testing method that where test cases are designed to test the boundary of an input domain. Studies have shown that more errors happen on the “boundary” of an input domain rather than on the “center area”.

So here, we can select the minimum and maximum values of an input and output range to test.

Example?

  • 10,000, 99,999,100,000

Cause Effect graphing Techniques

The basic idea of this method is that, a “cause” if an input condition, and an “effect” is a specific sequence of computations to be performed. A cause-effect graph is basically a directed graph that describes the logical combinations of causes and their relationship to the effects to be produced. It can help testers to select test cases to chekc if the program will produce right effect for every possible combination of causes.

Cause Effect Graph

(source: https://www.tutorialspoint.com/software_testing_dictionary/cause_effect_graph.htm)

Why we are using cause-effect graph/When should we use/What circumstances?

  • To identify the possible root causes, the rease for a specific effect, problem, or outcomes;
  • To relate the interaction of the system among the factors affecting a particular process of effect;
  • To analyse the existing problems so that corrective action can be taken at the earliest.

Benefit:

  • It Helps us to determine the root causes of a problem or quality using a structured approach.
  • It Uses an orderly, easy-to-read format to diagram cause-and-effect relationships.
  • It Indicates possible causes of variation in a process.
  • It Identifies areas, where data should be collected for further study.
  • It Encourages team participation and utilizes the team knowledge of the process.
  • It Increases knowledge of the process by helping everyone to learn more about the factors at work and how they relate.

Comparison Testing:

which comprises of comparing the content of multiple objects, e.g. files, databases, against actual results.

  • One can easily detect the underlying weakness and strengths of the software
  • It helps to realize the design structure of competing products as well as allows you to use them as a benchmark for future enhancements and improvements

 

(Some good sources and articles about black box testing and test cases writing:

http://www.cnblogs.com/Jackc/archive/2009/02/24/1397433.html

http://agile.csc.ncsu.edu/SEMaterials/BlackBox.pdf)