SelfTestingCode

testing · clean code

tags:

Self Testing Code is the name I used in Refactoring to refer to the practice of writing comprehensive automated tests in conjunction with the functional software. I come across it primarily with tools like the XUnit family of testing frameworks.

TestDrivenDevelopment is my preferred way of writing Self Testing Code, however it isn't the only way. You can get many advantages of tests by writing them just after the functional code rather than before. The important point of Self Testing Code is that you have the tests, not how you got to them.