Sections


Main-Menu

header image

Test Methods: Black Box and White Box Testing


Black-Box and White-Box Testing

Every test object can be tested in two principal ways to determine whether it fulfills its specifications:

  1. Black-box test (functional test or exterior test): Test of the input/output behavior without considering the inner structure of the test object (interface test)
  2. White-box test (structure test or interior test): Test of the input/output behavior considering the inner structures (interface and structure test)

Black-box tests

  • Black-box testing focuses on the functional requirements of the software.
  • Black-box testing enables the software engineer to derive sets of input conditions that will fully exercise all functional requirements for a program.
  • Black-box testing attempts to find errors in the following categories:
  1. Incorrect or missing functions,
  2. Interface errors,
  3. Errors in data structures or external database access,
  4. Performance errors, and
  5. Initialization and termination errors.
  • Black-box tests serve to detect deviations of a test object from its specification. The selection of test cases is based on the specification of the test object without knowledge of its inner structure. It is also important to design test cases that demonstrate the behavior of the test object on erroneous input data.
  • Criteria for test cases [Myers 1979]
  1. Test cases that reduce, by a count that is greater than one, the number of additional test cases that must be designed to achieve reasonable testing
  2. Test cases that tell us something about the presence or absence of classes of errors, rather than an error associated only with the specific test at hand.
  • The black-box test provides no information about whether all functions of the test object are actually necessary or whether data objects are manipulated that have no effect on the input/output behavior of the test object. Such indicators of design and implementation errors emanate from the white-box test.

White-box tests

  • White-box testing is one of the most important test methods. For a limited number of program paths, which usually suffices in practice, the test permits correct manipulation of the data structures and examination of the input/output behavior of test objects.
  • In white-box testing the test activities involve not only checking the input/output behavior, but also examination of the inner structure of the test object.
  • The goal is to determine, for every possible path through the test object, the behavior of the test object in relation to the input data.
  • Test cases are selected on the basis of knowledge of the control flow structure of the test object.
  • The selection of test cases must consider the following:
  1. Every module and function of the test object must be invoked at least once
  2. Every branch must be taken at least once
  3. As many paths as possible must be followed
  • It is important to assure that every branch is actually taken. It does not suffice to merely assure that every statement is executed because errors in binary branches might not be found because not all branches were tested.
  • It is important to consider that, even for well-structured programs, in practice it remains impossible to test all possible paths, i.e., all possible statement sequences of a program.

Related Articles :



Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Shaadi.com Matrimony - Register for FREE