Subscribe by Email


Showing posts with label Basis Path Testing. Show all posts
Showing posts with label Basis Path Testing. Show all posts

Tuesday, March 20, 2012

Basis Path Testing is a white box testing technique - Explain?

As we all know in a typical software system or application, there exist so many possible paths between the entry and exit of the paths and the number of such potential paths is doubled by every decision that comes in the way.

On top of this every case statements adds to the number of the potential paths by multiplying the number of cases with the number of potential paths and this is further incremented by the loops which multiply all the different possible iteration values with the number of potential paths.

So you see with so many paths all over, a single unit of the code makes it extremely difficult to provide a 100 percent coverage to that unit. This can be illustrated by the following example:

- Consider a software program consisting a straight line code having only a single loop that is to be executed 50 times.
- For such a code we can easily make out that it will have 50 paths.
- Like all the other processes, the testing also does not have any unlimited amount of resources.
- There are a limited number of people to perform testing, limited resources, time, efforts and equipment to make up to the successful testing in a stipulated period of time.
- The testing processes always face a challenge of covering all the possible paths without going out of the specified limits.
- But this seems like very difficult to be achieved!

"This all can be possibly achieved if all the redundancy is eliminated from the source code to the maximum extent that is possible and at the same time, adequate coverage must be maintained."

How was basis path testing developed?

- Basis path testing was developed as a hybrid between the two testings namely the path testing and the branch testing.

- The path testing is the testing methodology that has been defined to execute paths all over a computer program whether all or selected and the branch testing is the testing methodology that has been defined for the execution of all the outcomes of every decision in a software source code.

- It can be thought of as a testing methodology that tests every branch and also all the independent paths throughout the software program.

- A path can be a sequence of statements or instructions to the system that starts at one junction and ends at the other and in between it may encounter several other junctions.

- An independent path is a bit different from the normal path in the way that it introduces a new set of processing statements or conditions.

What steps are involved in basis path testing?

It is a path that takes in to account only the paths with the linear combination of the iterations and in no other way. The following steps are involved in the basis path testing:

1. Drawing out of the control flow graph
2. Calculation of the cyclomatic complexity
3. A basis set of paths is chosen
4. Generation of the test cases for the execution of each and every path in the code

Benefits of Basis Path Testing

1. It clearly defines the number of the independent paths and the number of the test cases required.
2. It executes every statement at least once.
3. It executes every condition for both outcomes i.e., true and false at least once.
4. It pays attention to the logic of the program.
5. It facilitates the arbitrary test case design in contrast to the analytical test case design.

Basis path testing is a white box testing technique since one requires an in-depth knowledge of the program.


Thursday, July 28, 2011

Basis Path Testing - A white Box testing technique.

Basis Path Testing uses the algorithmic flow of the program to design tests. Test cases that are written to test the basis set execute every statement in the program at least once.

- A flow graph should be drawn only when the logical structure of a component is complex. The flow graph allows you to trace program paths more readily. When compound conditions are encountered in a procedural design, the generation of a flow graph becomes slightly more complicated.

- Independent program path is a path which has at least one new set of processing statements or a new condition. An independent path should move along one edge that has not been traversed before. To know how many paths to look for, cyclomatic complexity is a useful metric for predicting those modules that are likely to be error prone. It can be used for test planning as well as test case design. Cyclomatic complexity provides the upper bound on the number of test cases that will be required to guarantee that every statement in the program has been executed at least one time.

- There are few steps to derive test cases or the basis set.
A flow graph is drawn using the design or code.
The cyclomatic complexity of flow graph is evaluated.
A basis set of linear independent path is determined.
Test cases are prepared forcing the execution of each path in basis set.

- Graph matrix is a square matrix whose size is equal to the number of nodes on flow graph. It is a tabular representation of a flow graph. Adding link weight to the each matrix entry, graph matrix can become a powerful tool to evaluate program control structure during testing.


Monday, April 11, 2011

Software Test Case Design Methods - White Box Testing Methods

Software is tested in two ways:
- First approach is test the internal workings of software. It is also called white box testing.
- Second approach is to test the software as a whole, i.e., know how the software works and tests if it conforms to the specified functionality in the requirements. It is also called black box testing.

White Box Testing Techniques


It is a test case design technique that uses the internal control structure of the software component. It is also called glass box testing. It ensures that no logical errors, incorrect assumptions and typographical errors have been missed. The test cases that are included are testing all logical conditions, loops, independent paths, internal data structures. Techniques involved are:

- Basis Path Testing
It enables the test case designer to derive a logical complexity measure based on the procedural specification of a software component.
STEP 1: Use a procedural specification as input in deriving the basic set of execution path.
STEP 2: Draw the flow graph of the procedural specification.
STEP 3: Compute for the complexity of the code.
STEP 4: Determine the basic set of execution paths.
STEP 5: Document the test cases based on the identified execution path.

- Control Structure Testing
A white box testing technique that tests three types of program control - condition testing, loop testing and data flow testing.
Condition testing test the logical conditions contained in a procedural specification.
Looping testing is a method that focuses exclusively on the validity of iterative constructs or repetition.
Data Flow Testing method selects test paths of a program according to the locations of the definitions and uses of variables in the program.


Facebook activity