My chapter in Beautiful Code is called "Beautiful Tests". In the chapter, I focus on a specific example of how a developer can use tests to make the code not only more robust, but also more beautiful.

I really enjoyed sharing my thoughts, and thought-processes, on developer testing using lots of actual code on a very specific example. But, as I was writing this chapter, I kept feeling a strong urge to also write something at a higher-level; something a bit more general and philosophical, to complement it.

The result is The Way of Testivus - Less Unit Testing Dogma, More Unit Testing Karma, a small booklet with twelve epigrams that summarize my philosophy on developer/unit testing.

Below are two of the epigrams; if you want to read more you can download the entire "The Way of Testivus" booklet.

If you write code, write tests

The pupil asked the master programmer:

“When can I stop writing tests?”

The master answered:

“When you stop writing code.”

The pupil asked:

“When do I stop writing code?”

The master answered:

“When you become a manager.”

The pupil trembled and asked:

“When do I become a manager?”

The master answered:

“When you stop writing tests.”

The pupil rushed to write some tests. He left skid marks.


Think of code and test as one

When writing the code, think of the test.

When writing the test, think of the code.

When you think of code and test as one,

testing is easy and code is beautiful.