Painless(er) Unit Tests

Table of Contents How to Make Unit Testing not so much of a pain Unit Testing Primer Dress for Success Do not DRY your tests Test Driven Development Keep your tests Assert a single truth per test Clearly state your intent Avoid blob tests Use acceptance tests instead Or use an algebraic type system instead Admissions Conclusion How to Make Unit Testing not so much of a pain Unit Testing I find myself talking a lot about unit testing in my current workplace. Over time I’ve learned things from others as well as developed some habits that have served me well. I’ve gotten applications up to 100% test coverage without Herculean effort. Granted, test coverage is not the same as test quality, it’s still a useful metric. I’ve demonstrated that there is at least one case in which my code can work. ...

2017-05-17 · 9 min · 1802 words · Logan Barnett