DEV Community

loading...

Discussion on: When do you write your tests?

Collapse
databasesponge profile image
MetaDave 🇪🇺

I follow what I like to call DDD -- "Design-driven design" -- in which I attempt to produce an elegant, OO design for the solution (RoR by the way) with small, DRY, single responsibility classes and zero (or very few) code smells.

Along the way I'm thinking about whether the names of classes and methods make sense, and whether the function and purpose of each item of code would be clear to a reviewer.

This seems to inevitably leads to easily testable code, and the unit tests in particular are then very easy to write and very comprehensive.