What is Basis path testing in software testing?

In software testing, there are many paths between the entry and exit of a software program. So it’s difficult to fully test all paths of even a simple unit. This is a challenge when we design test cases. We need to eliminate redundant tests by providing adequate test coverage for effective testing. One of the ways to do so, is by applying a method called basis path testing.

Basis path testing or structured testing is a white box testing method which is used for designing test cases intended to examine all possible paths of execution at least once. Creating and executing tests for all possible paths results in 100% statement coverage and 100% branch coverage.


basis path testing in white box testing

Steps to calculate the independent paths

Step 1: Draw the Flow Graph of the Function/Program under consideration as shown below:

basis path testing in software engineering

Step 2: Determine the independent paths.

basis path testing cyclomatic complexity

Steps for Basis Path testing

Draw a control flow graph.

  • Determine cyclomatic complexity.
  • Find a basis set of paths.
  • Generate test cases for each path.

Advantages of basis path testing:

  • It helps to reduce the redundant tests
  • It focuses attention on program logic
  • Basis path testing helps to determine all faults lying within a piece of code.
  • Test cases which exercise basis set will execute every statement in program at least once.
Share This: