Depending on the program code I write a unit test to test some procedures. I usually don’t write unit tests for procedures that do just CRUD functionality without any real logic. I have enough faith and trust in IBM that I don’t have to unit test their read, write and delete opcodes. I try to keep the focus of the test to the module I want to test and not f. e. test procedures that are not part of that module.

Sometimes I want to test a procedure which is not exported by the service program. That can also very easily be done. Just export the procedure but don’t list it in the binder source of the service program. By that every module bound together with that module can access the procedure but it won’t be accessable from the outside. Next I bind my unit test module and the test target module together to one unit test service program which can be executed by RPGUnit or rather the maintained version of it, iRPGUnit.