Paths.pptxfdgdgffgfdfhfhfhfhfdhfghfdhfdh

durga520075 0 views 21 slides Sep 09, 2025
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

gdgdsgdg


Slide Content

PATHS – CODE COMPLEXITY TESTING ADDITIONAL WHITE BOX TESTING APPROACHED EVALUATING TEST ADEQUACY CRITERIA

Paths: Their Role in White Box-Based Test Design The role of a control flow graph  generate control flow graphs. These tools typically calculate a value for a software attribute called McCabe‘s Cyclomatic Complexity V(G) from a flow graph. The cyclomatic complexity attribute is very useful to a tester. The complexity value is usually calculated from the control flow graph (G) by the formula

The cyclomatic complexity value of a module is useful to the tester in several ways. Provide an approximation of the number of test cases needed for branch coverage in a module of structured code. If the testability of a piece of software is defined in terms of the number of test cases required to adequately test it , then McCabes ‘ cyclomatic complexity provides an approximation of the testability of a module. The tester can use the value of V(G) along with past project data to approximate the testing time and resources required to test a software module. In addition, the cyclomatic complexity value and the control flow graph give the tester another tool for developing white box test cases using the concept of a path

PATH A p a t h i s a s e q u e n c e o f c o n t r o l f l o w n o d e s u s u a ll y b e g i n n i ng f r o m t h e e n t r y n o de o f a g ra p h t h r ou g h t o t h e e x i t n o d e . A path may go through a given segment of the control flow graph one or more times. We usually designate a path by the sequence of nodes it encompasses.

1-2-3-4-5-7-4-8 1-2-3-4-8 S et of independent paths starting ( i ) 1-2-3-4-8 (ii) 1-2-3-4-5-6-7-4-8 (iii) 1-2-3-4-5-7-4-8 The number of independent paths in a basis set is equal to the cyclomatic complexity of the graph.

Cyclomatic complexity is a measure of the number of so-called in-dependent paths in the graph. An independent path is a special kind of path in the flow graph . A set of independent paths for a graph is sometimes called a basis set. For most software modules it may be possible to derive a number of basis sets.

CODE COMPLEXITY TESTING Code complexity testing can be achieved by calculating cyclomatic complexity of a flow graph. A flow graph is a representation of a program. A flow graph consists of nodes and edges. In order to convert a standard flow chart into a flow graph to compute cyclomatic complexity, the following steps to be taken Identify the predicates or decision points in the program Ensure that the predicates are simple Combine all sequential statements into a single node. When a set of sequential statements are followed by a simple predicate, combine all the sequential statements and the predicate check into one node and have two edges emanating from this one node. Such nodes with two edges emanating from them are called predicate nodes Make sure that all the edges terminate at some node; add a node to represent all the sets of sequential statements at the end of the program.

Evaluating Test Adequacy Criteria Most of the white box testing approaches we have discussed so far are associated with application of an adequacy criterion. Testers are often faced with the decision of which criterion to apply to a given item under test given the nature of the item and the constraints of the test environment (time, costs, resources) One source of information the tester can use to select an appropriate criterion is the test adequacy criterion hierarchy which describes a subsumes relationship among the criteria

Achieving all definition-use (def-use) path adequacy means the tester has also achieved both branch and statement adequacy.

Weyuker presents a set of axioms that allow testers to formalize properties which should be satisfied by any good program-based test data adequacy criterion.

Applicability Property For every program there exists an adequate test set. For all programs we should be able to design an adequate test set that properly tests it. The test set may be very large so the tester will want to select representable points of the specification domain to test it. If we test on all representable points, that is called an exhaustive test set. The exhaustive test set will surely be adequate since there will be no other test data that we can generate.

5. Anti extensionality Property There are programs P and Q such that P is equivalent to Q, and T is adequate for P, but T is not adequate for Q. We can interpret this axiom as saying that just because two programs are semantically equivalent (they may perform the same function) does not mean we should test them the same way. Their implementations (code structure) may be very different. The reader should note that if programs have equivalent specifications then their test sets may coincide using black box testing techniques, but this axiom applies to program-based testing and it is the differences that may occur in program code that make it necessary to test P and Q with different test sets.