0
6.1kviews
Black box and white box testing.

Mumbai University > Electronics Engineering > Sem 7 > Embedded System Design

Marks: 10 Marks

Year: Dec 2015

1 Answer
1
83views

Black box testing:

  1. The software program or system under test is viewed as a “black box”. The internals of the system under test are not examined in this case.
  2. This testing methodology looks at what are the available inputs for an application and what the expected outputs are that should result from each input.
  3. Black box testing is done on the completely finished product.
  4. Black box testing is done based on end user perspective. The main importance of black box testing it handles both valid and invalid inputs from customer’s perspective.
  5. Black box testing is done from beginning of the software project life cycle. The end-users requirements must be gathered at the beginning of the project to generate the test data.
  6. An example of black box testing would be examining the outputs of an ASIC (application specific integrated circuit). The internals of this chip is unknown; the correctness of the output can be verified only from the inputs and by treating the system as a black box.
  7. There are two main approaches for black box testing:

    a. Equivalence class partitioning: The possible input values to the program are partitioned into a set of equivalence classes. An equivalence class is a set of data of the same type and can be defined by examining the input values. For e.g. if black box testing is applied for a program computing square of the input within the range 0 to 5000 then three equivalence classes can be defined. Class1 consists of numbers less than 0, class two consists of numbers in the range of 0 to 5000, both inclusive and class 3 consists of numbers greater than 5000.

    b. Boundary Value Analysis: A type of programming error frequently occurs at the boundaries of different equivalence classes of inputs. For example, programmers may improperly use < instead of <=, or conversely <= for <.Boundary value analysis leads to selection of test cases at the boundaries of the different equivalence classes.

  8. Advantages of black box testing:

    a. The main advantage of black box testing is that, testers no need to have knowledge on specific programming language, not only programming language but also knowledge on implementation.

    b. In black box testing both programmers and testers are independent of each other.

    c. Since the black box testing is done from user point of view it helps in exposing any ambiguities or inconsistencies in the requirements specifications.

  9. Following are the disadvantages of black box testing:

    a. All the boundary conditions are difficult to detect.

    b. Can be difficult to cover all portions of software implementation

White Box Testing:

  1. The system under test is seen as a “white box”. The choice of test cases is grounded on the implementation of the system.
  2. The test cases are designed on the basis of the internal functioning of the system for the designer’s perspective. The testing mainly focuses on the internal logic and the structure of the code.
  3. White-box testing lets testers determine how thoroughly the program needs to be tested, which is often done via adequacy criterion. A test adequacy criterion is a predicate which is used to determine whether a program has been tested enough.
  4. An example of a white-box system would be in-circuit testing where the interconnections between each component and verified and each internal connection is checked for its working.
  5. White box testing is mainly used for detecting logical errors, uncovering incorrect programming assumptions.
  6. White box testing is done at low level design and it can be applied at all levels of system development especially unit, system and integration testing.
  7. Following are the different white box testing techniques:

    a. Statement coverage: The statement coverage strategy aims to design test cases so that every statement in a program is executed at least once.

    b. Branch coverage: In the branch coverage-based testing strategy, test cases are designed to make each branch condition to assume true and false values in turn.

    c. Condition coverage: In this structural testing, test cases are designed to make each component of a composite conditional expression to assume both true and false values.

    d. Path coverage: The path coverage-based testing strategy requires us to design test cases such that all linearly independent paths are executed at least once. A linearly independent path can be defined in terms of the control flow graph (CFG) of a program.

    e. Data flow-based testing: Data flow-based testing method selects test paths according to the locations of the definitions and uses of different variables in a program.

  8. Following are the advantages of white box testing:

    a. Usually helps getting good coverage (tests are specifically designed for coverage).

    b. Good for ensuring boundary cases and special cases get tested

  9. Disadvantages of white box testing are:

    a. White box testing might not be good at assessing functionality for unexpected behaviors arising with the end user.

    b. Tests based on design might miss bigger picture system problems.

    c. Tests need to be changed if implementation/algorithm changes.

Please log in to add an answer.