Fall19 Intro To Unit Testing Using IBMiUnit
Fall19 Intro To Unit Testing Using IBMiUnit
using IBMiUnit
Fall 2019
Marina Schwenk
Software Developer
What is Unit Testing?
Breaking apart your application and testing each part
Integration testing
Automatic
Magic
How to Use IBMiUnit
Install IBMiUnit Library
multiply_zeroByZero, multiply_twoNegatives, …
Write Test Case: Logic
Call sub-procedure with test data
Compare actual result with the expected result
Trigger failure when they don’t (or do) match
Write Test Case: Failure Detection
Always fail, i.e. you write the condition and call fail()
Conditionally fail, or test for failure; many possibilities
All start with assert
Indicator tests
On / Off
Pointer tests
Null / NotNull
Variable tests / comparisons
RPG doesn’t have overloading so next word is a type
Char, Date (ISO), Float, Numeric, Time (ISO), Timestamp
Special Thanks:
Austin Narus, Network Security Administrator, Everbrite
Bryan Peterson, Application Developer, Everbrite
Steve Johnson-Evers, Lead Architect, Everbrite
Rochelle Petty, Application Support, Everbrite
Debbie Saugen, Owner, Debbie Saugen Consulting, LLC
Jeff (Red) Koon, RPG Developer