Testing 3
All-C-Uses
Test cases include a definition-clear path from every definition to all of its corresponding c-uses.
A Points of Control and Observation PCO could be...
• a device or user interface • a particular method to call (Junit) • a network port
●loop free path
- all nodes distincts - simple nodes may not be loop free if frist, last are not discnt
●simple path
- all nodes except possibly first and last are distincts
●def(x, v) reaches v' if
-There exists a path from v to v' such that the nodes of the path (except v) do not define x
●We say that (def(x,v), use(x,v')) is a definition-use pair (DU pair) if
-def(x,v) reaches v' ●du-pair with respect v (d,u) -d node where v is defined -u node where v is used -def-clear path with respect to v from d to u.
●complete path
-initial node is start node, final node is exit node
●Know how to measure the difference. ●Four complementary methods:
1.Formal methods - verify mathematically specified properties. 2.Testing - explicit input to exercise software and check for expected output. 3.Inspections - human examination of requirements, design, code, ... based on checklists. 4.Metrics - measures a known set of properties related to quality.
● ..... 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.
A definition-use path (du-path)
●Is a dynamic test case writing technique focuses on modeling dependency relationship among program input condition (causes) and output condition (effects).
Cause-Effect Graphing ●A cause is any condition in the requirement that may affect the program output. ●An effect is the response of the program to some combination of input conditions, e.g., error message. ○It need not be an output visible to the user of the program, e.g., check that an intermediate method has been invoked.
●Verification
The process of determining whether or not the products of a given phase of the software development cycle fulfill the requirements established during the previous phase.
●Validation
The process of evaluating software at the end of the software development process to ensure compliance with software requirements.
A du-path with no other defining node for v is a ...
dc-path path
Any path starting from a node at which variable x is defined and ending at a node at which x is used, without redefining x anywhere else along the path, is a ....
def-clear path for x.
Du-Path with respect to variable x at node n1 is a path [n1, n2, .... nk] where n1 has a global definition of x and either -Node nk has a global c-use of x and [n1....nk] is def-clear simple path with respect to x or, -Node nk has a p-use of x and [n1....nj] is a def-clear loop-free path with respect to x
definition-use path
A data flow graph is a directed graph constructed as follows ●A sequence of definitions and c-uses is associated with .... ●A set of p-uses is associated with ... ●The entry node has a definition of each parameter and each nonlocal variable used in the program. (لا تنسينه) ●The exit node has an undefinition of each local variable. (لا تنسينه)
each node of the graph. each edge of the graph.
All-P-Uses/Some-C-Uses
●Apply all-p-uses; then if any definition of a variable is not covered, use c-use ●TCs include definition-clear path from every definition to all of its corresponding p-uses, if a definition has no p-use, then include a definition-clear path to some c-use.
Control flow coverage vs data flow coverage
●Control flow coverage is defined in terms of nodes, edges, paths; ●data flow coverage is defined in terms of def, use, and du-path.
Control flow testing vs data flow testing
●Control flow testing focuses on the transfer of control. ●data flow testing focuses on the definitions of data, their subsequent use.
Black Box Testing Approaches
●Error guessing ●Equivalence Partitioning ●Boundary Value Analysis ●Category Partitioning ●Decision tables ●Cause-Effect Graphing ●Tests derived from functional requirements (e.g. use cases)
All-P-Uses
●For every variable v, at least one def-clear path from every definition of v to every p-use of v must be covered. Test cases include a definition-clear path from every definition to all of its corresponding p-uses.
Three General Principles of QA
●Know what you are doing. ●Know what you should be doing. ●Know how to measure the difference.
V and V techniques
●Static Approaches (applicable to verifications) ●Reviews & Inspections ●Static analysis ●Dynamic Approaches (applicable to both verification and validation) ●Involve running the system ●Resume to Testing
Data flow testing can be performed at two conceptual levels:
●Static data flow testing - Identify potential defects, commonly known as data flow anomaly. - Analyze source code. - Do not execute code. ●Dynamic data flow testing - Involves actual program execution. - Bears similarity with control flow testing. • Identify paths to execute them. • Paths are identified based on data flow testing criteria.
All-C-Uses/Some-P-Uses
●TCs include definition-clear path from every definition to all of its corresponding c-uses, if a definition has no c-use, include a definition-clear path to some p-use.
All-Uses
●every def reaches all possible uses ●It requires us to tour at least one path for every def-use pair. *one TC for every use
All-Defs
●make sure every def reaches a use ●For every def x, cover at least one path (free of definition of x), to at least one use x.
All-DU-Paths
●we cover all "paths" between defs and uses اغطي كل الباثز الممكنة اللي تودي من def الى use