Categories
Agile

The Way of Testivus

From the slightly-odd The Way of Testivus, via InfoQ:

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.

If the code deserves to be written,
it deserves to have tests.

Categories
Agile Rails Ruby

Are we spending more and more time writing tests?

A while ago I wrote about testing trivialities, and claimed that no matter how simple the piece of code is, it still ought to have a test. I followed it up with some thoughts on using a helper to simplify writing specs for common validations. Even using the helper, the actual test code for a single validation outweighs the production code by a factor of more than three: