Craft Your Tests Well
Your test code is almost as important as your production code. Treat it as such. This means you should craft it to nearly the same standards as your production code. In particular, you should
• Be sure to express the intent of your test in its code
• Try to express only the intent and nothing more to the greatest extent possible
• Keep your test code simple and clean, using the same tools with nearly the same configuration and refactoring as you go
In the interest of keeping it simple, I will not repeat all of the other tenets of well-crafted code. You will want to apply some principles of software craftsmanship slightly differently, however.
Some static checker rules should be disabled for test code. For one, most static ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access