Coder Social home page Coder Social logo

metamutator's Introduction

metamutator: a meta-mutation tool for Java

Build Status

mvn test

In the context of this project, a metaprogram is a program with all mutations inserted at compile-time. However, the mutations are all desactivated by default, meaning that the metaprogram behaves as the original one. Mutations can be activated and desactivated one by one at runtime.

Mutation operators

  • Logical comparison (switch between ">", ">=", "!=", etc) (LogicalExpressionMetaMutator).
  • Breaks the loops (no iteration, at 3 iterations, at 100 iterations) (LoopExpressionMetaMutator)
  • Adds unary operators to numeric values (absolute value, minus, increment (++), decrement (--)) (NumericVariableMetaMutator)
  • Sets variables to null at their declaration (VariabletoNullMetaMutator)
  • Replaces integer constants by 0, INT_MAX (IntegerConstantReplacementMetaMutator)
  • Metamutates return statements that returns Boolean (ReturnReplacementOperatorMetaMutator)
  • Skips statements (statement deletion operator) (StatementDeletionMetaMutator)

Usage

Let's assume your project is called foo and contains two folders src/main/java and src/test/java with a test class PgmTest.

  1. Create the metaprogram

    java -jar spoon.jar -i src/main/java -p metamutator.LogicalExpressionMetaMutator -o spooned

  2. Compile the metaprogram

    javac find spooned -name "*.java"

  3. Run the test class (with the metaprogram in the classpath and not the original program)

    MutantSearchSpaceExplorator.runMetaProgramWith(PgmTest.class)

Credits

Based on awesome code by Carlos Fau and Alejandro Russel (https://github.com/totemcaf/code-fixer/)

Great contributions from University of Lille's students enrolled in IAGL 2015-2016.

metamutator's People

Contributors

abdelrhamaneben avatar dufaux avatar mensobscura avatar monperrus avatar sahraoui62 avatar sofianekabylino avatar tverbaere avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.