RPGUnit is an open-source unit testing framework for RPG ILE. It’s similar to JUnit for Java and allows developers to write and run automated tests for their RPG code (or Cobol).
It is now available in ReplicTest and very soon in VS Code as well !
Code example to run RPGUNIT:
RPGUNIT/RUCALLTST TSTPGM(RPGUNIT/TESTPGM14)
Integration with ReplicTest framework & dashboard:
PPTT/RUNTST CMDTOTEST(RPGUNIT/RUCALLTST TSTPGM(RPGUNIT/TESTPGM14)) EXITPGM(RPGUNIT)

This white paper will list all the key points about the full integration between RPGUnit, VS Code and ReplicTest with relevant link, example and quick start to optimize your productivity in regards. | – RPGUnit Installation & Quick Start – Test Driven Development (IBM) – Integration with ReplicTest – IBM i Unit Testing Now in VS Code! |
RPGUnit Installation & Quick Start
Download RPGunit & install it on your IBM i
Download
Download the zip file IBM Rational Developer for i – RDi 9.5.1.3+
From the web page https://tools-400.github.io/irpgunit/files/
Unzip then Upload RPGUNIT.SAVF to the IBM i
Restore library RPGUNIT
RSTLIB SAVLIB(RPGUNIT) DEV(*SAVF) SAVF(RPGUNIT)
Create Test Cases examples & Run Test Cases
ADDLIBLE RPGUNIT
RUCRTTST TSTPGM(RPGUNIT/TESTPGM01) SRCFILE(QTESTCASES)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM01)
Create All Test Cases examples
ADDLIBLE RPGUNIT
RUCRTTST TSTPGM(RPGUNIT/SRVPGM1 ) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/SRVPGM2 ) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM01) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM02) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM03) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM04) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM05) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM06) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM07) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM08) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM09) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM10) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM11) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM12) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM13) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM14) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM15) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM16) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM17) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM18) SRCFILE(QTESTCASES)
RUCRTTST TSTPGM(RPGUNIT/TESTPGM19) SRCFILE(QTESTCASES)
Run All Test Cases examples
ADDLIBLE RPGUNIT
RUCALLTST TSTPGM(RPGUNIT/SRVPGM1 )
RUCALLTST TSTPGM(RPGUNIT/SRVPGM2 )
RUCALLTST TSTPGM(RPGUNIT/TESTPGM01)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM02)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM03)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM04)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM05)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM06)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM07)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM08)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM09)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM10)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM11)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM12)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM13)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM14)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM15)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM16)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM17)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM18)
RUCALLTST TSTPGM(RPGUNIT/TESTPGM19)
Tutorial example
Test Driven Development (IBM)
This presentation from (IBM) Barbara Morris and Edmund Reinhardt gives an excellent overview and methodology of TDD with examples leveraging RPGUnit.






https://www.tug.ca/tec/Sessions/Handouts/PDF/21C-Test%20Driven%20Development.pdf
An evolution of TDD is BDD – Behavior Driven Development
BDD emphasizes collaboration between developers, testers, and business stakeholders.
It focuses on defining the behavior of an application in plain, human-readable language, using scenarios and examples.
BDD brings together key stakeholders in the Software Development Process, often called the “Three Amigos” – the Business, Development, and QA teams. Using tests written in plain English allows all stakeholders to understand and agree on the software’s expected behavior, ensuring that the “right product” is being developed and that the “right tests” are performed.
Integration with ReplicTest
You will only need to wrap your RPGUnit cmd within ReplicTest as follow:
Example:
Code example to run RPGUNIT:
RPGUNIT/RUCALLTST TSTPGM(RPGUNIT/TESTPGM14)
Integration with ReplicTest framework & dashboard:
PPTT/RUNTST CMDTOTEST(RPGUNIT/RUCALLTST TSTPGM(RPGUNIT/TESTPGM14)) EXITPGM(RPGUNIT)
Result:
In the dashboard:
The result of the Unit Test will immediately be shown on the dashboard and any time you click the “Replay” button; the test (in this case the unit test) will be replayed.
Within the ReplicTest framework a TESTID is automatically generated and recognised anytime a replay is running with a new timestamp. All test metadata are then also available like objects or files used, call stack, message stack or any logs. Features like code coverage or shrink database tables are as well available as for any other tests.
You can also Replay it from a command line or into a CL pgm, DevOps pipeline or a schedule pgm with the same cmd:
PPTT/RUNTST CMDTOTEST(RPGUNIT/RUCALLTST TSTPGM(RPGUNIT/TESTPGM14)) EXITPGM(RPGUNIT)
All your Unit Test can be tagged, referenced into a Test Suite and replayed all together anytime you wish:
- Specify a tag when you run the cmd:
PPTT/RUNTST CMDTOTEST(RPGUNIT/RUCALLTST TSTPGM(RPGUNIT/TESTPGM14)) DESC() TAGS(MYRPGUNIT) EXITPGM(RPGUNIT)
- Create a Test Suite, add all test that have the tag MYRPGUNIT then run the test suite:
CRTSUITE SUITEID(‘My RPGUNIT Suite’) DESC(‘My RPGUNIT unit-test’)
ADDTST SUITEID(‘My RPGUNIT Suite’) REFTAGS(MYRPGUNIT)
RUNSUITE SUITEID(‘My RPGUNIT Suite’)
IBM i Unit Testing Now in VS Code!
This presentation from (IBM) Sanjula Ganepola who is working with Liam Allan at many excellent features for the IBM i community is showing the VS Code integration with RPGUnit. This feature should be GA very soon, for June 2025, stay tuned!





