4 ms·
Some time ago I stopped debating the definition of "unit" in testing, and instead started focusing on whether my tests were fast, reliable, and provided a usefu
by glenjamin 5y ago
Some time ago I stopped debating the definition of "unit" in testing, and instead started focusing on whether my tests were fast, reliable, and provided a useful signal about the health of the system when they failed. I've been much happier since then.
- 2OEH8eoCRo0 5y agoThis is what Working Effectively with Legacy Code says: Here are qualities of good unit tests: 1. They run fast. 2. They help us localize problems. A unit test that takes 1/10th of a second to run is a slow unit test.
- AstralStorm 5y agoNice joke, it takes longer to upload firmware with the unit test suite than that. The test that is too short is most likely not being thorough enough, or the functionality it tests is so simplistic the test likely brings no value.
- 2OEH8eoCRo0 5y agoWhat about integration or end to end tests?
- glenjamin 5y agoThat's surprising to me, because the author of that book recently re-advertised his long post about a hard-line definition of a "unit" test https://www.artima.com/weblogs/viewpost.jsp?thread=126923 https://www.artima.com/weblogs/viewpost.jsp?thread=126923 I think the properties you list are good ones, but if you drop the word unit from your post the advice is just as good and you can't get mired in ontological discussions
- stepbeek 5y agoThis is the sticking point I've found. The definition of "unit" is different depending on who I talk to.