Unit Testing for RPG
About
This page will not tell you what a unit test is or how test driven development works. There are numerous sites out there which explains that way better than I can. So please visit them first and then come back to learn how you can enhance your RPG skills with unit tests and make your life as a software developer a little easier.
Nice to have you back. Now that you know what unit testing is we can start learning how it can be applied to RPG. Fortunatly there is already a project which has done most of the things we try to accomplish. Take a look at the ILEUnit project at Sourceforge.net. The software is provided in the archive file in the download section. Extract files in the IFS and install it with the make tool.
By now you'll probably know how to write a unit test in RPG and ask yourself what this page is really about.
Project Goals
The software from the Sourceforge.net site is intended to be used as a standalone product. It has some commands to be executed from the command line. Originally the test result was outputted only to the screen and to a spooled file. This was not very convenient for the developer. The goal is to integrate it more in the development cycle with UI support and test integration in build frameworks.
Continuous Integration
It would be nice to know if someone on your dev team broke some peace of software with his latest changes on a program, either not compiling at all or not behaving as it should. This is where continuous integration servers jump in.
A continuous integration server lets you build part or all of your programs (as configured) and executes all configured unit tests. If somethings goes wrong you'll be notified via email.