Data Flow Analysis, Control Flow Graphs Flashcards

1
Q

What are modern compilers

A

Static analysis tools to detect defects such as syntax errors
Correct data type usage
Undeclared variables
Unreachable code
This is assisted by data flow analysis and control flow analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Data flow analysis

A

Concerned with how data is used on different paths through the code
There are 3 different usage states for each data variable
Undefined - data has no defined value
Defined
Referenced - the data is used
It can’t detect errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Data flow can detects anomalies

A

Ur-anomaly an undefined data item is read on a program path
Du-anomaly data item that has been assigned a value, becomes undefined without being used
Dd-anomaly a data item that has been assigned a value is assigned another value without being used in the meantime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Program flow graphs

A

Describes program control flow, each branch shown as separate path and loops are shown by arrows looping back to loop condition node
Control flow graph is a graphical representation of a programs control structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Path testing

A

Desired paths through program executed at least once
Starting point for path testing is a program flow graph that shows nodes representing program decisions and arcs representing control flow
Statements with conditions are therefore nodes in the flow graph

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a decision

A

Program point at which the control can diverge (e.g. if and case statements)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a junction

A

Program point where the Control flow can merge e.g. end if, end loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a process block

A

Sequence of program statements uninterrupted by either decisions or junctions e.g, straight line code. A process has one entry and one exit. A program does no jump into or out of process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Paths consist of

A

Segments, the smallest segment is a link. A link is a single process that lies between 2 nodes.
The length of a path is number of links in a path. An entry/exit path or a complete path is a path that starts at a routines entry and ends at the same routines exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why are complete paths useful for testing

A

Difficult to set up and executed paths that start at an arbitrary statement
Difficult to stop at an arbitrary statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly