Skip to content

Executable Bug Report

You'll turn a real bug into a test that fails in the project's own suite, send it upstream without a fix, and watch a maintainer use it.

About

A bug report in prose is good. A bug report that runs is better, because the maintainer can execute it, see red, and start fixing instead of reproducing. Writing one means building the project, finding its test suite, matching the way its tests are written, and sending a pull request that contains only the failing test. Plenty of projects ask for exactly this, and the ones that won't merge a red test will still use it in their fix. What counts is a test that fails on main because of a real bug, written in the project's own style, sent upstream and acknowledged. What doesn't count is a test for a bug you made up, or a script that only runs on your laptop.

At a glance

Per requirement
25 XP
Completion bonus
150 XP
Requirements
6
Takes
One weekend, plus the wait
Skill level
Intermediate (months of practice)
Cost
Free
Supplies
Nothing special
Where
At home
Other people
With other people
Locked for now
Earn two more Common badges in Open Source & Community to open this one. Log in to see how far along you are.

Requirements

  1. 1
    Pick a confirmed open bug in a project you use that has no test and no linked PR yet. Look for issues labeled confirmed or bug with clear steps, and check that nobody has a fix in flight. One you reported yourself is fine. Read the CONTRIBUTING file for how they want test cases, because some projects have a page on exactly this. Take a screenshot of the issue. Photo
  2. 2
    Build the project and run its full test suite green before you touch anything. Follow the docs for the test command and note how long it takes, and if the whole suite takes an hour, learn how to run one file. If tests already fail on a clean checkout, write down which ones so nobody blames you for them later. Take a screenshot of the passing run with the test count. Photo
  3. 3
    Find the test file that covers the broken feature and read ten of its tests. Match the shape: how they name tests, how they build fixtures, which assertion helpers they use, and where sample data lives. Your test should look like it was always there. Take a screenshot of the file with the tests you're copying the style from. Photo
  4. 4
    Write one test that fails on main because of the bug, and only because of the bug. Keep it under 30 lines and name it after the issue number or the behavior. Assert the correct behavior rather than the broken one, so the test passes the moment the bug is fixed. If the project uses expected-failure markers, ask before using one. Film the test going red, or take a screenshot of the failure output with the assertion visible. Photo or video
  5. 5
    Send a pull request that contains only the test, linked to the issue. Title it like 'Add failing test for #123' and say in two sentences what the test shows and that you haven't fixed it. If you can see the fix too, save it, because that's the Upstream Fix badge and this one stays pure. Take a screenshot of the open PR. Photo
  6. 6
    Get it merged, folded into the fix, or answered, and write down what their suite taught you. Some projects merge red tests under a skip marker, some pull your test into their own fix and credit you, and some just say thanks and use it. All three count. Write three lines on how their test suite differs from how you'd have done it. Take a screenshot of the maintainer's reply or the fix that includes your test. Photo