SSCCE, MWE and MCVE are basically the same: provide code people can use to reproduce a problem
Posted by jpluimers on 2019/10/16
Many times I see people asking questions about problems in their source code, it goes like this:
- Question is asked formulating the problem, but without any source code
- A comment asks for source code
- Either the response is “the source code is too big”, or the response contains a really big blob of (compressed) code that
If you have such questions (I still often have them), then you need to do just two things (which you often can combine in one step):
- Condense down the code into a small bit that others can use to reproduce the problem.
- Talk to an (imaginary) person explaining the problem you have and the condensed code.
The second is called Rubber Ducking after a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck.
The first is known under at least three terms:
- [WayBack] Short, Self Contained, Correct (Compilable), Example
SSCCE
: Long but very explanatory summarised by”Describes the short, self contained, correct example. A useful technique for debugging.” - [WayBack] Minimal Working Example
MWE
: Short but not very descriptive, but has some good links to background material - [WayBack] How to create a Minimal, Complete, and Verifiable example
MCVE
: good mix between the two; long enough but still readable
They all come down to the following:
Provide a small piece of working code that is readable anyone can use to reproduce a problem without much effort.
via: Can we create a Help Center topic that outlines what a SSCCE / MWE means for Stack Overflow?
–jeroen
Leave a Reply