QA Tutorials

MUTATION TESTING

PART 2

MUTATION TESTING

Following steps are used to execute mutation testing:

CLICK HERE TO READ FIRST PART

  1. Faults are introduced to the actual source code in program called mutants by creating different versions of the program each mutant should contain a single fault and the goal is to fail these mutant versions
  2. Test cases are applied to both original and mutant program, it should be adequate to find the defect or fault in the program.
  3. Comparing the results of both original and mutant program.
  4. If the original and mutant program’s results are different then the mutant is killed.
  5. If both the program generate same output then the mutant is kept alive. In these cases more effective test cases need to be created to kill mutants.

The advantages of Mutation testing

  1. It is powerful way to reach the high coverage of the source program.
  2. This testing is capable of testing the mutant program also.
  3. This testing brings a good level of error detection to the software developer. Those faults can be identified which have missed from the developer’s attention.
  4. This testing has the capacity to detect all the faults in the program and removes all the ambiguities in the source code.
  5. Customers are benefited by getting the most reliable and stable system by this testing.

The disadvantages of the Mutation Testing

  1. Mutation testing is very expensive and time consuming as there are mutant programs to be created and tested with the original program.
  2. Testing cannot be done without an automation tool.
  3. Each mutant program will have the same number of test cases as the original program has which makes the tester to test large number to mutant programs.
  4. It is not well suited for black box testing.

Questions

  1. What is Mutation Testing?
  2. Explain some examples of mutation testing?
  3. What are the characteristics of mutation testing?
  4. What is the difference between mutation testing and Happy testing?
Facebook Comments
Tags

Related Articles

4 thoughts on “MUTATION TESTING”

  1. What is Mutation Testing?
    Mutation Testing is a type of testing technique where a certain change in the source code statement is made to check whether the test cases are able to find the error.Happy Testing is a procedure where the test users the known input and executes without any exception and produce expected output .

    Characteristics of mutation testing :
    -It is used to find a special new kind of errors and drags developer’s attention.
    -It is most effective way to find the hidden defects in a program which is difficult to identify, by the developer.
    What is the difference between mutation testing and Happy testing?
    Mutation testing is nothing but a small change in syntactic code of original program
    statement.
    — Happy testing is a procedure where the test uses the known input and executes
    without any exception and produce expected output.
    -Increased customer satisfaction index as product would cause less bugs
    Debugging and maintaining is easy.

  2. Mutation testing is a type of testing technique where a certain change in the source code statements is made to check whether the cases are able to find the error. It is a type of white box testing which is used for unit testing

    Example of Mutant testing:
    Original program
    If(x>y)
    Print “Correct”
    Else
    Print “Incorrect”

    Mutant program
    If(x<y)
    Print "Correct"
    Else
    Print "This is wrong",

    Characteristics of Mutation testing
    -It is the most effective way to find the hidden defects in a program which is difficult to identify by the developer
    -It finds new kinds of errors and drags developers attention.
    -This testing has the capacity to detect all the faults in the program and removes all the ambiguities in the source code
    -Customer are benefitted by getting the most reliable and stable system by this testing

    Difference between Mutation testing and Happy testing
    Mutation testing is a type of software testing where we mutate certain statements in the source code and check if the test cases are able to find the errors. Happy testing is a well-defined test case using known input which executes without exception and produces an expected output.

  3. 1. Mutation testing :
    Mutation testing is a type of testing technique where a certain change in the source code statements is made to check
    whether the test cases are able to find the error. It is a type of white box testing which is used for unit testing. The goal or
    purpose of this testing is to check the quality of test cases which is robust enough to fail the mutant code. It is also called as
    fault based testing.
    2. Examples of Mutation Testing:
    There are three types of Mutation Testing:
    a. Statement mutation: In this type some part of source code is cut and pasted by the developer.
    b.Value mutation: In this type we generally change one value to much larger value or one value to much smaller value.
    c. Decision mutation: Control statements which are used for decision making are to be changed.
    Examples:
    Original mutant program:
    if(x>y)
    print “x-y=2″;
    else
    print”y is non zero”;
    Mutant Program:
    if(x+y=10)
    print “x-y=2″;
    else
    print”y is less than zero”;

    3. Characteristics of Mitation Testing:
    – It is used to find a special new kind of errors and drags developer’s attention
    – It is most effective way to find the hidden defects in a program which is difficult to identify, by the developer.
    – Increased customer satisfaction index as product would cause less bugs
    – Debugging and maintaining is easy.
    4. Difference between Mutation testing and Happy testing:
    Mutation Testing:
    – In mutation testing some changes are made in the source code statement to check the test cases are able to find the error.
    – This is a white box testing used in unit testing.
    Happy Testing:
    – In this type of testing the test uses the known input and executes without any exception and produce expected output. The
    happy path user will understand clearly.
    – This is a black box testing used in system testing.

  4. 1) Mutation testing is a type of testing technique where a certain change in the source code statements is made to check whether the test cases are able to find the error. It is a type of white box testing which is used for unit testing. The goal or purpose of this testing is to check the quality of test cases which is robust enough to fail the mutant code. It is also called as fault based testing.

    2)Original Program Mutant Program
    If (X>Y) If (Y>X)
    Print “X = 1” Print “X=1”
    Else Else
    Print “X = 0” Print “X=0”

    3)The characteristics of mutation testing are
    It is used to find a special new kind of errors and drags developer’s attention
    It is most effective way to find the hidden defects in a program which is difficult to identify, by the developer.
    Increased customer satisfaction index as product would cause less bugs
    Debugging and maintaining is easy.

    4) Difference between Mutation testing and Happy testing:
    In mutation testing some changes are made in the source code statement to check the test cases are able to find the error. In happy testing the test uses the known input and executes without any exception and produce expected output.
    Mutation testing is a white box testing used in unit testing.
    Happy Testing is a black box testing used in system testing.

    5)

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Close
Close