Skip to main content
Glama

CreateCdsUnitTest

Generates and activates an ABAP unit test class for a CDS view, verifying test-double support and embedding local FOR TESTING classes.

Instructions

Create ABAP Unit tests for a CDS view: check the view supports CDS test doubles, create a test class holding the local test classes, activate it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailNoHow much of the answer to return: "terse" (default, the fields you need to act), "full" (the whole parse), "raw" (the document as ADT sent it).terse
class_nameYesName of the new global class that holds the tests.
package_nameYesPackage of the new test class.
cds_view_nameYesCDS view under test (DDL source). Must be active and testable with test doubles.
test_class_sourceYesABAP source of the local test classes: definitions and implementations, FOR TESTING.
transport_requestNoTransport request, not a task. Required for a transportable package.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv16.0.0
    • changedInput schema / properties / cds_view_name / description
      Previous value: -"CDS view name to validate for unit test doubles."New value: +"CDS view under test (DDL source). Must be active and testable with test doubles."
    • changedInput schema / properties / class_name / description
      Previous value: -"Global test class name (e.g., ZCL_CDS_TEST)."New value: +"Name of the new global class that holds the tests."
    • removedInput schema / properties / description
      Removed value: -{
      -  "description": "Optional description for the global test class.",
      -  "type": "string"
      -}
    • addedInput schema / properties / detail
      Added value: +{
      +  "default": "terse",
      +  "description": "How much of the answer to return: \"terse\" (default, the fields you need to act), \"full\" (the whole parse), \"raw\" (the document as ADT sent it).",
      +  "enum": [
      +    "terse",
      +    "full",
      +    "raw"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / package_name / description
      Previous value: -"Package name (e.g., ZOK_TEST_PKG_01, $TMP)."New value: +"Package of the new test class."
    • addedInput schema / properties / test_class_source
      Added value: +{
      +  "description": "ABAP source of the local test classes: definitions and implementations, FOR TESTING.",
      +  "type": "string"
      +}
    • changedInput schema / properties / transport_request / description
      Previous value: -"Transport request number (required for transportable packages)."New value: +"Transport request, not a task. Required for a transportable package."
    • changedInput schema / required
      Previous value: -[
      -  "class_name",
      -  "package_name",
      -  "cds_view_name"
      -]New value: +[
      +  "cds_view_name",
      +  "class_name",
      +  "package_name",
      +  "test_class_source"
      +]
  2. Changed3 schema fields changed
    • removedInput schema / properties / class_template
      Removed value: -{
      -  "description": "ABAP class template used for CDS unit tests.",
      -  "type": "string"
      -}
    • removedInput schema / properties / test_class_source
      Removed value: -{
      -  "description": "Local test class ABAP source code.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "class_name",
      -  "package_name",
      -  "cds_view_name",
      -  "class_template",
      -  "test_class_source"
      -]New value: +[
      +  "class_name",
      +  "package_name",
      +  "cds_view_name"
      +]
  3. First observed

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses that the tool mutates the system by creating and activating a class, and that it validates test-double support first, but it omits permission requirements, behavior when the view is not testable, and the role of the transport_request parameter.

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

Conciseness4/5

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

A single front-loaded sentence with a colon-delimited list of the three actions; no filler. Slightly dense, but every clause describes a distinct step of the operation.

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

Completeness3/5

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

For a six-parameter mutation tool with no annotations and no output schema, the description covers the main workflow but leaves gaps on prerequisites (active/package/transport state), failure modes when the view lacks test-double support, and the return shape. Adequate but not complete.

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

Parameters3/5

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

Schema description coverage is 100%, so all six parameters, including the enum for 'detail' and the transport_request note, are already documented in the schema; the description adds no parameter-level detail beyond the shared CDS-view wording. Baseline 3 applies.

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?

States a specific verb (Create) and resource (ABAP Unit tests for a CDS view) and enumerates the three behaviors performed: test-double eligibility check, test class creation, activation. This distinguishes it from siblings CreateUnitTest and CreateFunctionGroupUnitTest, which target classes and function groups respectively.

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

Usage Guidelines3/5

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

The internal step ordering ('check the view supports CDS test doubles, create a test class, activate it') implies the workflow, but the description never says when to pick this over CreateUnitTest or what prerequisite state the CDS view must be in beyond the schema hint 'must be active'.

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

Deploy Server

Other Tools