Marina Schwenk on Understanding Unit Testing and Modular Coding Using IBMiUnit

I wondered during March’s iChime how many of us were surprised to hear that our special guest had originally wanted to become an FBI investigator.  Fortunately for us, she’d found her real passion within the IBM i community while attending Gateway College and the Wisconsin Midrange User Group WMCPA. And apparently she was hard to restrain in her pursuit of software development.

About five years ago Marina felt at a loss for a good IBM i testing tool.

Granted, testing code is hardly a new concept. Formal testing tools have been around forever. But “unit testing is brand-new to the IBM i community. It’s hardly done and rarely talked about,” Marina explained.

She had originally started unit testing using Java-based tools JUnit and the open-source xUnit. And while RPGUnit is available, it has not been updated in some time. Even better would be a more recent, free open-source alternative to RPGUnit. Naturally she investigated; she dug for evidence that a solution existed. But the case went cold. So Marina developed her own: IBMiUnit.

What is IBMiUnit and how does it help in development?

Within the context of a use case pertaining to as you continue to modify code, test cases will identify if you’ve broken something, Marina stressed the importance of test-driven development (TDD), by which we develop test cases before we write any code, and demonstrated IBMiUnit’s capabilities for unit testing, to test and validate assertions, ensuring early on that code is working properly and existing functions aren’t being disrupted.

That’s how you build confidence in your existing code.

Since unit testing is bench testing, not in its environment, Marina advised that after unit testing should come integration testing in a test environment. Most larger companies will also have a quality-assurance department. But the whole idea is to test the code and get it clean and solid, she explained.

She noted two good additional points to consider: If you are changing the logic of your procedures, you should always re-test; and you will have a much better unit-testing experience when your code is modularized.

From the perspective of an industry veteran, the “big deals” about IBMiUnit might include:
  • It’s free and open-source.
  • Open source is still relatively new to the IBM i community; it’s a whole paradigm shift in how software is being distributed and consumed.
  • Now IBM i can support external environments and a variety of languages.

The takeaway for March iChime’s attendees: They’re going to commit more time to using a tool for unit testing, and they’re looking forward to trying IBMiUnit.

Find it on GitHub here: https://github.com/MarinaSchwenk/IBMiUnit

What did I take away? Marina’s technical development and presentation were great, as was the story of her journey from agent of investigation to agent of integration. But what impressed me at least as much was how much she’s accomplished in five years. Marina discussed another project she developed for error logging, specifically to identify when errors occur. Error messages are captured in a log table and can be interrogated which is helpful in debugging and error trapping. To download the source for this logging project, visit https://github.com/MarinaSchwenk/Logging

Hear more from Marina Schwenk in our Tech Talk at TechChannel: https://techchannel.com/SMB/01/2021/marina-schwenk-techtalk

Thank you, Marina, and to all who joined us in March.

Join us at iChime!

iChime reconvenes Thursday, April 8th, 2021 at 2:00 PM EST.

Special guest: “Swiss Army Knife” Richard Schoen on “See What i Can Do.”

Wondering how not to miss timely and relevant information in a friendly and casual setting in 2021? Sign up here to join us: https://www.centralparkdata.com/ichime-signup.html   

Is there a particular topic or special guest you would like to see? By all means, send us your thoughts at https://www.centralparkdata.com/contact.html

Published by Charles Guarino

Charles Guarino believes in the “power” of IBM Power Systems. His career reflects his interest in bringing the platform and its solutions to others. Charles started his professional journey as a department of one. Today, he is serving individuals on a worldwide basis though his consulting work and award-winning speaking engagements. Charles is a true people person and can often be found at conferences sharing his expertise in RDi and other IBM i topics. Reach out to Charles through his company, Central Park Data Systems, at [email protected]. He looks forward to hearing from you.