All Projects → RagnarDa → dumbmutate

RagnarDa / dumbmutate

Licence: MIT license
Simple mutation-testing

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to dumbmutate

Javascript Testing Best Practices
📗🌐 🚢 Comprehensive and exhaustive JavaScript & Node.js testing best practices (August 2021)
Stars: ✭ 13,976 (+43575%)
Mutual labels:  mutation-testing, unittest
Wasmite
Now WebAssembly has proper testing, unit-testing and debugging 🤗
Stars: ✭ 20 (-37.5%)
Mutual labels:  unit-testing, unittest
TestIt
Generate unit testing boilerplate from kotlin files.
Stars: ✭ 32 (+0%)
Mutual labels:  unit-testing, unittest
jest-puppe-shots
A Jest plugin for creating screenshots of React components with a little help of Puppeteer
Stars: ✭ 86 (+168.75%)
Mutual labels:  unit-testing, unittest
Nunit cshaprp cheatsheet
Example implementations of each attribute available in Nunit2 unit Testing Framework using C# .NET.
Stars: ✭ 14 (-56.25%)
Mutual labels:  unit-testing, unittest
vertigo
Mutation Testing for Ethereum Smart Contracts
Stars: ✭ 100 (+212.5%)
Mutual labels:  mutation-testing, mutations
unittest expander
A library that provides flexible and easy-to-use tools to parameterize Python unit tests, especially those based on unittest.TestCase.
Stars: ✭ 12 (-62.5%)
Mutual labels:  unit-testing, unittest
universalmutator
Regexp based tool for mutating generic source code across numerous languages
Stars: ✭ 105 (+228.13%)
Mutual labels:  mutation-testing, mutations
Capture Stream
Capture stream output.
Stars: ✭ 10 (-68.75%)
Mutual labels:  unit-testing, unittest
Bash unit
bash unit testing enterprise edition framework for professionals
Stars: ✭ 419 (+1209.38%)
Mutual labels:  unit-testing, unittest
specdris
A test framework for Idris
Stars: ✭ 55 (+71.88%)
Mutual labels:  unit-testing, unittest
Stryker4s
Mutation testing for Scala. Work in progress...
Stars: ✭ 118 (+268.75%)
Mutual labels:  unit-testing, mutation-testing
Unit Threaded
Advanced unit test framework for D
Stars: ✭ 100 (+212.5%)
Mutual labels:  unit-testing, unittest
Kotlinmvparchitecture
Clean MVP Architecture with Dagger2 + Retrofit2 + Mockito + Fresco + EasiestGenericRecyclerAdapter using Kotlin. Added Unit Tests(Kotlin Tests)!
Stars: ✭ 143 (+346.88%)
Mutual labels:  unit-testing, unittest
hypseus-singe
Hypseus is a SDL2 version of Daphne and Singe. Laserdisc game emulation.
Stars: ✭ 86 (+168.75%)
Mutual labels:  macosx
Faultify
Byte Code Dotnet Mutation Utility
Stars: ✭ 16 (-50%)
Mutual labels:  mutation-testing
FineCodeCoverage
Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
Stars: ✭ 391 (+1121.88%)
Mutual labels:  unittest
Guise
An elegant, flexible, type-safe dependency resolution framework for Swift
Stars: ✭ 53 (+65.63%)
Mutual labels:  unit-testing
toster
DSL framework for testing Android apps
Stars: ✭ 31 (-3.12%)
Mutual labels:  unit-testing
tau
A Micro (1k lines of code) Unit Test Framework for C/C++
Stars: ✭ 121 (+278.13%)
Mutual labels:  unit-testing

What is mutation testing?

Mutation testing is a way to test your automated tests. Imagine you have a unit-test or integration-test that 100% covers your code. Can you be sure your test actually would catch errors in your code? Mutation testing goes through your code and changes it slightly, like changing an operator (== into = for example), or a number (5 into a 0 for example). It then builds your code and tests it, hoping that your tests will fail (mutation killed). If the test passes the mutation is said to have survived, and the line is marked. For more explanation see Wikipedia: https://en.wikipedia.org/wiki/Mutation_testing

About dumbmutate

This is an as simple as possible implementation of this technique. There is no setup and no dependencies. Just download the binary and run it from the command-line. Works with any unit-testing framework (GoogleTest, Catch2, boosttest etc), or even without a complete framework as long as your code return a non-zero value when it fails. It is geared towards C-style languages but might work with other ones too.

Features:

  • Only command-line options needed, so could be part of a buildsystem for example. Has a threshold option to return error-code when mutations killed falls below a specified percentage.
  • Exports HTML line-by-line report and also surviving mutations to terminal, so you can go-to-code directly in your IDE.
  • Gives progress updates while running, so you can tell how long left to finish the file (in minutes).
  • Ability to mutate only part of file, i e from line 10 to line 20.
  • Only dependencies for building is CMake and a C++11 compatible compiler. No dependencies for the actual tool.

Simple example:

dumbmutate --mutate=FileToMutate.cpp --build=make --test=./test

Results will be shown both in terminal and in MutationResult.html

Demo (using doctest)

How to build dumbmutate:

cmake ./
make

Mutate specific part:

Mutate specific lines of FileToTest.cpp, line 10 to 20:

dumbmutate --mutate=FileToTest.cpp --build="make" --test="./test" --start=10 --end=20

Add threshold for percentage of killed mutations

Useful for example in a CI-solution where you could make dumbmutate return an error when the ratio of killed mutations vs survived falls below a set percentage. This example sets 80% as threshold and will return 0 when mutation-killratio is above this percentage.

dumbmutate --mutate=FileToTest.cpp --build="make" --test="./test" --threshold=80
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].