Is a unique path through the software where no iterations are allowed – all possible paths through the system are linear combinations of them.
Basis path testing is a hybrid between path testing and branch testing. Path Testing: Testing designed to execute all or selected paths through a computer system. Branch Testing: Testing designed to execute each outcome of each decision point in a computer program.
From functionality or requirement understanding, draw a corresponding control flow graph
Calculate Cyclomatic Complexity using methods
Determine a basis set of linearly independent paths.
Prepare or generate test cases that force the execution of each path in basis path. Note: Test cases derived from basis set are guaranteed to execute each path at least once during testing.
Step 1: Draw a Control Flow Graph Any procedural design can be translated into a control flow graph: • Lines (or arrows) called edges represent flow of control • Circles called nodes represent one or more actions • A predicate node is a node containing a condition
Step 2: Calculate Cyclomatic Complexity Formula 1: Basis Path formula V(G) = edges - nodes + 2p where p = number of unconnected parts of the graph Formula 2: Predicate Nodes Formula V(G) = Number of Predicate Nodes + 1 Formula 3:Node to Node Connectivity called Graph Matrix Step 3: Determine a basis set of linearly independent paths