This is a discussion on White Box Testing within the Software Testing forums, part of the Software Quality Assurance category; White Box Testing White Box Testing; also know as glass box testing is a testing method where the tester involves ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| White Box Testing White Box Testing; also know as glass box testing is a testing method where the tester involves in testing the individual software programs using tools, standards etc. Using white box testing methods, we can derive test cases that: 1) Guarantee that all independent paths within a module have been exercised at lease once, 2) Exercise all logical decisions on their true and false sides, 3) Execute all loops at their boundaries and within their operational bounds, and 4) Exercise internal data structures to ensure their validity. Advantages of White box testing: 1) Logic errors and incorrect assumptions are inversely proportional to the probability that a program path will be executed. 2) Often, a logical path is not likely to be executed when, in fact, it may be executed on a regular basis. 3) Typographical errors are random. White Box Testing Types There are various types of White Box Testing. Here in this framework I will address the most common and important types. 1.1 Basis Path Testing Basis path testing is a white box testing technique first proposed by Tom McCabe. The Basis path method enables to derive a logical complexity measure of a procedural design and use this measure as a guide for defining a basis set of execution paths. Test Cases derived to exercise the basis set are guaranteed to execute every statement in the program at least one time during testing. 1.2 Flow Graph Notation The flow graph depicts logical control flow using a diagrammatic notation. Each structured construct has a corresponding flow graph symbol. 1.3 Cyclomatic Complexity Cyclomatic complexity is a software metric that provides a quantitative measure of the logical complexity of a program. When used in the context of a basis path testing method, the value computed for Cyclomatic complexity defines the number for independent paths in the basis set of a program and provides us with an upper bound for the number of tests that must be conducted to ensure that all statements have been executed at lease once. An independent path is any path through the program that introduces at least one new set of processing statements or a new condition. Computing Cyclomatic Complexity Cyclomatic complexity has a foundation in graph theory and provides us with extremely useful software metric. Complexity is computed in one of the three ways: 1. The number of regions of the flow graph corresponds to the Cyclomatic complexity. 2. Cyclomatic complexity, V(G), for a flow graph, G is defined as V (G) = E-N+2 Where E, is the number of flow graph edges, N is the number of flow graph nodes. 3. Cyclomatic complexity, V (G) for a flow graph, G is also defined as: V (G) = P+1 Where P is the number of predicate nodes contained in the flow graph G. 1.5 Control Structure Testing Described below are some of the variations of Control Structure Testing. 1.5.1 Condition Testing Condition testing is a test case design method that exercises the logical conditions contained in a program module. 1.5.2 Data Flow Testing The data flow testing method selects test paths of a program according to the locations of definitions and uses of variables in the program. 1.6 Loop Testing Loop Testing is a white box testing technique that focuses exclusively on the validity of loop constructs. Four classes of loops can be defined: Simple loops, Concatenated loops, nested loops, and unstructured loops. 1.6.1 Simple Loops The following sets of tests can be applied to simple loops, where ‘n’ is the maximum number of allowable passes through the loop. 1. Skip the loop entirely. 2. Only one pass through the loop. 3. Two passes through the loop. 4. ‘m’ passes through the loop where m<n. 5. n-1, n, n+1 passes through the loop. 1.6.2 Nested Loops If we extend the test approach for simple loops to nested loops, the number of possible tests would grow geometrically as the level of nesting increases. 1. Start at the innermost loop. Set all other loops to minimum values. 2. Conduct simple loop tests for the innermost loop while holding the outer loops at their minimum iteration parameter values. Add other tests for out-of-range or exclude values. 3. Work outward, conducting tests for the next loop, but keeping all other outer loops at minimum values and other nested loops to “typical” values. 4. Continue until all loops have been tested. 1.6.3 Concatenated Loops Concatenated loops can be tested using the approach defined for simple loops, if each of the loops is independent of the other. However, if two loops are concatenated and the loop counter for loop 1 is used as the initial value for loop 2, then the loops are not independent. 1.6.4 Unstructured Loops Whenever possible, this class of loops should be redesigned to reflect the use of the structured programming constructs. Thanks V.Vadivelan Buddies Infotech Chennai |
| Sponsored Links |
| |||
| Great information. I know that White box testing focuses specifically on using internal knowledge of the software to guide the selection of test data. I am curious, what is the difference of white box testing to black box testing? |
| |||
| Hi djmix, Black-Box testing technique: This technique is used for testing based solely on analysis of requirements (specification, user documentation.). Also known as functional testing. White-Box testing technique: This technique us used for testing based on analysis of internal logic (design, code, etc.)(But expected results still come requirements). Also known as Structural testing. Thanks V.Vadivelan |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Black box/white box testing? | srikumar_l | Software Testing | 5 | 05-14-2008 03:28 AM |
| XML and white spaces | Sathish Kumar | XML and SOAP | 2 | 03-14-2008 03:33 AM |
| Black Box & White box testing | prasath | Software Testing | 2 | 08-28-2007 07:12 AM |
| What are the Types in white box testing? | itbarota | Software Testing | 3 | 07-27-2007 06:17 AM |
| white box & blak box testing | nssukumar | Software Testing | 1 | 03-22-2007 06:54 AM |