Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
Showing results for 
Search instead for 
Did you mean: 
Former Member

Here’s a tip for those of you out there who are responsible for quality testing using ABAP Unit module tests.  You can automate ABAP Unit runs with the ABAP Code Inspector as of  Release NW04 (6.40).

Let me explain why this is a useful tip.  For most quality advocates, the first task is to get your developers to implement ABAP Unit tests.

But once you have ABAP Unit tests in place, then a second, problematic task emerges:  Running the ABAP Unit tests regularly.  After all, you created the unit tests because you wanted to detect problems introduced into existing functions by changes in coding, and you wanted to be able to verify that new coding works as designed.

To achieve these desirable results, you need to run a perhaps quite large set of unit tests more or less regularly, when code arrives in your test system.  It is a bit tedious, however, to travel through the relevant classes, function groups, programs in the ABAP Object Navigator calling Test -> Unit Test off the context menu at each stop.

Fortunately the Code Inspector of the ABAP Workbench provides a convenient way for you to automate executions – and even track results – of selected sets of ABAP Unit tests.  Here is how to do this:

  1. Start the Code Inspector (transaction SCI) in your testing system.

  2. Create an object set that specifies what ABAP Unit tests are to be run.

  3. Pick out the ABAP classes, programs, and function groups whose unit tests are to run under this object set.

    Ideally, you can just specify the set of packages in which you are actively developing.  Leave Save Selections Only on to select objects according to object assignments fresh every time that you use the object set.

    When you are ready, save the object set and return to the SCI start screen.

  4. Create a check variant.

  5. Mark only the Dynamic Tests option on the Check Variant screen.  Then save your check variant and return to the SCI start screen.

  6. Now you can create an inspection that uses the object set and check variant that you just created.

  7. The Execute button with opens a window in which you decide how to run the inspection.  As the screen shot shows, set the inspection to run as a background job. Whenever the job runs, all of the ABAP Unit tests in the object set will be run. The Code Inspector saves the results of each run.

    All of the repetition features of ABAP background processing are available to you – but if you import code on a regular schedule, then you probably need only schedule the job periodically.

    Here, the ABAP Units inspection is scheduled to run immediately as a background job and will be repeated weekly.

  8. A finished inspection is marked with a green icon, as you can see here. Clicking on Possible Entries (F4) in the Inspection field shows you the status of the current and past inspections.  Click on an inspection to open it.

    Then click on the Results button to see any messages issued by the ABAP Unit tests.

Labels in this area