9 October 2012

White Box Testing

WHITE BOX TESTING -

                             Testing based on an analysis of internal workings and structure of a piece of software. Includes techniques such as Branch Testing and Path Testing.

White Box Testing also called as “Structural testing or Glass Box Testing”

                            White box testing involves looking at the structure of the code. When you know the internal structure of a product, tests can be conducted to ensure that the internal operations performed according to the specification. And all internal components have been adequately exercised.

EXAMPLE
                           A tester, usually a developer as well, studies the implementation code of a certain field on a webpage, determines all legal (valid and invalid) AND illegal inputs and verifies the outputs against the expected outcomes, which is also determined by studying the implementation code.

LEVELS APPLICABLE TO

White Box Testing method is applicable to the following levels of software testing:
  • Unit Testing: For testing paths within a unit
  • Integration Testing: For testing paths between units
  • System Testing: For testing paths between subsystems
However, it is mainly applied to Unit Testing.

White Box Testing Technique

Introduction

Software is tested from two different perspectives:
  1. Internal program logic is exercised using “white box” test case design techniques.
  2. Software requirements are exercised using “black box” test case design techniques.
                In both cases, the intent is to find the maximum number of errors with the minimum amount of effort and time.
               White-box testing of software is predicated on close examination of procedural detail. Logical paths through the software are tested by providing test cases that exercise specific sets of conditions and/or loops. The "status of the program" may be examined at various points to determine if the expected or asserted status corresponds to the actual status.

White Box Testing is coverage of the specification in the code.

  • Code coverage:
  • Segment coverage:
                   Ensure that each code statement is executed once.
  • Branch Coverage or Node Testing:
                  Coverage of each code branch in from all possible was.
  • Compound Condition Coverage:
                   For multiple condition test each condition with multiple paths and combination of different path   to reach that condition.
  • Basis Path Testing:
                  Each independent path in the code is taken for testing.
  • Data Flow Testing (DFT):
                  In this approach you track the specific variables through each possible calculation, thus defining the set of intermediate paths through the code.DFT tends to reflect dependencies but it is mainly through sequences of data manipulation. In short each data variable is tracked and its use is verified.
This approach tends to uncover bugs like variables used but not initialize, or declared but not used, and so on.
  • Path Testing:
                 Path testing is where all possible paths through the code are defined and covered. Its a time consuming task.
  • Loop Testing:
                  These strategies relate to testing single loops, concatenated loops, and nested loops. Independent and dependent code loops and values are tested by this approach.

WHITE BOX TESTING ADVANTAGES

  • Testing can be commenced at an earlier stage. One need not wait for the GUI to be available.
  • Testing is more thorough, with the possibility of covering most paths.
WHITE BOX TESTING DISADVANTAGES
  • Since tests can be very complex, highly skilled resources are required, with thorough knowledge of programming and implementation.
  • Test script maintenance can be a burden if the implementation changes too frequently.
  • Since this method of testing it closely tied with the application being testing, tools to cater to every kind of implementation/platform may not be readily available.
  • White Box Testing is like the work of a mechanic who examines the engine to see why the car is not moving.


1 comment:

  1. The theory is very nice and useful.but I want a website example of how we can do the white-box testing.plz give us a simple and very nice example... thank you

    ReplyDelete