0% found this document useful (0 votes)
100 views16 pages

Basis Path Testing: By: Neha Sharma

Basis path testing is a white box testing technique that aims to provide adequate test coverage by testing all independent paths through the code. It involves drawing a control flow graph of the code, calculating cyclomatic complexity to determine the minimum number of tests needed, choosing a basis set of paths that covers all program logic, and generating test cases to execute each path. Key steps include drawing the control flow graph, calculating complexity using various formulas, and creating test cases to exercise all independent paths through the code.

Uploaded by

Deepti Khanna
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views16 pages

Basis Path Testing: By: Neha Sharma

Basis path testing is a white box testing technique that aims to provide adequate test coverage by testing all independent paths through the code. It involves drawing a control flow graph of the code, calculating cyclomatic complexity to determine the minimum number of tests needed, choosing a basis set of paths that covers all program logic, and generating test cases to execute each path. Key steps include drawing the control flow graph, calculating complexity using various formulas, and creating test cases to exercise all independent paths through the code.

Uploaded by

Deepti Khanna
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

BASIS PATH

TESTING

BY: NEHA SHARMA


THE CHALLENGE OF TESTING
________________________________________________________________________________________________________________________________

A major challenge in testing is to determine a


good starting set of test cases that:

 Eliminate redundant testing


 Provide adequate test coverage
 Allow more effective testing
 Make the most of limited testing resources
WHITE BOX TESTING
_____________________________________________________________________________________________________________________________________

• Uses an internal perspective of the system to


design test cases

• The tester chooses test case inputs to exercise


paths through the code and determines the
appropriate outputs.
TECHNIQUES
_____________________________________________________________________________________________________________________________________

• BASIS PATH TESING


• DATA FLOW TESTING
• INTEGRATION TESTING
• SMOKE TESTING
• REGRESSION TESTING
INDEPENDENT PATH???
___________________________________________________________________________________________________________________________________

An independent path is any path through the


software that introduces at least one new
set of processing statements or a new
condition.
BASIS PATH TESTING
_____________________________________________________________________________________________________________________________________

• Testing that fulfills the requirements of branch


testing & also tests all of the independent
paths .

• No iterations are allowed.


STEP TO BE FOLLOWED:-
_____________________________________________________________________________________________________________________________________

1: Draw a control flow graph.


2: Calculate Cyclomatic complexity.
3: Choose a “basis set” of paths.
4: Generate test cases to exercise each path.
CONTROL FLOW GRAPH
___________________________________________________________________________________________________________________________________-

• Lines ( ) called edges represent flow of


control
• Circles( ) called nodes represent one or more
actions
• Areas bounded by edges and nodes called
regions
• A predicate node is a node containing a
condition
CONTROL FLOW GRAPH STRUCTURES:-
_____________________________________________________________________________________________________________________________________________________________
1. TO DRAW CONTROL GRAPH:-
• Can be done directly from source code
2. TO CALCULATE CYCLOMATIC COMPLEXITY
____________________________________________________________________________________________________________________________________________________________

• A measure of the number of linearly


independent paths through the
unit/component.
• an upper bound for the number of tests
• Three ways:-
1. V(G) = edges – nodes + 2.
2. No. of predicate nodes + 1.
3. Total no. of regions.
THROUGH FIRST METHOD
_____________________________________________________________________________________________________________________________________

Nodes

Edges

V(G)= edges-nodes+2
V(G)=11-9+2
=4
THROUGH FIRST METHOD
_____________________________________________________________________________________________________________________________________

Complexity= no. of predicate nodes + 1


=3+1=4
THROUGH THIRD METHOD
_____________________________________________________________________________________________________________________________________

Total no. of regions= 4

Closed Regions
GENERATING TEST CASES
_____________________________________________________________________________________________________________________________________
THANKU

You might also like