How CI/CD works: why releasing code every day is safer than once a month
Automated tests: how software checks itself after every change
A developer can check by hand that an app still works once or twice a day. A small program can check it hundreds of times in a few seconds. What an automated test really is, and what it can never prove.
-
1
To make sure the double booking of release day never comes back, you could open the app, book machine 3, and try to book it a second time. It takes a few minutes, after every merge, forever.
-
2
So you write a few lines of code that do it for you. They book machine 3, try to book it again, and check that the app says no. This is an automated test.
-
3
When the app refuses the second booking, the test passes. If a change ever brings the bug back, the test fails and says which check went wrong.
-
4
The team writes a test for each thing the app must do: book, cancel, pay, send the message. Hundreds of them run in a few seconds. Each one checks only the thing it was written for.
-
5
There is a catch. The tests run only when someone runs them on their laptop, and on Friday, Rono was in a hurry and forgot.
-
Quick check
A change to the price.
Show the answer
No. That test only checks that a second booking is refused. A bug in the price needs a test that checks the price.
-
Go further
More about tests.