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.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Unit Testing

  • Martin P. Robillard

摘要

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.