How to unit test a module?

10 pts.
Tags:
RPG ILE
Hi, I have done some enhancements in the existing module. for that i wolud like to do a unit test any one can help me out to describe how we can unittest a module .
ASKED: September 24, 2007  5:02 AM
UPDATED: August 5, 2008  2:10 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi

A module is simply a component of a program, so after making changes and recompiling it you have to recreate the program(s) that it is a part of.

How you test the changes made to the module depends on the functionality of the program and the changes made.

Best regards

Jonathan

**************************************************************
Different modules make a product and different units make a module, so to run a unittest on a module, first of all it is very important to identify the units (module divided into sub-modules and sub-modules divided into further smaller components or units). Once these basic components or units are identified in a sub-module, each of it is to be functionally tested as per the requirements of this unit. Any business rule embedded in a unit has to be tested as per its accuracy. So in unit testing your test cases will be focusing on the functionality (requirements and rules) of each unit and unit test will be nothing but the verification process that all is working well as per requirements.
-jaideep

**************************
You can also use the UPDPGM command (update program), instead of recreating the program. This is useful if you have a program which contains several modules, and you want to replace just the module that was actually changed.
CWC

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Alopez1571
    Hi, First of all you have to understand these ILE concepts: Program - Module - Procedure 1) Procedure is the "callable" unit, by the instruction CALLB or using prototype with CALLP. There can be more than one procedure per source member. 2) Module is in OneToOne relationship with source member but could contain more than one procedure. It's the "compilable" unit. 3) Program is like the container of modules and procedures. Modules (which has procedures) are binded into a program or service program. For example: I have the program The Service program PayRollCal with the modules SalaryCal and Deductions. The first module has the procedures GetGrossSalary & GetOvertimeSalary, the second one has procedures GetTaxAmt & GetLoanDed. If I want to test the procedure GetTaxAmt which procedure interface is: D GetTaxAmt PI 13 2 D EmpCode 6 0 Value D GrossSalary 13 2 Value You create a program where you define this prototype: D GetTaxes Pr 13 2 Extproc('GetTaxAmt') D 6 0 Value D 13 2 Value The prototype is for making the call easier and it must match the procedure interface of the procedure to be called. Note the prototype name is different to the real procedure name, it is allowed but if you want to, you can use the same name and omit the ExtProc keyword. The call instruction could be: C Eval MyTaxes = GetTaxes(mycode:mysalary) Or for free format myTaxes = GetTaxes(mycode:mysalary); If you want to debug the procedure, you just have to start debuging the Test Program and add the services program by F14 function key, look for the corresponding module and visualize it to get into the code and press F6 at the line where you want to create a break point. I hope it can be helpful, Regards, Arturo Lopez
    150 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following