Coverage Criteria in Software Generating PDF 417 in Software Coverage Criteria

How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
Coverage Criteria generate, create pdf 417 none on software projects Windows Forms the number of va Software PDF-417 2d barcode riables that are declared (O(Refs*Vars)). The selective mutation approach mentioned below under Designing Mutation Operators eliminates the number of data objects so that the number of mutants is proportional to the number of variable references (O(Refs)). More details are in the bibliographic notes.

Program-based mutation has traditionally been applied to individual statements for unit level testing. Figure 5.1 contains a small Java method with six mutated lines (each preceded by the symbol).

Note that each mutated statement represents a separate program. The mutation operators are de ned to satisfy one of two goals. One goal is to mimic typical programmer mistakes, thus trying to ensure that the tests can detect those mistakes.

The other goal is to force the tester to create tests that have been found to effectively test software. In Figure 5.1, mutants 1, 3, and 5 replace one variable reference with another, mutant 2 changes a relational operator, and mutant 4 is a special mutation operator that causes a runtime failure as soon as the statement is reached.

This forces every statement to be executed, thus getting statement or node coverage. Mutant 6 looks unusual, as the operator is intended to force the tester to create an effective test. The failOnZero() method is a special mutation operator that causes a failure if the parameter is zero and does nothing if the parameter is not zero (it returns the value of the parameter).

Thus, mutant 6 can be killed only if B has the value zero, which forces the tester to follow the time-tested heuristic of causing every variable and expression to have the value of zero. One point that is sometimes confusing about mutation is how tests are created. When applying program-based mutation, the direct goal of the tester is to kill mutants; an indirect goal is to create good tests.

Even less directly, the tester wants to nd faults. Tests that kill mutants can be found by intuition, or if more rigor is needed, by analyzing the conditions under which a mutant will be killed. The RIP fault/failure model was discussed in Section 1.

2. Program-based mutations represent a software failure by a mutant, and reachability, infection, and propagation refer to reaching the mutant, the mutant causing the program state to be incorrect, and the eventual output of the program to be incorrect. Weak mutation relaxes the de nition of killing a mutant to include only reachability and infection, but not propagation.

That is, weak mutation checks the internal state of the program immediately after execution of the mutated component (that is, after the expression, statement, or basic block). If the state is incorrect the mutant is killed. This is weaker than standard (or strong) mutation because an incorrect state does not always propagate to the output.

That is, strong mutation may require more tests to satisfy coverage than weak mutation. Experimentation has shown that the difference is very small in most cases. This difference can be formalized by re ning the de nition of killing mutants given previously.

De nition 5.49 Strongly Killing Mutants: Given a mutant m M for a program P and a test t, t is said to strongly kill m if and only if the output of t on P is different from the output of t on m. Criterion 5.

35 Strong Mutation Coverage (SMC): For each m M, T R contains exactly one requirement, to strongly kill m.. Syntax-Based Testing De nition 5.50 W PDF-417 2d barcode for None eakly Killing Mutants: Given a mutant m M that modi es a location l in a program P, and a test t, t is said to weakly kill m if and only if the state of the execution of P on t is different from the state of the execution of m immediately after l. Criterion 5.

36 Weak Mutation Coverage (WMC): For each m M, T R contains exactly one requirement, to weakly kill m. Consider mutant 1 in Figure 5.1.

The mutant is on the rst statement, thus the reachability condition is always satis ed (true). In order to infect, the value of B must be different from the value of A, which is formalized as (A = B). To propagate, the mutated version of Min must return an incorrect value.

In this case, Min must return the value that was assigned in the rst statement, which means that the statement inside the if block must not be executed. That is, (B < A) = false. The complete test speci cation to kill mutant 1 is Reachability : true Infection : A = B Propagation : (B < A) = false Full Test Speci cation : true (A = B) ((B < A) = false) (A = B) (B A) (B > A) Thus, the test case value (A = 5, B = 7) should cause mutant 1 to result in a failure.

The original method will return the value 5 (A) but the mutated version returns 7. Mutant 3 is an example of an equivalent mutant. Intuitively, minVal and A have the same value at that point in the program, so replacing one with the other has no effect.

As with mutant 1, the reachability condition is true. The infection condition is (B < A) = (B < minVal). However, dutiful analysis can reveal the assertion (minVal = A), leading to the combined condition ((B < A) = (B < minVal)) (minVal = A).

Simplifying by eliminating the inequality = gives (((B < A) (B minVal)) ((B A) (B < minVal))) (minVal = A) Rearranging the terms gives (((A > B) (B minVal)) ((A B) (B < minVal))) (minVal = A) If (A > B) and (B minVal), then by transitivity, ( A > minVal). Applying transitivity to both the rst two disjuncts gives ((A > minVal) (A < minVal)) (minVal = A) Finally, the rst disjunct can be reduced to a simple inequality, resulting in the following contradiction: (A = minVal) (minVal = A) The contradiction means that no values exist that can satisfy the conditions, thus the mutant is provably equivalent. In general, detecting equivalent mutants, just like detecting infeasible paths, is an undecidable problem.

However, strategies.
Copyright © . All rights reserved.