Extracting the Control-Flow Information and Creating Diagrams


© Faisal Bin Bashir

The sixth step is to identify the control-flow of the diagram. I don't say that the order of these steps should be kept the way I am describing them. It may be changed according to the requirements and the nature of the information needed. But the data flow diagrams could be helpful in determining the flow of control of the program. So, the task of uncovering this structural information can occur while creating the data-flow diagram. What remains is to record the control structure of the program and explain its purpose. The control structure can be recorded using control-flow diagrams, which are overlaid on the data-flow diagrams. This step allows both data and control-flow to be visible on the same diagram. In addition, a state control model can be defined and recorded using a state diagram.

It's better to represent the control-flow and the data-flow information separately unless it is required to represent collectively. If that is so, then perform the procedure mentioned above. Otherwise show them on different diagrams.

Now, what could be in the control-flow diagrams? Control-flow diagrams show the flow of the program. The nodes of a control-flow diagram may represent a single statement, or a block of a set of statements related to each other. If each node represents a single statement, then it's a detailed control flow graph spanning a lot of space. It's difficult to make the graph to fit in a single screen so some part of the graph should be made available to show on the screen as requested by the user.

In a control-flow graph, a node also may represent a bock of statements. If it's desired to give an overview of the control-flow of the program, the sequence of statements in which there is no branching or no jump, then that sequence may be represented as a single block. This block may be represented in the diagram as a straight line.

Let us take a case in which the input system is a COBOL source code. There are four major divisions in a COBOL program. These are

 Identification division
 Environment division
 Data division
 Procedure division

All the working is done in the procedure division. So the control flow diagram contains statements from the procedure division. If it's a detailed diagram it will contain each statement as its node. If it's a compact control-flow diagram, then each node will represent a block. All the successive statements of a category such as MOVE, ADD, ACCEPT, etc. which include neither a jump nor a branching statement are identified as the straight-line code. Other statements like IF-ELSE, PERFORM and GOTO's can be identified as different blocks and also as statements at which a straight-line code ends.

Go To Page: 1 2


The copyright of the article Extracting the Control-Flow Information and Creating Diagrams in Software Re-engineering is owned by . Permission to republish Extracting the Control-Flow Information and Creating Diagrams in print or online must be granted by the author in writing.

Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo