Automated Testing for Solo Practitioners

28 03 2007

Yes, writing tests up front is time-consuming and not directly contributory to the final code. But writing the tests is like filling your auto’s tank with gas before starting a long trip. It will save you from the frequent stops you’ll have to take without it.

If you’re using a compiler, you’re likely already using automated testing as they perform static type checking. You have to declare the variable before using it, along with its type specifier. You have to use casts for parameters and assignments when the types don’t conform to the prototypes.

You’re content, for the most part, to use static types in your code because they eliminate an entire class of defects and reduce time you’d have to spend debugging for them.

Unit Tests and Assertions
Don’t use just unit tests to verify the production code works as expected, but also assertions within the production code to verify parameters and environment meet assumptions.

What to test
Interface - can be part of TDD
Parameters
Errors
Results


Actions

Informations

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>