HomeChallengesRepsProblemsLeaderboardTake a challenge

Your first real test

One assertion is not a test suite. Prove it.

Beginner10 min on the clock4 graded checks · 100 pointsTests That Catch Bugs
Graded by running your code against real cases.

What you build

  • Assert that add returns the right answer for one pair of numbers
  • Add a second pair with a DIFFERENT answer
  • Check that both arguments are actually used
  • Include a zero and a negative number

Done means

Your suite passes a correct add and fails four broken ones.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.

  1. It catches a function that always returns 5+30What a test actually is
  2. It catches multiplication pretending to be addition+25What a test actually is
  3. It catches a function that ignores the second argument+25What a test actually is
  4. It catches subtraction+20What a test actually is

What it teaches

The rest of Tests That Catch Bugs