abap-unit-testing

abap-unit-testing is a skill for Claude Code from likweitan/abap-skills. It costs 165 tokens per session (2,885 once invoked), scanned A, original, MIT.

Guidance for ABAP Unit, SAP’s built-in approach to automated tests for ABAP code. It covers test classes, assertions, test doubles, dependency injection, and isolated test environments for database, CDS, and RAP code.

In plain words
What is it for?
Use it to create ABAP Unit test classes, mock dependencies, test CDS views and SQL code, test RAP behavior, and set up reusable test data.
Why use it?
It helps developers test business logic without relying on persistent data or external systems, making failures easier to understand.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the sap-abap plugin — 18 skills shipped together

Good fit Use it to create ABAP Unit test classes, mock dependencies, test CDS views and SQL code, test RAP behavior, and set up reusable test data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/likweitan/abap-skills/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 likweitan/abap-skills --skill abap-unit-testing
Clone the repo
git clone --depth 1 https://github.com/likweitan/abap-skills

Made for: Claude Code.

Or install sap-abap, the plugin that ships this one along with the rest of its 18 skills.

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/likweitan/abap-skills/abap-unit-testing/github.svg)](https://agentmods.dev/skills/likweitan/abap-skills/abap-unit-testing)
Your own site
<a href="https://agentmods.dev/skills/likweitan/abap-skills/abap-unit-testing"><img src="https://agentmods.dev/badge/skills/likweitan/abap-skills/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/likweitan/abap-skills/abap-unit-testing"><img src="https://agentmods.dev/badge/skills/likweitan/abap-skills/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 2,885 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.02885
Opus 5 $0.00082 $0.01443
Sonnet 5 $0.00033 $0.00577
Haiku 4.5 $0.00016 $0.00288

Measured 10d ago against content hash bded07283df9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 10d 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

Copies of this mod

1 near-identical copy found in the catalogue:

skills/abap-unit-testing/SKILL.md · 317 lines

How it starts

The opening of the file, as written. The whole thing — 317 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 · 317 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. 10d ago First seen · 317 lines · 165 tokens per session scan A bded07283df9

Subscribe to this mod's changes

abap-unit-testing is a skill published in the GitHub repository likweitan/abap-skills (60 stars, last pushed 14d ago), licensed MIT. It adds 165 tokens to every session and 2,885 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

create-python-tests

Instructions on how to write Python unit tests to verify a Cortex data product's transformation logic, filters, and field mappings.

GoogleCloudPlatform/cortex-framework · 28 tokens

sap-sac-test-automation

SAP Analytics Cloud (SAC) automated testing skill for designing capability-gated browser discovery and deterministic Playwright test suites for SAC stories, dashboards, reports, planning workflows, comments, permissions, visual regression, and reusable QA automation. This skill should be used when building SAC…

secondsky/sap-skills · 151 tokens

transport-release-gate

Run a quality gate over an SAP transport request before it is released — collect the TR's objects, check for inactive objects and foreign locks, run syntax checks, ATC, and unit tests, then produce a structured go/no-go report. Use whenever the user wants to release a transport, asks "is this TR safe to release?"…

yzonur/sap-adt-mcp · 131 tokens

testing-strategy

Use when designing, planning, or executing a testing strategy for an SAP implementation, upgrade, or change project. Triggers on any request involving test planning, UAT, test cases, test automation, defect management, or sign-off readiness.

vigneshbarani24/sap-superpowers · 52 tokens

self-correcting-loop

Use when generated or modified ABAP code has syntax errors, ATC findings, test failures, or activation issues. Runs an iterative fix-check-fix loop until the code is clean, tested, and activated. Equivalent to a persistent development TDD cycle.

vigneshbarani24/sap-superpowers · 57 tokens

verification-before-completion

Use before claiming ANY task is complete. Activates at the end of every skill execution, every deliverable generation, and every user request fulfillment. Blocks completion claims that lack enumerated evidence.

vigneshbarani24/sap-superpowers · 43 tokens