Afterword - Agile Programming Techniques - Testing

Top  Previous 

Refactoring is one of a suite of techniques that have developed, mainly in the Object-Oriented world, in the past few years, which collectively have become known as agile programming techniques. There are many other techniques, but probably the most powerful one is the writing of automated tests.

 

I committed myself to using automated tests as much as possible when I read an article in a development magazine several years ago saying that, of all the different agile programming techniques that were tested (in a somewhat limited test, to be sure), automated testing was the most effective by far at improving programming productivity (speed and quality).

 

When you stop and think about it, you'll probably realize that programmers spend a huge proportion of their time debugging and testing code. I've seen estimates as high as 85%. It makes sense that, if you wanted to improve your productivity, you might start using automated tests.

 

It's tricky writing tests at first, especially for existing code. You have to choose your tests wisely - you can't write tests for everything (in existing code). And it takes a while to learn how to write testable code. There is a pretty good commercial tool to help you with VB unit tests - it's called vbunit, and is modelled on the popular JUnit that is used for Java code. The books by Kent Beck on Test-Driven Development and eXtreme Programming are the classics of the Agile methodologies movement.