Automated tests, explained simply
A test is a check written once that the machine repeats at every change. That is how we know a change broke nothing elsewhere.
In one image
Think of a pilot's checklist before take-off. It is written down, it is the same on every flight, and nobody takes off without going through it. Tests are that checklist, except that the computer goes through it, in seconds, at every change of the software.
What to remember
-
Written from what you asked for
Each requirement becomes a check: “a confirmed order creates its delivery”. If that stops being true one day, the check says so, before anyone complains.
-
A bug, a check first
Before fixing a defect, the check that catches it is written. Once fixed, the defect can no longer come back unseen.
-
A check that cannot fail is useless
A check is never bent to make it pass: if it is red, the software gets fixed. A check always green, whatever happens, is a defect.
-
Repeated at every change, read by someone else
A server runs all the checks again at every push of code. And before a change goes in, someone who did not write it reads it.
An example: a reported bug
Four steps, always in this order.
-
Catch it
A check reproduces the defect, as you described it.
-
It is red
The proof that the check does see the defect.
-
Fix
The software changes, the check turns green.
-
It stays green
The check is run again at every change: the defect does not come back unseen.
To go further
-
Automated tests, explained to developers
The rules, a bug taken in four steps and a ten-line test, for whoever starts out with Odoo.
A question?
I answer the curious too: write to me.