- Read each of the following
- Read chapter 1-2 in Pragmatic Unit Testing by Hunt and Thomas for an excellent introduction with anecdote to unit testing.
- Read chapter 4 in Refactoring by Fowler for excellent practical advice regarding what to test and how much to test. This chapter is available at books.google.com.
- Read one of the recommend reading articles for JUnit to familiarize yourself with at least one implementation of unit testing.
- If you plan to seriously apply unit testing to your projects, you should also familiarize yourself with chapter 4 and 5 in Pragmatic Unit Testing on Right-BICEP and CORRECT unit testing.
- If you are an SSG software developer, and want to read a testing plan used in a real software project, see S:\MDAC\Administration\Analysis_plans\Testing\testing plan draft-jw-002.doc. Though it is slightly out-of-date, this plan was used for the HDBSTAT http://www.ssg.uab.edu/hdbstat/ software with success, and the ideas contained within are still relevant.
- The Way of Testivus is a short humorous article and a nice, enjoyable read on unit testing.
Unit Testing in Java
- http://junit.sourceforge.net/doc/cookbook/cookbook.htm <-- basic tutorial
- http://junit.sourceforge.net/doc/cookstour/cookstour.htm <-- read if you're interested in design and how design evolves over time
Refactoring for testing
- See pages 103-114 in Pragmatic Unit Testing.
- See Appendix A in Pragmatic Unit Testing.
Unit Testing in Other Languages
Of special note is RUnit. Thanks for the heads up, Tapan!
Here is a link for SAS unit testing. Note that you must register for the most current version of futs. For automation use, one must install a version of perl and have certian path variable settings done. Still in testing and don't know if this is good quality. ( Ray ).
Here's a dated article that compares a few unit testing libraries in C++. Note that the two popular choices, CppUnit and Boost.Test have come a long way since then. However its among the better articles available out there.
This generation focuses on using mock objects for testing.
- Thomas, D., Hunt, A., Mock Objects, IEEE Software May/June 2002.
- This is a good, short introduction to mock objects with a servlet example.
- Here is a backup copy of the PDF in case it disappears.
- Mackinnon, T., Freeman, S., Craig, P., Endo-Testing: Unit Testing with Mock Objects, XP2000 conference paper.
- Freeman, S. How Mock Objects Happened.
- I have a print-out of this short article from years ago, but can no longer find the online reference. Anyone have it? We may need to contact the author.
- It has a nice example of a Robot.
- Freeman, S. Developing JDBC applications test-first.
- Again, I only have a print-out.
This generation focuses on using mock objects for design.
- Freeman, S., Mackinnon, T., Pryce, N., Walnes, J., Mock Roles, Not Objects. OOPSLA 2004.
- Freeman, S., Pryce, N., Evolving an Embedded Domain-Specific Language in Java. OOPSLA 2006.
- Interesting paper.