Simple path and prime path software testing

Simple path

A simple path is a path in which any node can’t appear more than once but only starting and ending nodes can appear more than once.

Prime Path

The prime path is basically a simple path and it does not appear as a subpath of any other simple path.

round trip path
Figure: simple path, prime path

Simple Paths

In the figure, followings are the simple paths.

Length 0:

Following nodes represents simple paths with length 0 because having no outgoing edge.

Simple paths = [0], [1], [2], [3]

Length 1:

Following nodes represents simple paths with length 1 because having  total 1 outgoing edge.

Simple paths = [ 0, 1], [ 0, 2 ], [ 1, 3 ], [ 2, 3 ], [ 3, 0 ],

Length 2:

Following nodes represents simple paths with length 2 because having total 2 outgoing edges.

Simple paths = [ 0, 1, 3 ], [ 0, 2, 3 ], [ 1, 3, 0 ], [ 2, 3, 0 ],[ 3, 0, 1 ], [3, 0, 2 ],

Length 3:

Following nodes represents simple paths with length 3 because having total 3 outgoing edges.

Simple paths = [ 0, 1, 3, 0 ], [ 0, 2, 3, 0], [ 1, 3, 0, 1 ], [ 2, 3, 0, 2 ], [ 3, 0, 1, 3 ], [ 3, 0, 2, 3 ], [ 1, 3, 0, 2 ],[ 2, 3, 0, 1 ].

Prime Paths :

All of the following simple paths are the prime path.

[ 0, 2, 3, 0], [ 0, 1, 3, 0 ], [ 2, 3, 0, 2 ],  [ 1, 3, 0, 1 ], [ 3, 0, 2, 3 ], [ 3, 0, 1, 3 ], [ 2, 3, 0, 1 ] , [ 1, 3, 0, 2 ]

Round-Trip Path

A Round-Trip Path is a path that starts and ends with the same nodes.

Prime path coverage criteria(PPC)

According to prime path coverage(PPC), each prime path must be covered in test requirements.

Some facts about PPC:

  • PPC subsumes node coverage.
  • PPC subsumes edge coverage.

 

Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....
https://web.facebook.com/groups/2066136233601097/

Leave a Reply