WHITE BOX TESTING

Designed By:

White box testing strategy deals with the internal logic and structure of the code. White box testing is also called as glass, structural, open box or clear box testing. The tests written based on the white box testing strategy incorporate coverage of the code written, branches, paths, statements and internal logic of the code etc. In order to implement white box testing, the tester has to deal with the code and hence is needed to possess knowledge of coding and logic i.e. internal working of the code. White box test also needs the tester to look into the code and find out which unit/statement/chunk of the code is malfunctioning.

Advantages of White box testing are: i) As the knowledge of internal coding structure is prerequisite, it becomes very easy to find out which type of input/data can help in testing the application effectively. ii) The other advantage of white box testing is that it helps in optimizing the code iii) It helps in removing the extra lines of code, which can bring in hidden defects.

Disadvantages of white box testing are: i) As knowledge of code and internal structure is a prerequisite, a skilled tester is needed to carry out this type of testing, which increases the cost. ii) And it is nearly impossible to look into every bit of code to find out hidden errors, which may create problems, resulting in failure of the application.

White box testing generates the test cases that: •Guarantees that all the independent paths with in a module have been exercised at least once •Exercise all logic decisions on their true and false sides •Execute all loops at their boundaries and with in their operational bounds •Exercise internal data structures to ensure their validity

White box testing techniques:

•Statement Coverage •Decision coverage •Condition coverage •Basis path testing •Loop testing •Data flow testing

Statement coverage:
This technique attempts to write enough test cases to execute every statement at least once Decision coverage : This technique is used to write test cases to exercise the true and false outcomes of every decision

Condition coverage: This technique is used to write test cases such that each condition in a decision takes on all possible outcomes at least once. It may not always satisfy decision coverage.

Basis path testing: It is a white box testing technique first proposed by Tom McCabe which is based on the fact that every statement in the program must be executed at least once during testing

It uses certain notations and concepts for representing the control flow which are: •Flow graph notation •Cyclomatic complexity •Graph Matrices

1

Nodes

22 Edges 3 4

Region
5 6

Cyclomatic Complexity: This is a quantitative measure of the logical complexity of a program.the calculated value of cyclomatic complexity defines the number of independent paths. The cyclomatic complexity V(G) of the flow graph can be computed using any of the formulas: V(G) = Edges – Nodes + 2 Or V(G) = Regions in flow graph Or V(G) = Predicate Nodes +1

Graph Matrices A Graph Matrix is a square matrix that assists in basis path testing whose size is equal to the number of nodes in the flow graph

Example Int compute_gcd (intx,inty){ 1. While (x! =y){ 2. If (x>y) then 3. X=x-y;

4. Else y=y-x; 5. } 6. Return x; }

Loop testing: It is a white box testing technique that checks the validity of the loop constructs. Loop can be classified into four types: •Simple loops •Nested loops •Concatenated loops •Unstructured loops

Data Flow Testing; This is the type of control structure testing that selects the test plans of a program according to the variable definition and its use in the program

Different Types of Testing

Automated v/s manual
Automated Testing: Software testing assisted with software tools that require no operator input, analysis, or evaluation. Manual Testing: That part of software testing that requires human input, analysis, or evaluation.

Acceptance Testing: Smoke Testing: Regression Testing: Exploratory Testing Debugging Vs Be bugging

Smoke Testing: Smoke testing is nonexhaustive software testing, ascertaining that the most crucial functions of a program work, but not bothering with finer details.

Acceptance testing: Acceptance testing is
the final test action before deploying the software. The goal of acceptance testing is to verify that the software is ready and can be used by your end users to perform those functions and tasks for which the software was built.

Regression testing
The selective retesting of a software system that has been modified to ensure that any bugs have been fixed and that no other previously working functions have failed as a result of the modifications and that newly added features have not created problems with previous versions of the software. Regression testing is initiated after a programmer has attempted to fix a recognized problem or has added source code to a program that may have inadvertently introduced errors. It is a quality control measure to ensure that the newly modified code still complies with its specified requirements and that unmodified code has not been affected by the maintenance activity.

Exploratory and monkey testing
Monkey testing- This is another name for "Ad Hoc Testing"; it comes from the joke that if you put 100 monkeys in a room with 100 typewriters, randomly punching keys, sooner or later they will type out a Shakespearean sonnet. So every time one of your ad hoc testers finds a new bug, you can toss him a banana. The use of monkey testing is to simulate how your customers will use your software in real time. Exploratory testing involves simultaneously learning, planning, running tests, and reporting / troubleshooting results.

Debugging v/s bebugging
Debugging: The process of finding and removing the causes of failures in software. The role is performed by a programmer. Bebugging: The process of intentionally adding known faults to those already in a computer program for the purpose of monitoring the rate of detection and removal, and estimating the number of faults remaining in the program

Sign up to vote on this title
UsefulNot useful