Mutation test

Variation test is a structural test method for checking the efficiency or accuracy of the test procedure. This method is useful for checking the number of defects in the tested applications. It also helps to improve the adequacy of estimated or test suite.

Mutation test

Why it was named mutation test?

Variation test name is such as to create a mutant (small changes in the program) and the program code thereof is introduced. This strategy is also referred to as a fault-based testing methods, since the defect by introducing a single original program code to create the mutants.

Why the need for mutation detection?

Test coverage is considered an important factor in software testing. Variability tests help analyze whether a set of test strategies sufficient to ensure that products meet quality requirements. If we can not solve any problem, we can not guarantee that the system does not bug.

Variability in test, software code minor changes. After that, a set of test cases to check for mutations in the program. Good unit tests will be able to check for defects in the program code.

How mutation test ?

  1. Create mutants software - need to be introduced by a single defective mutant AUT to create the program. As many mutant QA testers can be introduced as needed. They also need to ensure that each mutant remain unique, and also different from the original system.

  2. Test preparation - problem QA team should be able to be able to identify mutants caused a way to make a test case.

  3. Test the original software - QA testers need to check the test case input and output software is the same as the expected results. Otherwise, we need to fix the problem, and the need to test the software until AUT no defects.

  4. Software Testing mutant - mutant software requires the same software as the original set of test cases for testing. If the output mutants software outputs the original software are different, the mutants need to be marked for death. It should not be tested again.

  5. Mutation score calculation - defined as the ratio of the count body and nonequivalent od dead mutants mutation. Mutation is an ideal score.

  6. Mutation score analysis - mutation rates directly related to the test efficiency. QA tester mutation test can be repeated until a satisfactory result.

Mutation test type:

Mutation detection can be broadly divided into three categories - the value of mutation, the mutation decisions and statements mutation.

Mutations in the value, or the value of the constant parameter is changed. For example, change to a larger or smaller value in the cycle in the initialized value changes.

Decision mutation - which helps to modify the program code to reflect the slide error. E.g.,> a Change <a.

Statement of variation - in such tests, the developers cut and paste code, which may result in the deletion of some line statement. This may also involve the exchange lines of code sequence. You can delete / copy one line of code. You can also change the order stated.

Mutation operator:

Applied to the original program to generate mutants mutation operator is called operator. Mutation operator can be roughly divided into

  1. Traditional mutation operator

  2. Class mutation operator

Traditional mutation operator:

The traditional mutation operator for procedural programming language development. Despite the application of these operators to generate a large number of mutants, but they may not be valid, because they tend to overlap. The following is the traditional mutation operator

  1. Arithmetic Operators

  2. Relational Operators

  3. Conditional operator

  4. Logical Operators

  5. Assignment operators

  6. Shift operator

By substitution, insertion or deletion mutation operator to generate mutants.

TRANSITION operator:

These mutants were tested for generating object-oriented and integration issues.

  1. Package - by applying the modification, deletion or insertion of instance variables and methods of the operator access level formed mutation.

  2. Inheritance - mutants generated by applying the operator, the operator removes hidden variables to check whether the variable is defined, and it is in classes and subclasses accessibility is correct.

  3. Polymorphism - whether the mutant polymorphism created by the operator, in order to check the parameters with the same name and number of ways to access the correct manner.

Variability testing tools:

There are several Mutation testing tool available. Jumble and Insure ++ is the most common.

confusion:

  1. Jumble is a simple non-graphical open source tools. It will convert the text file you can research file format versions.

  2. It runs directly at the source code level, and accelerate Mutation testing process. Mutation supported Jumble limited set of operators: conditions binary arithmetic, increment, inline constants, the constant pool of the class, and switch statements return value

Ensure ++:

  1. It is the C and C ++ commercial automated testing tool that uses Mutation analysis techniques.

  2. Insure ++ instead of generating all possible mutants, but concerned about the "potential equivalent mutant." Motivation behind this idea is that if any test cases to kill a "potential equivalent mutant", it may find errors in the original program

Variability testing challenges:

Variation tests can effectively evaluate the quality and sufficiency of the test set, but it also has certain challenges following

  1. Mutation assays with high computational cost of a large number of mutants for tests executed.

  2. Human oracle problem refers to the output of each test case is to check the output of the original program of the process, can be a serious problem, because the mutation test can lead to an increase in the number of test cases

Published an original article · won praise 0 · Views 426

Guess you like

Origin blog.csdn.net/qq_37983000/article/details/103191053