# Automatic Test Data Generation Using the Activity Diagram and Search-Based Technique
## 2 Related Work
### Revisiting Data Flow Representation and Concepts in ADs  
This section presents the background for this study, revisiting the data flow representation and concepts in ADs [23] and providing an example and related definitions. An activity is a behavior specified as a sequence of subordinate units using a control and data flow model [18]. Actions are executable nodes required for any significant capability of an activity; they embody lower-level steps in the overall activity. Action notation appears only in the AD and is central to the data flow aspects of activities [18]. Actions can invoke other behaviors and operations, access and modify objects, and perform more advanced coordination of other actions. For example, Figure 1a has two actions: a CreateObject action that creates an object of type Activity B and a CallBehavior action that calls Activity B. Actions also have a specialized form of object nodes (Pins) so that object flows can get and provide data. For example, Figure 1b has a SendObject action that sends an object via its output Pin and another action that gets the object via its input Pin and manipulates its contents. These object flows provide the primary means for exchanging data between activities. Activities also introduce parameters and structural features or variables. As depicted in Figure 1c, the use of variables in an AD effectively provides indirect data flow paths from the point at which a value is written to the variable to all the points at which the value is read from the variable [18]. By analyzing an action sequence and its behavior and using the information in action Pins, activity parameters, and decision constraints, it is possible to automatically track the flow of data among activities in an AD. Figure 1: Data flow representation and concepts in activity diagrams (Ads). (**a**) create object and call activity action, (**b**) send object action, (**c**) value specification and guard condition. **Definition 1**. : _An AD is a directed graph that can be described formally as an activity model, \(M=\) (A, E, C, V, \(a_{I}\), \(a_{F}\)) where:_  
* \(A=\{a_{1},a_{2},\) _,_ \(\ldots\)_,_ \(a_{n}\}\) _is a set of executable nodes (actions are the only kind of executable node, and object nodes are attached to actions as action Pins by executable nodes; we indicate the lower-level steps in the overall activities)._
* \(E\) _denotes a set_ \(E\) _of edges, where_ \(E\subseteq\{A\ x\ A\}\)_._
* \(C=\{c_{1},\) _\(c_{2},\) _,_ \(\ldots\)_,_ \(c_{n}\}=D_{N}\cup J_{N}\cup F_{N}\cup M_{N}\) _is a set of control nodes such that_ \(D_{N}\) _is a set of decision nodes;_ \(J_{N}\) _is a set of join nodes;_ \(F_{N}\) _is a set of fork nodes, and_ \(M_{N}\) _is a set of merge nodes. In terms of data flow,_ \(D_{N}\) _is analogous with predicate use._
* \(a_{I}\) _is an initial activity node, where_ \(a_{I}\subseteq A\) _and_ \(a_{I}\
eq\emptyset\)_._
* \(a_{F}\) _is a set of final nodes, where_ \(a_{F}\subseteq A\) _and_ \(a_{F}\
eq\emptyset\)_._
* \(V=\{v_{1},\) _\(v_{2},\) _,_ \(\ldots\)_,_ \(v_{i}\}\) _is a set of variables s.t._ \(V\) _includes both object variables and structural attributes (variables)._  
**Definition 2**. : _Variables can appear in different contexts in an AD.