Unit Testing
摘要
Unit testing is a practice wherein we automatically execute code to check that it does what we think it should. With unit testing, we can build a possibly large collection of tests that can quickly be executed, for instance every time we change the code, to make sure everything that worked still does. Additionally, writing unit tests provides insights into the quality of a design. This chapter introduces mechanisms that facilitate unit testing (metaprogramming and annotations) and presents basic techniques for designing unit tests and evaluating their quality.