Test

Debug the jobs by using the debugging stages and the interactive debugging tool.

You can use the debugging stages early in the development cycle to generate test data and to sample data during processing. After you compile a job, you can run the job in debug mode and examine the column data at breakpoints to understand the job flow.

Figure 1. Testing a job during development
The figure shows the process of testing a job as it is described in the text.

Generate test data

You can use the debugging stages to generate test data. For example, you can generate data based on the table definition for your source system, and then you can build and test downstream logic based on the generated data. You can use the data to test your job logic early in the job lifecycle before your source system data is available.

This sample job generates customer data by using the Row Generator stage. The job enriches the generated data with real customer data from an Oracle database by using the Lookup stage.

Figure 2. Generating test data
The figure shows a job that generates test data by using a Row Generator stage and accesses reference data by using an Oracle Connector stage. The job combines the data by using a Lookup stage and loads the enriched data to the target file by using a Sequential File stage.

Sample the data

You can use the debugging stages to sample output data while you are developing a job design. For example, you can sample data in a data set that is the output of a job by using the Peek stage. The Peek stage writes data to the job log. In this job, the original data is copied to another data set, and the sampled columns are written to the log file for you to review.

Figure 3. Sampling data
The figure shows a job that uses a Peek stage to sample data from a data set and copy the original data to another data set.

Examine the column data at breakpoints

You can debug a job by setting breakpoints on the links where you want the job to stop when you run the job in debug mode. While the job stops at a breakpoint, you can examine the column data that is being processed. You can also change the breakpoints for other data conditions and examine stage properties and job parameter values. In this sample job, two breakpoints are set to stop the job after every five rows. The job is stopped at the breakpoints, and the Debug Window displays the column data for each breakpoint.

Figure 4. Setting breakpoints
The figure shows a job with two active breakpoints and the Debug Window.