
A definition-use path, du-path, with respect to a variable v is a path whose first node is a defining node for v, and its last node is a usage node for v
List all of the du-paths with respect to x. (Note: Include all du-paths, even those that are subpaths of some other du-paths). For each test path, determine which du-paths that test path du-tours. Consider direct touring only. Hint: A table is a convenient format for describing the relationship. x (Direct tours only). Use the given test paths. x.
• One DU pair might belong to many execution paths. Cover all simple (non-looping) paths at least once. • Can reveal faults where a path is exercised that should
• Understand why data flow criteria have been designed and used • R i d di ti i h b i DF it iRecognize and distinguish basic DF criteria – All DU pairs, all DU paths, all definitions • Understand how the infeasibility problem impacts data flow testing • Appreciate limits and potential practical uses of data flow testing
• Introduce Path Coverage • Data Flow Coverage Criteria • Focus on how information spreads through a program instead of how control flows. • Based on Definition-Use Pairs • (Where is X defined? Where is each definition of X used?)
Data Flow Path Selection • Rapps and Weyuker • definition-clear subpaths from definitions to uses • Ntafos • chains of alternating definitions and uses linked by definition-clear subpaths • Laski and Korel • combinations of definitions that reach uses at a node via a subpath
Data Flow Coverage 2 Stuart Anderson Stuart Anderson Data Flow Coverage 2 c 2011. 1 ... even for this trivial example! Consider the below code fragment. On the surface there are four paths through ... pairs, not paths: only one def-clear path needed per DU pair. All-c-uses requires exercise of all DU pairs culminating in computations. Note ...
Categorizing DU-Paths The core of data flow testing –allowing definitions to flow to uses The test criteria for data flow will be defined as sets of du-paths. Thus, we first categorize the du-paths according to: def-path set du(n i, v) All simple paths w.r.t. a given variable v defined in a given node def-pair set du(n i, n j, v)
Data flow testing focuses on the variables used within a program. Variables are defined and used at different points within the program; data flow testing allows the tester to chart the changing values of variables within the program.
n Given a program written in an imperative language, its DD-Path graph is a directed graph, in which nodes are DD-Paths of its program graph, and edges represent control flow between successor DD-Paths. n Let’s try an example... n How many path expressions in this example?
- Some results have been removed