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 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 as long as it has a program-id defined. When compiling using this preprocessor, the program-id
is used to identify the source code and the copybooks to insert, to form one unit of work in which to run and test. See
Inserting Test Code into Source Code for details of the strict naming conventions required for these copybooks.
- 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.