Tuesday, January 22, 2013

Unit Testing Book

Warning: Another Book Plug!

So I bought this book and so far it's really good.  The book starts with a short history lesson, of programming, then moves into a little unit testing history and extreme programming history.  Then it gets right to the heart of the problem.  Unit testing.  The author describes what is and is not a unit test.  This is where I nod my had and think "yup, thought so."  You see, I've done some unit testing and I've read a lot of books on how to do test driven development.  What I couldn't do is apply it to my own development environment because we use a lot of database access.  In fact most of the methods in our web site either render the output or it reads from the database.  In this book, testing this type of operation is called integration testing because.

I've read through the basics of test driven development, which I've read about before, but didn't quite grasp the details.  This book breaks the process down to the details of why each step is performed in the order that it is performed.  A toy example is used in the text so you don't have to spend a lot of time looking at code while reading the example.

I'm currently into mock objects (which is broken into dummy, stubs and fakes).  So far the subject is very clear and easy to understand.  The samples are clear enough to understand just by looking at their code, no need to type them in and try them out.

Stay tuned... I should have this book read by the end of the week.  I'll post some "real" findings when I finish the book.