MFUPP Preprocessor

The Micro Focus Unit Testing Framework includes a stackable preprocessor (MFUPP) that enables you to instrument a COBOL program during unit test creation without the need to edit the original source code.

It provides the following functionality:

  • Self-contained tests - By inserting additional copybooks into the working-storage section and procedure division (via COPY statements) of a source program when it is put under test, you can test on a more granular level than typical unit tests: you can directly test single paragraphs or sections. No changes are required to the original source under test. When compiling using this preprocessor, the program being compiled must have a program-id defined in order that the testing framework can insert the correct copybooks into the code under test, as strict naming conventions for these copybooks is required; see Inserting Test Code into Source Code.
  • Mocking and stubbing - For source code that may be difficult to test, you can control the flow of execution and if required, replace certain sections of code by using the mocking and stubbing functionality of the preprocessor; see Mocking and Stubbing Source Code.

The preprocessor is enabled just as you would any other preprocessor (for example: on the command line, project properties, etc...) and includes a number of directives used to configure its behavior.

Note: This preprocessor is not intended for use outside of the Micro Focus Unit Testing Framework.