---
# System prepended metadata

title: Control flow graphs
tags: [ISTQB, SQA, Software Testing, White Box Testing Tech]

---

# Control flow graphs

###### tags: `White Box Testing Tech` `ISTQB` `Software Testing` `SQA` 

**provides a method of representing the decision points** and the flow of control within a piece of code,so it is just like a flow chart except **that it only shows decisions.**

### Two symbols: 
- nodes
    - A node represents any point where the flow of control can be modified (i.e. decision points),or the points where a control structure returns to the main flow.
- edges
    - An edge is a line connecting any two nodes. The closed area contained within a collection of nodes and edges, as shown in the diagram, is known as a ==region==.:question: 
![](https://i.imgur.com/pvdf8xF.png)
    
![](https://i.imgur.com/2lmDGLl.png)

## DRAWING A CONTROL FLOW GRAPH
1. Analyse the component to identify all control structures, that is all statements that can modify the flow of control, ignoring all sequential statements.
2. Add a node for any decision statement.
3. Expand the node by substituting the appropriate subgraph representing the structure at the decision point.
![](https://i.imgur.com/0DfL6zD.png)
- Step1 Analyze the component find out the all decision.
![](https://i.imgur.com/QxgjlcP.png)
- Step2 Add a node for decision statement
![](https://i.imgur.com/q0KlaXQ.png)
- Step3 Expand the node
![](https://i.imgur.com/IE4IWE8.png)




