abap-unit-testing SKILL.md skillA

abap-unit-testing from likweitan/abap-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add likweitan/abap-skills/abap-unit-testing@git:20260916.c1b7d5e

Pins git:20260916.c1b7d5e in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
likweitan/abap-skills
Path
skills/abap-unit-testing/SKILL.md
Versions recorded
3
Latest version
git:20260916.c1b7d5e, committed Sep 16, 2026
First version recorded
Apr 17, 2026
Size
12,649 bytes
Repository stars
72
License
MIT

Help with ABAP Unit testing including test class setup, assertions, test doubles, mocking frameworks, dependency injection, CDS test environments, SQL test environments, RAP BO test doubles, and test fixtures. Use when users ask about ABAP unit tests, test classes, test methods, CL_ABAP_UNIT_ASSERT, test doubles, mocking, CDS test environment, SQL test environment, RAP testing, ABAP test injection, test seams, behavior-driven testing, TDD in ABAP, test isolation, or writing automated tests for…

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# 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

```abap
"! 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
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add likweitan/abap-skills/abap-unit-testing@sha256:8cba1a00565ed1b2

The line at the top of this page pins the label git:20260916.c1b7d5e, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_gmxlzqjm2f5pwv6x.svg)](https://markdownregistry.com/a/art_gmxlzqjm2f5pwv6x)

2 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 3 versions of this file, between Apr 17, 2026 and Sep 16, 2026, about one every 76 days.

versioncommittedcommitsizeaudit
git:20260916.c1b7d5e latest2026-09-16 c1b7d5e 12,649 BA view · diff
git:20260417.412f5292026-04-17 412f529 12,398 BA view · diff
git:20260417.5860c242026-04-17 5860c24 18,208 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (12649 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

likweitan/abap-skills · 72 stars · license MIT · pushed 2026-11-03 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_gmxlzqjm2f5pwv6x
GET https://markdownregistry.com/api/v1/resolve?ref=likweitan/abap-skills/abap-unit-testing
GET https://markdownregistry.com/api/v1/blob/8cba1a00565ed1b2f1437299796459e6f5b32fd151019d03dfc2cfea2fb41cfc

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from likweitan/abap-skills

abap-cloud-migration SKILL.md skill
likweitan/abap-skills · skills/abap-cloud-migration/SKILL.md · Help with migrating classic ABAP custom code toward higher clean core levels (Level A/B/C/D) including custom code…
git:20260916.c1b7d5e · audit A · 72 stars
abap-cloud SKILL.md skill
likweitan/abap-skills · skills/abap-cloud/SKILL.md · Help with ABAP Cloud development and the clean core level concept (Levels A, B, C, D) including ABAP Cloud vs. classic…
git:20260916.c1b7d5e · audit A · 72 stars
abap-sql-amdp SKILL.md skill
likweitan/abap-skills · skills/abap-sql-amdp/SKILL.md · Help with modern ABAP SQL features and AMDP (ABAP Managed Database Procedures) including inline declarations, window…
git:20260916.c1b7d5e · audit A · 72 stars
abap SKILL.md skill
likweitan/abap-skills · skills/abap/SKILL.md · Comprehensive ABAP code quality checking using abaplint (automated static analysis) and Clean ABAP principles (manual…
git:20261103.0c6e3eb · audit A · 72 stars
abapgit SKILL.md skill
likweitan/abap-skills · skills/abapgit/SKILL.md · Help with abapGit workflows including repository setup, cloning, serialization, branching strategies, transport-vs-git…
git:20260916.c1b7d5e · audit A · 72 stars
atc-cloudification SKILL.md skill
likweitan/abap-skills · skills/atc-cloudification/SKILL.md · Configure ATC clean core and Cloud Readiness checks using the SAP Cloudification Repository, and map ATC findings to…
git:20260916.c1b7d5e · audit A · 72 stars
authorization-iam SKILL.md skill
likweitan/abap-skills · skills/authorization-iam/SKILL.md · Help with ABAP authorization and IAM (Identity and Access Management) including authorization objects, authorization…
git:20260916.c1b7d5e · audit A · 72 stars
badi-enhancement SKILL.md skill
likweitan/abap-skills · skills/badi-enhancement/SKILL.md · Help with BAdI (Business Add-In) development, the ABAP enhancement framework, and the clean core level classification…
git:20260916.c1b7d5e · audit A · 72 stars
btp-abap-environment SKILL.md skill
likweitan/abap-skills · skills/btp-abap-environment/SKILL.md · Help with SAP BTP ABAP Environment setup and development including service instance creation, ADT connectivity…
git:20260916.c1b7d5e · audit A · 72 stars
btp-diagram-generator SKILL.md skill
likweitan/abap-skills · skills/btp-diagram-generator/SKILL.md · Generate SAP BTP (Business Technology Platform) solution architecture diagrams as native draw.io (.drawio) files…
git:20260916.c1b7d5e · audit B · 72 stars
cds-view-entities SKILL.md skill
likweitan/abap-skills · skills/cds-view-entities/SKILL.md · Help with CDS (Core Data Services) view entity development including data modeling, annotations, associations…
git:20260916.c1b7d5e · audit A · 72 stars
odata SKILL.md skill
likweitan/abap-skills · skills/odata/SKILL.md · Help with OData service development in ABAP including OData V2 and V4 services via RAP service bindings, SEGW-based…
git:20260916.c1b7d5e · audit A · 72 stars

Every file in likweitan/abap-skills

Browse by kind, by grade A, or by owner.