Boss lesson · Unit 04
Never again
Turn a bug report into a test, and let every push run it
What you practise
- A bug report becomes a failing test, then a fix, then a guard
- Continuous integration runs everything on every push
- Reading a red build
- Refactoring safely under tests
Try a question from this lesson
Pick one
This bug report lands on your desk. What is the first thing you write?
Bug #212: empty cart, negative total
Steps:
1. Open an empty cart
2. Apply coupon SAVE5 (5.00 off)
Expected: total 0.00
Actual: total -5.00Correct answer
A test: empty cart, coupon of 5, expect a total of 0
Why
A good report already has the shape of a test: steps, expected, actual. Writing the test first proves you can reproduce the bug, and gives you an exact way to know when it is fixed.
The idea
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Continuous integration
A test suite only protects you when it runs. Continuous integration (CI) is a server that runs the checks on every push: lint, type check, tests. Nobody has to remember.
A green build means every promise the suite makes still holds. A red build means the newest change broke one, and the log says which.
The rule that makes it work: nothing is merged while the build is red.
11 more exercises in the app
- 2× type the answer
- 1× order the lines
- 1× fill the blanks
- 5× multiple choice
- 1× true or false
- 1× match the pairs
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.