| < Day Day Up > |
|
If you don’t test your code, you can never know for sure that it’s working. Beyond just catching bugs, a thorough suite of unit tests can give you the confidence you need to fine-tune your code. Think about these points when evaluating your own unit-testing practices:
Write unit tests for all code.
Write the tests as you go along. Don’t leave them for a “later” that may never come.
Make sure code passes unit tests and integration tests before you check it into the source code control system.
Use an automated tool such as NUnit to make the unit-testing process easy and repeatable.
Check the tests and any necessary setup files into your source code control system.
Consider using TDD to ensure 100% testing coverage.
Refactor code only when you have a thorough set of tests for the code.
Now that the code is starting to pile up, I want to turn our attention to the development environment itself. Visual Studio .NET is a fine IDE, but as you’ll see in the next chapter, many tools are available that can make it even better.
| < Day Day Up > |
|