SShortSingh.
Back to feed

Unit testing RPG with iRPGUnit: failures, errors, and running tests in CI

0
·2 views

Legacy RPG is usually verified by hand, which breaks down when rules change later and no one recalls which records confirmed them. The iRPGUnit framework brings unit testing to RPG, and the author demonstrates it with a 20-test suite on PUB400 running IBM i 7.5. Business rules must sit in procedures free of file, record, or screen I/O to be testable, so the author moved accounts receivable payment logic into a service program with no I/O. A failing assertion stops its test case early, so keeping tests small and ordering cheap checks first helps. The article distinguishes failures, where code returns a wrong result, from errors, where code crashes, and shows how to test for expected exceptions.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

Foldable Flight Site Offers Instructions for Advanced Paper Airplane Designs

A website called Foldable Flight has been shared on Hacker News, where it drew 48 points and 6 comments. The page is presented as a resource for paper airplane folding. The source material provides little detail beyond the site's name and its listing on the forum. Readers would need to visit the linked site to learn about the specific designs or instructions it contains.

0
ProgrammingDEV Community ·

Pingsold ranks startups by verified analytics, but few founders have connected their data

The creator built Pingsold, a startup directory where rankings are based on each startup's read-only analytics, synced daily, rather than self-reported figures. So far only 2 of 8 listed startups have verified their traffic, and both belong to the creator. Six founders signed up and created listing pages but never connected their analytics, which keeps them off the leaderboard. The creator suspects that asking founders to link analytics for a new site feels like a trust barrier, even with read-only access. The creator is asking readers whether they would connect analytics and whether a verified traffic badge would be useful, and plans to report results in a month.

0
ProgrammingDEV Community ·

Developer ties README template count to CI tests after finding 8 templates shipped, not 50

A developer discovered that the README of their SQL playground repository claimed 50+ query templates while only 8 had actually been shipped. Instead of writing the missing templates immediately, they made the claim enforceable by running the shared template library through a parametrized pytest suite. The tests check that each query executes against a deterministic DuckDB sample database, returns rows, and that the total template count stays at or above 50. The library now contains 55 templates grouped by teaching topic, and DuckDB was chosen because it supports SQL features SQLite lacks. The author recommends turning one public number into a test so that documentation and code cannot drift apart.

0
ProgrammingHacker News ·

Blog post argues developers should try the Gleam programming language

A blog post at nchagnet.eu encourages developers to give the Gleam programming language a try. The item was shared on Hacker News, where it received 18 points and 7 comments. The source text provided includes only the headline and links, so the specific arguments the author makes for Gleam are not available here. Readers interested in the reasoning behind the recommendation would need to consult the original post directly.