Page 54 - DCAP305_PRINCIPLES_OF_SOFTWARE_ENGINEERING
P. 54
Principles of Software Engineering
Notes Components of the model
1. To every statement there is a node, whose name is unique. Every node has at least one
out link and at least one in link except for exit nodes and entry nodes.
2. Exit nodes are dummy nodes placed at the outgoing arrowheads of exit statements (e.g.,
END, RETURN), to complete the graph. Similarly, entry nodes are dummy nodes placed
at entry statements (e.g., BEGIN) for the same reason.
3. The out link is simple statements (statements with only one out link) are weighted by
the proper sequence of data-flow actions for that statement. Note that the sequence can
consist of more than one letter. For example, the assignment statement A= A + B in most
languages is weighted by cd or possibly ckd for variable A. Languages that permit multiple
simultaneous assignments and/or compound statements can have anomalies within the
statement. The sequence must correspond to the order in which the object code will be
executed for that variable.
4. Predicate nodes (if-then-else, do while, case) are weighted with the p use(s) on every out
link, appropriate to that out link.
5. Every sequence of simple statements (e.g., a sequence of nodes with one in link and one
out link) can be replaced by a pair of nodes that has, as weights on the link between them,
the concatenation of link weights.
6. If there are several data flow actions on a given link for a given variable, then the weight
of the link is denoted by the sequence of actions on that link for that variable.
7. Conversely, a link with several data flow actions on it can be replaced by a succession of
equivalent links, each of which has at most one data flow action for any variable.
Data Flow Testing
Data flow testing is the name given to a family of test strategies based on selecting paths through
the program’s control flow in order to explore sequences of events related to the status of data
objects. For example, pick enough paths to assure that every data object has been initialized
prior to use or that all defined objects have been used for something.
Motivation
It is our belief that, just as one would not feel confident about a program without executing
every statement in it as part of some test, one should not feel confident about a program without
having seen the effect of using the value produced by each and every computation.
Data Flow Machines
There are two types of data flow machines with different architectures. (1) Von Neumann
machines (2) Multi-instruction, multi-data machines (MIMD).
Machine Architecture
Most computers today are von-Neumann machines. This architecture features interchangeable
storage of instructions and data in the same memory units. The Von Neumann machine
Architecture executes one instruction at a time in the following micro instruction sequence:
1. Fetch instruction from memory
2. Interpret instruction
3. Fetch operands
4. Process or Execute
5. Store result
6. Increment program counter
7. GOTO 1
48 LOVELY PROFESSIONAL UNIVERSITY