The Agile Tribe

Teaching an old dog new tricks – Trick No. 2

on November 23, 2009

Author: Nic Woollett

This blog is the second part of what we have learnt as mainframe/legacy developers while adhering as closely as possible to pure Agile principles. In order to do this we have tried to make a series of fundamental changes to how we operate.

So the second trick we have used on our Agile journey relates to Build and Unit Testing.

This was where the biggest shift came in our mindset as mainframe legal programmers. With iterative development you have to have repeatable testing – otherwise you’ll be stuck in an endless cycle of regression testing. Also, locating or manipulating test data can be a labour intensive process and in any case. Very rarely is all logic in the program tested.

A program could be changed in multiple stories and within each story only the changed portion of the program should require to be tested – regression testing should be automated. So, for our project we needed to:

  • Take away the need to locate/configure test data for each code change
  • Automate regression testing
  • Be able to target specific code to test
  • Make every test easily repeatable.

We did this by building a unit test framework – the first and probably only one in existence for Hogan. The framework consists of various tools and utilities that we developed for the Agile process. Broadly, each program requires a test program to drive the unit testing of this program. When run in the test framework the program can be tested in isolation and it requires no specific environment data – such as files or databases. The program can be tested over and over without the need for any user intervention.

The test framework (named the HUTF – Hogan Unit Test Framework) is now at the tried and trusted level and whilst initially it adds to the development time, when a developer is conversant with the tools they should be able to code and unit test much more efficiently. We also automated unit testing – a daily run was set-up to test all the test cases – a list that grows with each story. A report is generated and should any test fail an email is sent to the development team highlighting the failure(s).

What I learnt:

Developers spend too much time doing user acceptance testing under the name of unit testing. Using a test framework greatly cuts unit testing time allowing developers to do more developing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s