Writing unit tests often helps you write better code. The reason is simple: a test case is a user of your code. It's only when using code that you find its shortcomings. Don't hesitate to listen to your tests and refactor your code so that it's easier to use. The practice of test-driven development relies on this principle. By writing the tests first, you develop your classes from the point of view of a user of your code.
|
'Archive' 카테고리의 다른 글
A Taxonomy for "Bad Code Smells" (0) | 2011.11.15 |
---|---|
Code Smell (0) | 2011.11.15 |
Agile 원칙 12가지 (0) | 2011.11.14 |
다섯가지의 소프트웨어 테스트 (0) | 2011.11.14 |
Java에서 static method가 오버라이드 될 수 없는 이유 (0) | 2011.11.14 |