MUTATION TESTING 1

Table of Contents

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.

Types of mutation testing:

  1. Statement mutation: Some part of source code is cut and pasted by the developer, that is changes are done by deleting or duplicating the line, which may be to find fault.
  1. Value mutation: Primary parameter values are modified. We usually change one value to much larger value or one value to much smaller value.
  1. Decision mutation: Control statements which are used for decision making are to be changed. The conditions are checked for design errors. For example: one change in arithmetic operators to locate the defects and also consider mutating the relational operators and logical operators.

How mutant program is created

A mutation is nothing but a small change in syntactic code of original program statement.

Original program

If(x>y)

Print “Hello”;

Else

Print “Hi”;

Mutant program

If(x<y)

Print “Hello”;

Else

Print “How are you”;

Mutation testing benefits:

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

How to do mutation testing

 

MUTATION TESTING
MUTATION TESTING

 

CLICK HERE TO CONTINUE READING…

10 Responses

  1. Mutation testing: A mutation is nothing but a small change in the syntactic code of the original program statement.
    A technique to check if the test cases are able to find the hidden errors when the changes
    happen in the code. 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.
    Types of mutation testing:
    Statement mutation:
    Some part of source code is cut and pasted by the developer, that is changes are done by deleting
    or duplicating the line, which may be to find fault.
    Value mutation:
    values of primary parameters are modified.
    Decision mutation:
    control statements are to be changed. The conditions are checked for design errors.
    For example one change in arithmetic operators to locate the defects
    and also consider mutating the relational operators and logical operators.

  2. Mutation testing is to apply where the source code is altered/mutated and the to make sure the test cases doesnt fail to find out the errors. It is part of the white box testing done by developers to avoid hidden errors to give a quality product to the customer.
    Types :
    Statement mutation
    Value mutation
    Decision mutation

  3. A mutation is nothing but a small change in syntactic code of original program statement. 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.
    Types of mutation testing:
    Statement mutation: Some part of source code is cut and pasted by the developer, that is changes are done by deleting or duplicating the line, which may be to find fault.
    Value mutation: Primary parameter values are modified. We usually change one value to much larger value or one value to much smaller value.
    Decision mutation: Control statements which are used for decision making are to be changed.

    Original program
    If(x>y)
    Print “Hello”;
    Else
    Print “Hi”;
    Mutant program
    If(x<y)
    Print “Hello”;
    Else
    Print “How are you”;
    Mutation testing benefits:
    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. Mutation Testing is a type of software testing where we mutate (change) certain
    statements in the source code and check if the test cases are able to find the errors.
    It is a type of White Box Testing which is mainly used for Unit Testing.

    Explain some examples of mutation testing?
    Original program
    If(x>y)
    Print “Hello”;
    Else
    Print “Hi”;

    Mutant program
    If(x<y)
    Print “Hello”;
    Else
    Print “How are you”;

    What are the characteristics of mutation testing?
    It finds a special new kind of errors and drags developer’s attention
    Finds 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.

    What is the difference between mutation testing and Happy testing?
    Mutation Testing we mutate (change) certain statements in the source code and
    check if the test cases are able to find the errors.whereas in
    Happy testing is where the test uses the known input and executes without
    any exception and produce expected output.

  5. Mutation testing is a structural testing technique, which uses the structure of the code to guide the testing process. On a very high level, it is the process of rewriting the source code in small ways in order to remove the redundancies in the source code. These ambiguities might cause failures in the software if not fixed and can easily pass through testing phase undetected.

  6. 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. It is a type of white box testing.
    Example of Mutation testing
    Original program
    If(x>y)
    Print “Hello”;
    Else
    Print “Hi”;

    Mutant program
    If(x<y)
    Print “Hello”;
    Else
    Print “How are you”;
    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

  7. 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 also called as fault based testing.

    2. Explain some examples of mutation testing?
    Example of Mutation testing:
    If(x>y)

    Print “Hello”;

    Else

    Print “Hi”;

    Mutant program

    If(x<y)

    Print “Hello”;

    Else

    Print “How are you”;
    The outputs are compared if the output generated are same then mutant is killed.

  8. Mutation testing is to apply where the source code is altered/mutated and the to make sure the test cases doesn’t fail to find out the errors. It is part of the white box testing done by developers to avoid hidden errors to give a quality product to the customer.
    Types :
    Statement mutation, Value mutation and Decision mutation.

  9. Mutation Testing:
    It is a type of white box testing used for unit testing to check the quality of test cases also called fault based testing
    Three types of mutation:
    Statement (source code is cut and paste by the developer) Value Mutation (parameter values are modified) Decision testing (used for decision making)
    Characteristics:
    Mutation Program is a small change in synthetic code has benefits to find the hidden defects in the program increase customer satisfaction and debugging.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share this article
Subscribe
By pressing the Subscribe button, you confirm that you have read our Privacy Policy.
Need a Free Demo Class?
Join H2K Infosys IT Online Training
Enroll Free demo class