An effective test strategy

Jimmy Bogard has a good post up on LosTechies about the different types of tests you might run on a code base.

As he points out, categorizing different types of tests can be annoying, but he separates them into full-system, subcutaneous, and unit tests.

I’m long on record bitching about unit tests.  Unless you are building a framework, where you don’t know up-front how your framework might be used (users are fun that way), TDD is terrible.  Some form of ‘godawful syntax’ BDD type spec stuff is much better, since you know what the inputs will be from the end users (as fun as they are) and so that is all you really need to test, and it drives what your tests will look like (as opposed to the random “let’s create 8 vars and see what happens” method of testing TDD encourages.

I’m interested in his distinction between full-system and subcutaneous testing.  When building apps (like the web apps I’m typically working on), I prefer the full-system tests.  Those are what your users are actually doing and you can actually work with them if a spec fails.  When dealing with batch files, I also prefer full-system tests (there’s almost nothing more useless than a TDD-style test of a batch file process).  At the same time, I have also used (what I didn’t know what to call) subcutaneous tests, where you are, more or less, testing your system end-to-end but without UI interaction.  To use a simple example, if you are testing tax rate calculations, it’s often really important to know that the ‘behind the scenes’ processing is giving you the right tax information for a given order, and there’s no need to drive this from a UI.

In any event, I think it’s a good read.  Check it out.

posted on Monday, August 30, 2010 8:35 PM Print
No comments posted yet.

Post Comment

Title *
Name *
Comment *  
Please add 8 and 6 and type the answer here: