regression_test
A snapshot library for ABAP that records a value once and compares against it on every later run, from either the debugger or a unit test, storing snapshots in eCATT test data containers.
Snapshot testing in ABAP: a value is recorded once, trusted as correct, and later runs are compared against it. Inside a unit test that is class zdbgl_snapshots_tdc, whose compare_or_record either compares the value it is given with the recorded one or records it, each value under a unique name, with the SET/GET parameter ZDBGL_SNAP_RECORD deciding which; the snapshot is stored in an eCATT test data container and compared through cl_abap_unit_assert=>assert_equals unless the compare method is overridden. The other route is the debugger script zdbgl_script_store_in_tdc, which writes a snapshot at a breakpoint into a test data container that already exists, and a unit test then reads it back with cl_apl_ecatt_tdc_api; the README gives this as the way around the COMMIT WORK that updating a snapshot from a unit test issues. A legacy API that kept debugger snapshots in the database tables zdbgl_variables and zdbgl_locals is documented separately, in the repository's docs folder.
Facts
Where it sits
Who is behind it
In the atlas: maintains 1, contributes to 7@germanysourcesmaintainer
Before choosing this
Signals
ActivityQuietNo published releases; repository quiet for 28 months
It publishes no releases, and its repository has been quiet for at least 24 full months. This may be normal for stable software; check whether its current state still fits your use.
Conditions
PracticalFunctional boundary
Values the test data container cannot hold: references of any kind, complex structures, and tables whose line type is a complex structure or another table. Structures must be defined in the ABAP Dictionary, so one declared locally cannot be stored at all.
What it declares
Every artifact
- Type
- Package
- Origin
- Independently maintained
As a package
- Where it runs
- Inside its host
- Distributed through
- abapGit
Connections
Testing application logic, with test doubles for its dependencies
Logging library for ABAP over the Application Log
Git client written in ABAP that runs inside the system
Download
README
quoted from germanysources/regression_test under MIT, readSnapshots in ABAP
Snapshots
Create snapshots either in the debugger or directly in your unit-tests. Snapshots are stored in ECATT test data containers (TDC).
Unit-Test
Snapshots can be created with class zdbgl_snapshots_tdc.
The following listing shows a sample unit-test using snapshots.
CLASS test_snapshot DEFINITION FOR TESTING
DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS flight_test FOR TESTING
RAISING zcx_dbgl_snapshot.
ENDCLASS.
CLASS test_snapshot IMPLEMENTATION.
METHOD flight_test.
DATA(snapshot_manager) = zdbgl_snapshots_tdc=>create_default(
tdc_name = 'ZDBGL_SNAPSHOT_SAMPLE'
).
DATA(carrier) = VALUE scarr_tab(
( carrid = 'SAP' carrname = 'SAP Flights' )
( carrid = 'IN' carrname = 'Internat. Airways' )
).
DATA(flight) = VALUE sflight( carrid = 'SAP' connid = 700 fldate = '20201231' ).
snapshot_manager->compare_or_record( name = 'CARRIER' actual = carrier ).
snapshot_manager->compare_or_record( name = 'FLIGHT' actual = flight ).
" can be omitted, when autosave = abap_true in factory method or constructor
snapshot_manager->commit_changes( ).
ENDMETHOD.
ENDCLASS.
The method snapshot_manager->compare_or_record compares the given value with the recorded value or records the value. We need to give every value a unique name in the parameter name.
The behavior (recording or comparing) is controlled with the SET/GET-parameter ZDBGL_SNAP_RECORD.
A value of 'X' means 'create/update the snapshot'.

Comparison
The standard implementation uses the method cl_abap_unit_assert=>assert_equals for comparison.
Override the method zdbgl_snapshots_tdc=>compare to specify another comparison method.
Restrictions
- Structures must be defined in the ABAP dictionary. Structures defined outside of the ABAP dictionary can't be stored in test data containers.
- Any kind of references (pointing to classes, interfaces or data objects) are not supported
- Updating a snapshot closes the SAP-LUW with
COMMIT WORK. To avoid this, use debugger snapshots as described in the next section.
Debugger
Create snapshots
Another option to create snapshots is the debugger script zdbgl_script_store_in_tdc.
Prerequisite is an existing TDC.
Prerequisite step: create ECATT test data container
Go the transaction secatt and create a test data container. Add a parameter for every variable you want to record. The parameter should have the same name and type as the variable.
Last but not least give the test data container API access as shown in the picture below.

Before the modification
Set an appropriate breakpoint and create the snapshot with the debugger-script zdbgl_script_store_in_tdc.
This script asks you for the name, the version and the variant of the test data container as shown in the picture below.

Writing unit-tests
With the API in the class cl_apl_ecatt_tdc_api we can access the snapshot.
Example
The example can be found in the program zdbgl_demo_regression_test.
The procedure to_verify is the procedure under test.
FORM to_verify.
FIELD-SYMBOLS: <line> TYPE sflight.
APPEND INITIAL LINE TO demo_itab ASSIGNING <line>.
<line>-carrid = 'LH'.
<line>-connid = '3444'.
<line>-price = 400.
ENDFORM.
In the first step we create a snapshot before and after this procedure is executed.
In the second step we use the snapshot (test data container "ZDBGL_SAMPLE") to write unit-tests:
REPORT ZDBGL_DEMO_REGRESSION_TEST.
DATA: demo_itab TYPE STANDARD TABLE OF sflight.
START-OF-SELECTION.
FIELD-SYMBOLS: <line> TYPE sflight.
APPEND INITIAL LINE TO demo_itab ASSIGNING <line>.
<line>-carrid = 'LH'.
<line>-connid = '3445'.
<line>-price = 500.
BREAK-POINT. "snapshot is created
PERFORM to_verify.
BREAK-POINT. "snapshot is created
" subprogram should be verified.
" It changes the global variable demo_itab.
FORM to_verify.
FIELD-SYMBOLS: <line> TYPE sflight.
APPEND INITIAL LINE TO demo_itab ASSIGNING <line>.
<line>-carrid = 'LH'.
<line>-connid = '3444'.
<line>-price = 400.
ENDFORM.
CLASS regression_test DEFINITION FOR TESTING
DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA: tdc_accessor TYPE REF TO cl_apl_ecatt_tdc_api.
METHODS setup
RAISING cx_static_check.
METHODS verify_changed_itab FOR TESTING
RAISING cx_static_check.
ENDCLASS.
CLASS regression_test IMPLEMENTATION.
METHOD setup.
tdc_accessor = cl_apl_ecatt_tdc_api=>get_instance( EXPORTING
i_testdatacontainer = 'ZDBGL_SAMPLE' i_testdatacontainer_version = 1 ).
ENDMETHOD.
METHOD verify_changed_itab.
DATA: exp_demo_itab LIKE demo_itab.
" given: use the snapshot before procedure under test was executed
tdc_accessor->get_value( EXPORTING i_param_name = 'DEMO_ITAB' i_variant_name = 'BEFORE'
CHANGING e_param_value = demo_itab ).
" when: execute procedure under test
PERFORM to_verify.
" then: use the snapshot after the procedure under test was executed
tdc_accessor->get_value( EXPORTING i_param_name = 'DEMO_ITAB' i_variant_name = 'AFTER'
CHANGING e_param_value = exp_demo_itab ).
cl_abap_unit_assert=>assert_equals( exp = exp_demo_itab
act = demo_itab msg = 'Regression test not passed' ).
ENDMETHOD.
ENDCLASS.
Restrictions
These types are currently supported:
- simple types (like characters, strings, integer)
- flat structures (complex structures containing components with tables or structures are not supported)
- tables with a flat structure or a simple type as the table line type
These types are not supported:
- all form of references
- complex structures
- tables with complex structures as the table line type or with tables as the table line type
Legacy API
There is a legacy API to create snapshots in the debugger, which uses the database tables zdbgl_variables and zdbgl_locals as a temporary storage and which is bit more difficult to use. This API is documented in the docs-folder.
Installation
Installation is done with abapGit. ABAP 7.40 or higher is needed.
All ABAP-objects have the prefix zdbgl.
Logs
Exceptions are logged in the checkpoint-groups "zdbgl_store_globals" and "zdbgl_store_locals" (see transaction saab).
Logging is only active, if the checkpoint-groups is activated.
Dependencies
- ABAP-Logger is used for display interactive messages
Others providing
Compare all 21 on the Unit testing page →- abap2UI5 headless frontendabap2UI5 headless frontendPlays the frontend's side of the abap2UI5 request/response contract in ABAP, so an app class is driven and asserted on from a plain ABAP Unit test.community org, abapDrives abap2UI5 app classes from ABAP Unit testsfrom ABAP
- @abap2ui5/mcp-server@abap2ui5/mcp-serverAn MCP server that puts the abap2UI5 development loop on the machine an agent runs on: check the view the ABAP builds, photograph it, deploy the class into a sandbox, boot the app headless and read the errors.community org, abapMCP server for the abap2UI5 check, deploy and run loopfrom ABAP
- assertassertA fluent assertion helper for ABAP Unit tests that wraps cl_abap_unit_assert in chained calls such as assert(x)->equals(y), also usable outside tests through ZCL_ASSERTABLE.independent, abapFluent assertion helper for ABAP Unit testsfrom ABAP
- @abaplint/transpiler@abaplint/transpilerTranspiles ABAP 7.02 syntax to ES6 JavaScript, so ABAP code and its unit tests run on Node.js in CI without an ABAP system, with optional SQLite, PostgreSQL, Snowflake or SAP HANA drivers.community org, abapTranspiles ABAP to JavaScript to run on Node.jsfrom ABAP
- Modernization Agents for SAP on AWSModernization Agents for SAP on AWSAWS's suite of agents for SAP modernisation work: custom ABAP converted for S/4HANA, PI/PO interfaces moved to Integration Suite, BW objects moved to SAP Datasphere, deployed into a customer's own AWS account and reached only after registration.partner, abapAWS agents for ABAP, PI/PO and BW modernisation workfrom ABAP
- abap_db_preparatorabap_db_preparatorA wrapper over ABAP's OpenSQL replacement service that exports chosen rows into a stored bundle and, in a unit test's setup, replays it as fake table content in two method calls.independent, abapReplays stored database snapshots in ABAP unit testsfrom ABAP
- cacamber-BDD-for-ABAPcacamber-BDD-for-ABAPA BDD framework for ABAP that turns Gherkin-style Given/When/Then scenarios into ABAP Unit test steps, matching each step against a regular expression and calling the test class method it maps to.independent, abapBDD framework turning Given/When/Then into ABAP Unit stepsfrom ABAP
- abap-utesthelpabap-utesthelpTwo helper classes for ABAP Unit tests: one verifies a domain constant class against its domain's fixed values, the other creates test doubles without naming the interface.independent, abapHelper classes for ABAP Unit tests and test doublesfrom ABAP
- abapCovabapCovA report, ZABAPCOV, that uploads ABAP Unit test code coverage results to codecov.io, once the repository is installed through abapGit and codecov.io's certificates through STRUST.independent, abapUploads ABAP Unit code coverage to codecov.iofrom ABAP
- ABAP remote filesystemABAP remote filesystemA Visual Studio Code extension that opens an ABAP system over ADT as an editable filesystem and exposes system tools to GitHub Copilot and external MCP clients.independent, abapVS Code extension editing ABAP systems over ADT as a filesystemfrom ABAP
- open-steamgateopen-steamgateAn ABAP application server you clone and run on your own machine: transpiled ABAP serving classic /IWBEP/ OData v2 to Fiori over a local database, with no SAP system attached.independent, abapLocal ABAP server serving /IWBEP/ OData v2 without an SAP systemfrom ABAP
- express-icf-shimexpress-icf-shimA shim that runs an ABAP ICF handler written against if_http_extension behind an Express 4.x server, for ABAP transpiled to JavaScript and run on Node.js in testing and continuous integration.community org, abapShim running an ABAP ICF handler behind an Express 4.x serverfrom ABAP
- open-abap-coreopen-abap-coreReusable ABAP functionality for code transpiled by @abaplint/transpiler: the core ABAP artifacts that code runs against on Node.js.community org, abapCore ABAP artifacts for code transpiled by @abaplint/transpilerfrom ABAP
- mockup_loadermockup_loaderA tool that loads ABAP unit test data prepared in Excel as TAB-delimited text into ABAP structures and tables, and generates interface stubs that return that mock data.independent, abapLoader of Excel-prepared ABAP unit test data, with stub generationfrom ABAP
- mockAmockAA free mocking framework for ABAP, published under the Apache License 2.0.independent, abapA free mocking framework for ABAP, published under the Apache License 2.0.from ABAP
- Vise_for_ABAPVise_for_ABAPA characterisation-test helper: ZCL_VISE=>GRIP records a field's value once and fails a later run if it has changed.independent, abapA characterisation-test helper: `ZCL_VISE=>GRIP` records a field's value once and fails a later run if it has changed.from ABAP
- abap-senchaabap-senchaA BDD/TDD assertion library for ABAP Unit, styled after the JavaScript library Chai.js, that wraps cl_abap_unit_assert in chainable expect, should and assert styles.independent, abapBDD/TDD assertion library for ABAP Unit, styled after Chai.jsfrom ABAP
- abap-test-containerabap-test-containerA test data container for ABAP Cloud that loads unit test data in JSON, XML or raw formats from GitHub and maps it onto the target structure, filling the platform's missing native one.independent, abapGitHub-hosted test data container for ABAP Cloudfrom ABAP
- abap-unit-runnerabap-unit-runnerAn application job that runs and schedules ABAP Unit tests in SAP's ABAP Environment through the SAP_COM_0735 API, where the on-premise test runner has no SAP GUI to run from.independent, abapApplication job that runs and schedules ABAP Unit tests in the cloudfrom ABAP
- adash-servicesadash-servicesThe backend service behind ADASH Cli, exposing ABAP Unit test runs and coverage as REST and OData services for CI/CD pipelines, with a report scheduled to run tests per package.independent, abapBackend exposing ABAP Unit runs and coverage over REST and ODatafrom ABAP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
abaplint
History in the atlas
- First seen.
For your agent
- Ref
artifact:germanysources-regression-test- JSON
- /artifacts/germanysources-regression-test.json
- MCP
- Connecting an agent