Control Flow Graphs in Software Testing

Control Flow Graphs

  • The graphical representation of a program's control structure is known as control flow graph
  • It uses the elements like process blocks, decisions and junctions
  • The flow graph is not to be confused with the earlier flowchart, though both are similar
  • The four different types of flow graph elements are
Process Block:
A process block is a sequence of program statements which are not interrupted by either decisions or junctions
If any one of the statements of the block is executed, then all followed statements are executed
Process block contains a piece of straight line code of one statement or hundreds of statements
A process has one entry and one exit
It can consist of a single statement or instruction, a sequence of statements or instructions, a single entry/exit subroutine, a macro or function call, or a sequence of these
Decisions
 A decision is a program point at which the control flow can diverge
Example: Machine language conditional branch and conditional skip instructions
In control flow, most of the decisions are two way but in some case it may have three way branches
Case Statements:
A case statement is a multi -way branch or a decision
Example: A jump table in assembly language and the PASCAL case statement
In the test design point of view, there are no differences between decisions and case statements

Junctions
A junction is a point in the program where the control flow can merge
Examples of junctions are, the target of a jump or skip instruction in ALP a label that is a target of GOTO


Share on Google Plus

About Data Sciences by Venu

Hi, My name is Venugopala Chary and I'm Currently working as Associate Professor in Reputed Engineerng College, Hyderabad. I have B.Tech and M.tech in regular from JNTU Hyderabad. I have 11 Years of Teaching Experience for both B.Tech and M.Tech Courses.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment