Skip to main content
Glama

CreateCdsUnitTest

Creates an ABAP Unit test class for a CDS view from supplied test source. Use it to add test-double-based tests when the view supports CDS test doubles.

Instructions

Creates an ABAP Unit test class for a CDS view (DDLS), from the test class source given, once the view supports CDS test doubles.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cds_view_name": "<cds_view_name>",
      "class_name": "<class_name>",
      "package_name": "<package_name>",
      "test_class_source": "<test_class_source>"
    },
    "name": "CreateCdsUnitTest"
  }
}

Input Schema

NameRequiredDescriptionDefault
detailNoHow much of the answer to return: "terse" (default) what a next call needs: the identifiers and a short description; "medium" every item the tool read, with its main properties; "full" the tool's whole answer; "raw" what SAP sent.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. Changed3 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / detail / description
      Previous value: -"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)."New value: +"How much of the answer to return: \"terse\" (default) what a next call needs: the identifiers and a short description; \"medium\" every item the tool read, with its main properties; \"full\" the tool's whole answer; \"raw\" what SAP sent."
    • changedInput schema / properties / detail / enum
      Previous value: -[
      -  "terse",
      -  "full",
      -  "raw"
      -]New value: +[
      +  "terse",
      +  "medium",
      +  "full",
      +  "raw"
      +]
  2. 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"
      +]
  3. 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"
      +]
  4. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden for a write operation. It implies creation but never covers what happens on name collision, permission or transport requirements (only the schema mentions transport_request), or whether the call is idempotent, which is thin for a mutating tool with zero annotation coverage.

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 the resource and precondition up front and no padding. The trailing clause 'from the test class source given, once the view supports CDS test doubles' is slightly tangled but not wasteful.

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?

With six parameters, no annotations and no output schema, the definition is minimally adequate: it conveys what is created and the key precondition, but omits return shape and failure behavior that an agent would need to plan the next step.

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 the baseline is 3; the description only restates that the test class source is 'given' and that the CDS view is the one under test, adding no syntax, format or naming-convention guidance beyond the schema.

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

Purpose4/5

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

States a specific verb and resource: 'Creates an ABAP Unit test class for a CDS view (DDLS)', which distinguishes it from the sibling creators for programs, function groups and generic unit tests. It does not name any sibling explicitly, so the differentiation is inferred from the resource rather than stated.

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?

Gives one real precondition: the view must support CDS test doubles. It does not say what to do when that condition fails, nor point to alternatives such as CreateUnitTest or the Update/Delete variants for an existing test class, leaving routing to inference.

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