Page 1 of 1

Ideas for Unit Testing

Posted: Thu Mar 05, 2015 3:03 pm
by Harini
Hi All,

I need some ideas for Unit testing our jobs. Basically, the job would have rules like this.

Code: Select all

 1) Read all the records from source 
             - If Column A = 'X' Then 
                         If Column C = 2, derive A= 23
                       Else If Column C = 3, derive A= 28
                       Else If Column C = 6, derive A= 28
                       Else If Column C = 9, derive A by performing a lookup 
                       Else If Set A= 10
              -Else Column A<> X Then
                         If Column C = 10, derive A= 27
                       Else If Column C = 3, derive A= 29
                       Else If Column C = 6, derive A= 28
                       Else If Column C = 9, derive A by performing a lookup 
                       Else If Set A= 10
etc. . The job is far more complex than this. But it highly involves, deriving a set of columns on column values of other intermediate variables, and it involves good amount of 'if' then 'else' loop.

Unit testing this in Datastage by just merely running jobs, might be tough. I would like to test it via other tools commonly used. Please share your thoughts on this.

Thanks,
Meenakshi

Posted: Thu Mar 05, 2015 6:53 pm
by ray.wurlod
There's no other way to unit test DataStage jobs than by running them. Or running a copy, in which things like database targets are replaced with, for example, text files (not always possible, but usually feasible in the early phases of testing).