Friday, 26 July 2013

Test Design Techniques

1. White box Testing

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. 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.

a) Basis Path Testing

Each independent path in the code is taken for testing.

b) Flow Graph Notation

The flow graph depicts logical control flow using a diagrammatic notation. Each structured construct has a corresponding flow graph symbol.

c) Cyclomatic Complexity

Cyclomatic complexity is software metric that provides a quantitative measure of the logical complexity of a program. In 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 least 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.

d) Graph Matrices

The procedure for deriving the flow graph and even determining a set of basis paths is amenable to mechanization. To develop a software tool that assists in basis path testing, a data structure, called a graph matrix can be quite useful.
A Graph Matrix is a square matrix whose size is equal to the number of nodes on the flow graph. Each row and column corresponds to an identified node, and matrix entries correspond to connections between nodes.

e) Control Structure Testing

Described below are some of the variations of Control Structure Testing.

Condition Testing

Condition testing is a test case design method that exercises the logical conditions contained in a program module.

 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.

f) 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.

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 passes 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.

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.

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.

Unstructured Loops

Whenever possible, this class of loops should be redesigned to reflect the use of the structured programming constructs.

2. Black box Testing

Black Box Testing is not a type of testing; it instead is a testing strategy. It does not need any knowledge of internal design or code etc. The types of testing under this strategy are totally focused on the testing for requirements and functionality of the work software application. It is also called as Opaque Testing, Functional/Behavioral Testing and Closed Box Testing.
Techniques of Black box Testing:
a. Graph Based Testing Methods:
Each and every application is build up of some objects. All such objects are identified and graph is prepared. From this object graph each object relationship is identified and test cases written accordingly to discover the errors.
b. Error Guessing:
This is purely based on previous experience and judgment of tester. Error Guessing is the art of guessing where errors can be hidden. For this technique there are no specific tools, writing the test cases that cover all the application paths.
c. Boundary Value Analysis:
Boundary Value Analysis (BVA) is a test Functional Testing technique where the extreme boundary values are chosen. Boundary values include maximum, minimum, just inside/outside boundaries, typical values, and error values.
Look at output boundaries for test cases too
Test min, min-1, max, max+1, typical values
 BVA techniques:
1. Number of variables
For n variables: BVA yields 4n + 1 test cases.
2. Kinds of ranges
Generalizing ranges depends on the nature or type of variables
Advantages of Boundary Value Analysis
1. Robustness Testing - Boundary Value Analysis plus values that go beyond the limits
2. Min - 1, Min, Min +1, Nom, Max -1, Max, Max +1
3. Forces attention to exception handling
Limitations of Boundary Value Analysis:
Boundary value testing is efficient only for variables of fixed values i.e boundary.
d. Equivalence Partitioning:
Equivalence partitioning is a black box testing method that divides the input domain of a program into classes of data from which test cases can be derived.
How this partitioning is performed while testing:
1. If an input condition specifies a range, one valid and one two invalid classes are defined.
2. If an input condition requires a specific value, one valid and two invalid equivalence classes are defined.
3. If an input condition specifies a member of a set, one valid and one invalid equivalence class is defined.
4. If an input condition is Boolean, one valid and one invalid class is defined.
e. Comparison Testing:
Different independent versions of same software are used to compare to each other for testing in this method.
Various testing types that fall under the Black Box Testing strategy are: functional testing, stress testing, recovery testing, volume testing, User Acceptance Testing (also known as UAT), system testing, Sanity or Smoke testing, load testing, Usability testing, Exploratory testing, ad-hoc testing, alpha testing, beta testing etc.

3. Structural System Testing Techniques

The following are the structural system testing techniques.

Technique
Description
Example
Stress
Determine system performance with expected volumes.
Sufficient disk space allocated.
Execution
System achieves desired level of proficiency.
Transaction turnaround time adequate.
Recovery
System can be returned to an operational status after a failure.
Evaluate adequacy of backup data.
Operations
System can be executed in a normal operational status.
Determine systems can run using document.
Compliance
System is developed in accordance with standards and procedures.
Standards follow.
Security
System is protected in accordance with importance to organization.
Access denied.

4. Functional System Testing Techniques

The following are the functional system testing techniques.

Technique
Description
Example
Requirements
System performs as specified.
Prove system requirements.
Regression
Verifies that anything unchanged still performs correctly.
Unchanged system segments function.
Error Handling
Errors can be prevented or detected and then corrected.
Error introduced into the test.
Manual Support
The people-computer interaction works.
Manual procedures developed.
Intersystem’s.
Data is correctly passed from system to system.
Intersystem parameters changed.
Control
Controls reduce system risk to an acceptable level.
File reconciliation procedures work.
Parallel
Old systems and new system are run and the results           compared to detect unplanned differences.
Old and new system can reconcile.

Are you looking for part/full time job ? Check the below link.

No comments:

Post a Comment