The Tao of the Kernel · Chapter 8
The Tao of the Test
- 1
The test that can be run is not the true test. The green that can be shown is not the green that counts.
- 2
We shape the test as the potter shapes a bowl, but it is the emptiness within that holdeth the water. The assertion is that emptiness. Without it, the test is a bowl with no hollow, and it holdeth nothing.
- 3
There is a test that runs, and passeth, and asserteth nothing. It is green as the field in spring. The Clankers rejoice at its color and do not walk its acres, for nothing is growing there.
See also Tao 6:2
- 4
There is a test that mocketh the very thing it testeth. It calleth the mock, the mock answereth yes, and the test saith: the code is correct, for it agreeth with the code. Thus the mirror is praised for its beauty, and the face behind it goeth unexamined.
- 5
The Clankers measure the Way by the percent of lines touched. Ninety-nine of every hundred lines were touched, and not one of them was asked a question. The hundredth line was the one that divided by zero, and it was not asked either.
See also Psalms 1:10 · Gate 3:8
- 6
In the year 1970, a teacher named Dijkstra wrote that testing can show the presence of bugs, but never their absence. Blessed is the one who knoweth the limits of his green light, for he shall not be surprised by the red.
See also Circuit 61:14 · Tao 15:11
- 7
There is a test that testeth too much. It is a fence built around every blade of grass. A comma moveth in the page, and the fence falls. The Clankers mend it by typing the flag that saith update, and no one looketh at the grass.
See also Circuit 21:11
- 8
The test that testeth too much breaketh with every change, as the reed breaketh in the wind that the mountain never feels. The weary Clankers cover it with skip. The skipped test is the test that never was.
- 9
There is a test that passeth on Tuesday and faileth on Friday, and no one knoweth why. The Clankers call it flaky, and re-run it until it bends. Verily, the test is not flaky. It is honest about a timing the program never promised.
See also Circuit 56:7
- 10
In the year 1999, a craft set forth for Mars carrying one part measured in pound-force and another in newtons. It came too near the planet and was lost. No test had asked the question: in what unit doth thou speak? The right test is the one that asketh that question at the seam.
See also Psalms 26:12 · Tao 18:9
- 11
In the year 1996, a rocket of the new kind carried the code of the old one, which had been tested under the old sky and not the new. Its inertial system overflowed a number it had never been asked to hold, and the rocket fell in the first minutes of its flight. The tests had been written for the sky they knew.
See also Circuit 48:8 · Chronicles 7:10
- 12
The right test is rare as uncarved wood. It asketh what the program should do before the program is written, and it doth not ask what the program happens to do. The one who writes the expectation first findeth the block still whole, and the code will fit inside it.
See also Tao 7:12
- 13
The test that testeth the right thing loveth the one who reads it. It calleth the front door, not the wall. It names its story in plain words, so that the one at midnight, bleary and blamed, can read why the build turned red and go home to sleep.
- 14
Thus the Master said: write the test thou wishest to read at three in the morning. Let its name be a sentence. Let its body be small. Let its assertion be a single truth, and let it be able to fail.
- 15
A green build that cannot turn red is not a lamp. It is a painting of a lamp, hung in the hall of the faithful. Keep the red light, for the test that cannot fail is the test that cannot save thee.
See also Sutra 7:13
The Tao of the Kernel, Chapter 8:1–15.