Skip to content
DevMeme
3897 of 7435
Unit Tests Across The Bell Curve
Testing Post #4243, on Feb 22, 2022 in TG

Unit Tests Across The Bell Curve

Why is this Testing meme funny?

Level 1: Same Choice, Different Reasons

Imagine two people do not wear a raincoat. One forgot it and gets soaked. The other checked the weather, saw the sky was clear, and left it at home on purpose. From far away they look the same, but the reasons are different. This meme jokes that beginners and supposed experts may both have no unit tests, while everyone in the middle writes lots of them.

Level 2: Tests And Stereotypes

Unit tests are automated checks for small pieces of code, usually functions, methods, or classes. They help developers catch mistakes quickly after making changes.

Test coverage describes how much of the code is exercised by tests. More coverage can be useful, but coverage alone does not prove the tests are valuable. A test can execute code without checking the right thing.

The left side of the image shows lots of actual code and no unit tests. That suggests a beginner or careless approach: build the feature, skip the safety net.

The middle shows a smaller amount of code and a large block of unit tests. That suggests a team that cares heavily about testing, perhaps even more than the code itself.

The right side again shows lots of code and no unit tests. In the bell-curve meme format, the right side usually represents someone who has reached a strange, confident version of the same behavior as the left side. Here, that means an expert who claims unit tests are unnecessary for this situation.

For a junior developer, the useful lesson is not "tests bad" or "tests always good." The lesson is that testing decisions need reasons. Skipping tests because you forgot is different from choosing a different kind of test because it gives better confidence.

Level 3: Confidence Horseshoe

The meme places three pairs of panels along a bell curve. Each pair is labeled:

ACTUAL CODE UNIT TESTS

On the left side, ACTUAL CODE is filled and UNIT TESTS is empty. At the top middle, ACTUAL CODE is small and UNIT TESTS is densely filled. On the right side, ACTUAL CODE is filled again and UNIT TESTS is empty again. The curve also shows familiar bell-curve percentages like 34%, 14%, 2%, and 0.1%, with an IQ-style scale running underneath.

The joke is a testing-culture horseshoe. The beginner stereotype skips unit tests because they do not yet understand how much future pain they are buying. The middle stereotype writes lots of tests because they have learned that untested code breaks, regressions are expensive, and quality assurance exists for a reason. The far-right "genius" stereotype also skips unit tests, but with enough confidence to make it sound like architecture.

That last part is where the cynicism lives. Senior engineers sometimes do have valid reasons not to write conventional unit tests for every line: the code might be throwaway, generated, better covered by integration tests, constrained by a strong type system, or dominated by external behavior that unit tests would mock into fiction. But the meme is not a testing strategy document. It is making fun of how the same outward behavior, "no unit tests," can come from ignorance or from a very polished justification deck.

The top-middle panel is also a jab at process-heavy teams. There is only a tiny amount of actual code, but the tests panel is packed. That can represent healthy discipline, or it can represent testing theater: brittle tests, duplicated assertions, mocks that only prove the implementation calls itself, and coverage targets treated as religious artifacts. A test suite can be large and still not protect the behavior users care about. Congratulations, the dashboard is green and the checkout flow is still broken.

The serious reading is that software quality is not measured by the visual ratio of tests to code. An empty unit-test panel is suspicious, but a full one is not automatically virtuous. The question is whether the tests create fast, meaningful feedback about important behavior. The bell curve makes that nuance ridiculous on purpose, because developer communities love turning hard judgment calls into smug little diagrams.

Description

The image is a bell-curve meme about the relationship between actual code and unit tests. Along the curve are three small paired panels labeled "ACTUAL CODE" and "UNIT TESTS": the left low-IQ side shows lots of code and an empty tests panel, the middle shows little actual code and a large filled tests panel, and the right high-IQ side again shows lots of code with an empty tests panel. The blue curve includes visible percentage labels such as 34%, 14%, 2%, and 0.1%, with an IQ-like scale running from 55 through 145. The joke is a cynical testing take: beginners skip tests out of ignorance, process-heavy teams may drown in tests, and the supposed genius archetype skips them with enough confidence to make it sound intentional.

Comments

24
Anonymous ★ Top Pick Both tails ship without tests; only the right tail has a slide deck calling it risk acceptance.
  1. Anonymous ★ Top Pick

    Both tails ship without tests; only the right tail has a slide deck calling it risk acceptance.

  2. @sylfn 4y

    change 145iq to both empty

    1. @briskovic 4y

      or what

      1. @sylfn 4y

        or nothing

  3. @CcxCZ 4y

    Left: Lots of tests. Middle: Formal proofs of correctness. Right: "Beware of bugs in the above code; I have only proved it correct, not tried it."

  4. @CVABIK 4y

    I’m using this approach

    1. @atrens 4y

      You also can try this:

      1. @sylfn 4y

        this is what i have talked about

        1. @sylfn 4y

          * if grammar is wrong ignore

      2. @CVABIK 4y

        I tried that too but my boss said it is not the best practice…

        1. @sylfn 4y

          your boss just konws nothig about bestest practices

      3. @sylfn 4y

        300iq mode

      4. @dugeru42 4y

        no tests bcause no bugs

      5. dev_meme 4y

        just perfect

  5. @sylfn 4y

    https://test.mensa.no/ test your iq

  6. @sylfn 4y

    0.2 + 2 + 14 + 34 + 34 + 14 + 2 + 0.2 = 2*(34+14+2+0.2) = 2*(48+2.2) = 2*50.2 = 100.4

    1. @sylfn 4y

      why do percentages sum to >100?

    2. @alihesami 4y

      0.1*

      1. @sylfn 4y

        doesnt change that much

        1. @alihesami 4y

          yup🙄

  7. @neekoisthebestdecision 4y

    I don't write unit tests, I only use integration and e2e tests. Unit tests are useless waste of time in 99% cases

  8. @neekoisthebestdecision 4y

    iq 120 btw

  9. @CcxCZ 4y

    Buuuuut it'd mean having to actually fix the bugs found.

    1. @affirvega 4y

      ... what if there is a bug in unit tests

Use J and K for navigation