# Mutation-core: A mutation testing tool for Bitcoin Core

**URL:** <https://delvingbitcoin.org/t/mutation-core-a-mutation-testing-tool-for-bitcoin-core/1119>\
**Category:** Implementation\
**Tags:** bitcoin-core\
**Created:** [September 6, 2024, 7:43pm UTC](https://delvingbitcoin.org/t/mutation-core-a-mutation-testing-tool-for-bitcoin-core/1119 "2024-09-06T19:43:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/bruno/32/60_2.png) [@bruno](https://delvingbitcoin.org/u/bruno)\
**Post date:** [September 6, 2024, 7:43pm UTC](https://delvingbitcoin.org/t/mutation-core-a-mutation-testing-tool-for-bitcoin-core/1119/1 "2024-09-06T19:43:09Z")

</div>

Hi,

I’ve been working on a mutation testing tool for Bitcoin Core. It’s something I’ve been using it for some time now and just made it public recently.

> **[GitHub - brunoerg/mutation-core: Mutation testing tool designed for Bitcoin Core](https://github.com/brunoerg/mutation-core)**
>
> Mutation testing tool designed for Bitcoin Core

## Features

- Allows generating mutants only for the code touched or added in a specific branch (useful to test PRs) and avoid spending time by generating mutants for files from bench/test/doc/etc folders.

- Allows generating mutants using only some security-based mutation operators. This might be good for testing fuzzing.

- Avoids creating useless mutants. (e.g. by skipping comments, `LogPrintf` statements, etc).

- Allows generating only one mutant per line of code (might be useful for CI/CD). It reduces the total number of mutants significantly.

- Allows creating mutations in the functional tests. By removing some statements and method calls, we can check whether the test passes and identify buggy tests. In our case, we will not touch any `wait_for`, `wait_until`, `send_and_ping`, `assert_*` and other verifications.

…and, of course, there are some specific mutation operators designed for Bitcoin Core.

* * *

For more informations, please see the README in the repository. Feedbacks are welcome! 🙂

---

<div class="post-metadata">

**Author:** ![0xB10C](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/0xb10c/32/15_2.png) [@0xB10C](https://delvingbitcoin.org/u/0xB10C)\
**Post date:** [September 12, 2024, 8:51am UTC](https://delvingbitcoin.org/t/mutation-core-a-mutation-testing-tool-for-bitcoin-core/1119/2 "2024-09-12T08:51:38Z")

</div>

Cool!

I was wondering how this compares to the mutation testing done by [https://corecheck.dev](https://corecheck.dev)?

---

<div class="post-metadata">

**Author:** ![bruno](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/bruno/32/60_2.png) [@bruno](https://delvingbitcoin.org/u/bruno)\
**Post date:** [September 12, 2024, 7:06pm UTC](https://delvingbitcoin.org/t/mutation-core-a-mutation-testing-tool-for-bitcoin-core/1119/3 "2024-09-12T19:06:30Z")

</div>

Tbh, I’m not sure how corecheck works. I found [GitHub - corecheck/mutation-worker: Tests generated mutations of Bitcoin Core pull requests](https://github.com/corecheck/mutation-worker) and [GitHub - corecheck/chernobyl: Generate intelligent mutations by parsing the C++ AST](https://github.com/corecheck/chernobyl/) but they’are archived and haven’t been updated.
