abap-unit-testing

abap-unit-testing is a skill for Claude Code, Codex from Ciltress/sap-abap-mcp. It costs 165 tokens per session (3,166 once invoked), scanned A, a copy of abap-unit-testing, MIT.

Guidance for ABAP Unit, SAP's built-in framework for automated tests in ABAP. It covers test classes, assertions, test doubles, dependency injection, and test environments for database and application behavior.

In plain words
What is it for?
Testing class logic, CDS views, database-dependent code, external dependencies, and RAP business object behavior.
Why use it?
It helps test ABAP code without relying on persistent data or external systems, making failures easier to isolate.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Testing class logic, CDS views, database-dependent code, external dependencies, and RAP business object behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ciltress/sap-abap-mcp/abap-unit-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Ciltress/sap-abap-mcp --skill abap-unit-testing
Clone the repo
git clone --depth 1 https://github.com/Ciltress/sap-abap-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for abap-unit-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/ciltress/sap-abap-mcp/abap-unit-testing/github.svg)](https://agentmods.dev/skills/ciltress/sap-abap-mcp/abap-unit-testing)
Your own site
<a href="https://agentmods.dev/skills/ciltress/sap-abap-mcp/abap-unit-testing"><img src="https://agentmods.dev/badge/skills/ciltress/sap-abap-mcp/abap-unit-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for abap-unit-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/ciltress/sap-abap-mcp/abap-unit-testing"><img src="https://agentmods.dev/badge/skills/ciltress/sap-abap-mcp/abap-unit-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 165 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,166 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00165 $0.03166
Opus 5 $0.00082 $0.01583
Sonnet 5 $0.00033 $0.00633
Haiku 4.5 $0.00016 $0.00317

Measured 9d ago against content hash d3aa1c6fdcd2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

abap-unit-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

89% identical to abap-unit-testing — 23 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/ABAP/skills/abap-unit-testing/SKILL.md · 340 lines

How it starts

The opening of the file, as written. The whole thing — 340 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ABAP Unit Testing

Guide for writing effective ABAP Unit tests including test class setup, assertions, test doubles, mocking frameworks, and test environments for CDS, SQL, and RAP.

Workflow

  1. Determine the testing goal:

    • Testing business logic in a class method
    • Testing a CDS view entity
    • Testing a RAP BO behavior implementation
    • Testing database-dependent logic with SQL test doubles
    • Setting up test doubles for external dependencies
  2. Choose the right approach:

    • Direct unit test for pure logic (no dependencies)
    • Constructor/setter injection for mockable dependencies
    • CDS test environment for CDS view tests
    • OSQL test environment for SQL-dependent code
    • RAP BO test doubles for RAP behavior tests
  3. Follow the AAA pattern: Arrange → Act → Assert

  4. Ensure test isolation: Tests must not depend on persistent data or external systems

Test Class Fundamentals

Test Class Definition

"! Test class for ZCL_MY_CLASS
CLASS ltc_my_class DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.

  PRIVATE SECTION.
    DATA cut TYPE REF TO zcl_my_class.  "Class Under Test

    CLASS-METHODS class_setup.    "Once before all tests
    CLASS-METHODS class_teardown. "Once after all tests
    METHODS setup.               "Before each test
    METHODS teardown.            "After each test

    METHODS test_calculate_total FOR TESTING.
    METHODS test_validate_input  FOR TESTING.
    METHODS test_empty_input     FOR TESTING RAISING cx_static_check.
ENDCLASS.

CLASS ltc_my_class IMPLEMENTATION.

  METHOD class_setup.
    " One-time setup for all tests in this class
  ENDMETHOD.

  METHOD class_teardown.
    " One-time cleanup
  ENDMETHOD.

  METHOD setup.
    " Create fresh instance before each test
    cut = NEW #( ).
  ENDMETHOD.

  METHOD teardown.
    " Cleanup after each test
  ENDMETHOD.

  METHOD test_calculate_total.
    " Arrange
    DATA(lv_quantity) = 5.
    DATA(lv_price) = CONV decfloat34( '10.50' ).

    " Act
    DATA(lv_result) = cut->calculate_total(
      iv_quantity = lv_quantity
      iv_price    = lv_price ).

    " Assert
    cl_abap_unit_assert=>assert_equals(
      act = lv_result
      exp = CONV decfloat34( '52.50' )
      msg = 'Total should be quantity * price' ).
  ENDMETHOD.

  METHOD test_validate_input.
    cl_abap_unit_assert=>assert_true(
      act = cut->validate_input( 'VALID_INPUT' )
      msg = 'Valid input should return true' ).
  ENDMETHOD.

  METHOD test_empty_input.
    TRY.
        cut->validate_input( '' ).
        cl_abap_unit_assert=>fail( msg = 'Should have raised exception' ).
      CATCH zcx_validation_error INTO DATA(lx_error).
        cl_abap_unit_assert=>assert_bound(
          act = lx_error
          msg = 'Exception should be raised for empty input' ).
    ENDTRY.
  ENDMETHOD.

ENDCLASS.

Read the full file on GitHub · 340 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 340 lines · 165 tokens per session scan A d3aa1c6fdcd2

Subscribe to this mod's changes

abap-unit-testing is a skill published in the GitHub repository Ciltress/sap-abap-mcp (3 stars, last pushed 17d ago), licensed MIT. It adds 165 tokens to every session and 3,166 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. It is 89% identical to abap-unit-testing, differing in 23 lines, and is treated as a copy.