Arunkumar Khannur's Software Testing Knowledge Center
   
 

4.5 Path Testing

4.5.1 Arrive at Test Paths

In order to perform Path Testing, we use the Graphical Representation of a program structure as specified in earlier section. In the following section the basic concepts: path selection criteria: path testing criteria: creating the table that shows the paths: the coverage status of each decisions and process: use of predicate expressions: path sensitisation and path instrumentation have been described.

4.5.2 Basic Concepts –Nodes, Links, and Paths

Understanding of following concepts is useful in graphical representation and also, in the related concepts on path testing.
Node: Represents statements, process blocks and also decisions that are used in earlier flow Graphs and control flow Graphs. Nodes are usually numbered or labelled by using the original labels associated with original program statement.
Links: Links are directed lines with arrows indicating direction of the flow. Links can be labelled using small case letters. The link name can be formed from the names of the nodes it spans.
Path: A path is a sequence of statements that starts from any node in the program and ends in any other node or same node in the program. A path may consists of several statements, junctions, process, or decisions which may be executed one or more times.
Path Segment: A path segment is a representation of consecutive links that are traced one after the other in a given path.
Length of a Path: Length of a path is measured by the number of links in that path. Alternatively the length of the path is measured by number of nodes traversed in that path. The number of link traversed is just one less than the number of nodes traversed.
Name of a Path: The name of the path is the name of the node along the path. Alternatively if the links are labelled; the name of the path is the succession of link name along the path.
Entry / Exit Path or Complete Path: This denotes a path that starts at the entry and goes to an exit. To understand the above concepts, we can re-write Fig. 4.7 Graphical Representation as shown in Fig. 4.8 Graphical Representation with labelled links for Fig. 4.7 Example

With the help of Fig. 4.8 Graphical Representation with labelled links for Fig. 4.7 Example, we can provide some examples on concepts that we discussed:

Examples on Path:
Following are some examples on paths:
Paths between node 1 to node 6 are: (1,2,3,4,6) and (1,2,3,5,6)

Examples on Path Segment:
Corresponding Path Segment for path (1,2,3,4,6) is a,b,c,e or simply abce. Also, Path Segment for path (1,2,3,5,6) is abdf.

Examples on Length of Path:
For path (1,2,3,4,6) from node 1 to node 6 in (1,2,3,4,6), length of path is 4 since there are 4 links that we need to follow from node 1 to node 6 in this path.

Examples on Name of the Path:
Name of the path corresponding to Path Segment of path (1,2,3,4,6) is 12346 or abce. For Path Segment of path (1,2,3,5,6) is 12356 or abdf.

Examples on Complete Paths or Entry/Exit Paths:
For start node 1 to end node 11, following are the paths:

abceghjl
abcegikl
abdfghjl
abdfgikl


4.5.3 Path Selection Criteria
Path selection criteria are very critical in effective path testing. In order to support “COMPLETE TESTING” following criteria shall be used which are termed as Path Selection Criteria.
  1. Exercises every path from entry to exit
  2. Exercises every statement or instructions at least once
  3. Exercises every branch and case statement in each direction atleast once

When criteria 1 is fulfilled, we can notice that criteria 2 and 3 are automatically fulfilled.
 
 
Khannur's Book
Arunkumar Khannur, Software Testing - Techniques and Applications, Published by Pearson Publications, 2011 (ISBN:978-81-317-5836-6; Pages:341 + xxii)
Follow Khannur
         
Khannur's Company
ISQT Process & Consulting Services Pvt. Ltd., Bangalore, INDIA
Khannur's Software Testing Forum
STEP-AUTO Forum
 Contact Khannur
ISQT Process & Consulting Services Pvt. Ltd.
#732, 1st Floor, 12th Main,
3rd Block, Rajajinagar,
Bangalore - 560010, INDIA
Phone: +91 80 23012511
URL: www.isqtinternational.com
Email: khannur@isqtinternational.com
Skype: arun.isqt