# How to create a minimal complete reproducible example

**URL:** <https://forum.access-hive.org.au/t/how-to-create-a-minimal-complete-reproducible-example/843>\
**Category:** General\
**Tags:** knowledge-base, how-to, mcre\
**Created:** [13 June 2023 00:10 UTC](https://forum.access-hive.org.au/t/how-to-create-a-minimal-complete-reproducible-example/843 "2023-06-13T00:10:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aidan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/aidan/32/42_2.png) [@Aidan](https://forum.access-hive.org.au/u/Aidan)\
**Post date:** [13 June 2023 00:10 UTC](https://forum.access-hive.org.au/t/how-to-create-a-minimal-complete-reproducible-example/843/1 "2023-06-13T00:10:44Z")

</div>

## About

Creating a [minimal complete reproducible example (MCRE)](https://en.wikipedia.org/wiki/Minimal_reproducible_example) of a code issue.

(Also known as a minimal reproducible example (MRE), minimal working example (MWE), minimal verifiable example (MVE) and minimal complete verifiable example (MCVE))

## Who is this for?

Anyone who is asking for help with a coding issue.

## Why bother creating an MCRE?

1. It makes it easier for anyone who is trying to assist. It is in your best interests to do this as it makes it more likely people will help you.

2. It clarifies the problem for yourself. It can make it clearer where the problem lies which can sometimes lead you to a solution without needing to request help.

3. It is polite. You’re asking for others to take time out from their work to assist with yours. The least you can do is make that as easy as possible for them.

## Resources

There are some excellent resources to assist with creating an MCRE:

- Stackoverflow has guidelines for creating a minimal complete reproducible example

> **[How to create a Minimal, Reproducible Example - Help Center](https://stackoverflow.com/help/minimal-reproducible-example)**
>
> Stack Overflow | The World’s Largest Online Community for Developers

- Matthew Rocklin (principal author of [dask](https://www.dask.org) the engine behind parallelisation in [xarray](https://xarray.pydata.org)) has written an excellent guide to writing effective minimal bug reports with example python code:

> **[Craft Minimal Bug Reports](https://matthewrocklin.com/minimal-bug-reports)**
>
> Following up on a post on supporting users in open source this post lists some suggestions on how to ask a maintainer to help you with a problem. You don’t have to follow these suggestions. They ar...

- The scikit-learn documentation includes information on python utilities for creating synthetic test data sets as well as scikit-learn specific utilities:

> **[Crafting a minimal reproducer for scikit-learn](https://scikit-learn.org/stable/developers/minimal_reproducer.html)**
>
> Whether submitting a bug report, designing a suite of tests, or simply posting a question in the discussions, being able to craft minimal, reproducible examples (or minimal, workable examples) is t...

## Summary

Please do read the above resources, but the TL;DR summary for creating an MCRE:

1. Ensure it includes the failing test case
2. Demonstrate the steps necessary to reproduce the bug
3. Be as simple as possible, including using smallest possible generic data sample
4. Clearly describe the expected result of the test case, and what should happen when the code is executed
5. Verify the bug by running the test case and observing the actual results
6. Describe what actually happened when the code was executed, and how it deviates from the expected result
7. Provide any necessary context, such as the environment in which the code is running, or any other relevant information that may help to understand the bug, including full error messages/stack traces
