Skip to main content
Glama

Scaffold ABAP Unit test classes

scaffold_abap_unit
Read-onlyIdempotent

Scaffold 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

TableJSON Schema
NameRequiredDescriptionDefault
filesYesSource files to analyze, up to 32 per call, 100k chars each.
abapVersionNoABAP language version the generated tests are validated against ("Cloud" for ABAP Cloud classes).v758

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYes
skippedYesInputs no test class was generated for, with the reason (interfaces, programs, FOR TESTING classes…).
nextStepsYesWhat to do with the generated skeletons, in order.
validationIssuesYesabaplint findings on generated code — empty on a clean round-trip.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly and idempotent, and the description adds valuable behavioral detail beyond that: generated skeletons fail loudly via cl_abap_unit_assert=>fail('TODO …'), edge cases (abstract classes, parameterized constructors) get guidance, and the output is round-tripped through abaplint. This fully informs the agent of the tool's operational traits without contradicting the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense paragraph that front-loads the core purpose, then covers key behaviors, exclusions, and an example. Every sentence carries information—no filler or redundancy. For a tool with this complexity, the length is justified and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (generating test harnesses with specific constraints) and the presence of an output schema, the description covers all necessary context: what it produces, how it handles edge cases, what it deliberately avoids, and how it validates output. An agent has everything needed to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (both parameters are described in the schema). The description adds a complete invocation example with the files parameter and clarifies the 100k chars limit (implied via schema's maxItems but reinforced). It doesn't repeat parameter definitions but adds usage context, which is appropriately helpful beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Generate the local ABAP Unit test-class include' for each global class. It clearly differentiates from siblings like scaffold_rap_bo (which targets RAP business objects) and lint/fix/format tools, so an agent can select it without ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit guidance: 'Use this when a class has no tests yet' and it positions the tool as the natural first step in TDD. It also states exclusions—does not invent assertions/test data, does not create test doubles, cannot run tests—and gives a concrete example invocation, leaving no doubt about when to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/palimkarakshay/abap-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server