Scaffold ABAP Unit test classes
scaffold_abap_unitScaffold ABAP Unit test classes for untested global classes, generating skeleton test methods that fail on TODO, ready fill with assertions.
Instructions
Generate the local ABAP Unit test-class include (.clas.testclasses.abap) for each global class in the provided sources: a FOR TESTING class (RISK LEVEL HARMLESS, DURATION SHORT) with a setup method that instantiates the class under test and one skeleton test method per public method. Every skeleton fails loudly with cl_abap_unit_assert=>fail('TODO …') so generated-but-empty tests can never masquerade as coverage; abstract classes and parameterized constructors get TODO guidance instead of a blind NEW #( ). Generated code is round-tripped through abaplint together with the class under test before being returned. Use this when a class has no tests yet and you want a correct, ready-to-fill test harness — the natural first step of test-driven rework and the 'add tests before we migrate this' consulting task. It does not invent assertions or test data (the given/when/then substance is yours or the agent's to write), does not create test doubles, and cannot run the tests — ADT/CI does that. Example: scaffold_abap_unit({ "files": [ { "filename": "zcl_travel.clas.abap", "source": "CLASS zcl_travel DEFINITION PUBLIC.\n…" } ] }).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Source files to analyze, up to 32 per call, 100k chars each. | |
| abapVersion | No | ABAP language version the generated tests are validated against ("Cloud" for ABAP Cloud classes). | v758 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| skipped | Yes | Inputs no test class was generated for, with the reason (interfaces, programs, FOR TESTING classes…). | |
| nextSteps | Yes | What to do with the generated skeletons, in order. | |
| validationIssues | Yes | abaplint findings on generated code — empty on a clean round-trip. |