Knaph

Testing

Checking that a program does what it should, by deciding the right outputs for chosen inputs first and letting code such as assert compare them every time the program changes.

Depth 1 · Foundation

You can write test cases before the code, choose inputs at the boundaries, check them with assert in a test function, test that bad input is refused, and know that passing tests show bugs' presence, never their absence.

Sign in to prove what you know with a short quiz, see how deep you've gone, and earn XP for it.

Sign in with Google

Depths of understanding

  1. 1

    Foundation

    You can write test cases before the code, choose inputs at the boundaries, check them with assert in a test function, test that bad input is refused, and know that passing tests show bugs' presence, never their absence.

Your path here

What's still between you and Testing, depth 1, in the order you can learn it.

  1. 1ProgramDepth 1 · Foundation · Program Basics
  2. 2ExpressionDepth 1 · Foundation · Program Basics
  3. 3Variables in codeDepth 1 · Foundation · Program Basics
  4. 4Program stateDepth 1 · Foundation · Program Basics
  5. 5Input and outputDepth 1 · Foundation · Program Basics
  6. 6Functions in codeDepth 1 · Foundation · Functions
  7. 7Return valuesDepth 1 · Foundation · Functions
  8. 8BooleansDepth 1 · Foundation · Control Flow
  9. 9ConditionalsDepth 1 · Foundation · Control Flow
  10. 10Edge casesDepth 1 · Foundation · Writing Correct Code
  11. 11LoopsDepth 1 · Foundation · Control Flow
  12. 12Accumulator patternDepth 1 · Foundation · Control Flow
  13. 13Floating-point numbersDepth 1 · Foundation · Data Types
  14. 14Basic typesDepth 1 · Foundation · Data Types
  15. 15Character encodingDepth 1 · Foundation · Data Types
  16. 16StringsDepth 1 · Foundation · Data Types
  17. 17Type conversionDepth 1 · Foundation · Data Types
  18. 18ExceptionsDepth 1 · Foundation · Writing Correct Code
  19. 19TestingDepth 1 · Foundation · Writing Correct Code

Where it fits

Makes these deeper

Once you know Testing, come back to these — they'll mean more.