Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  program editing →  Testing and Checking Programs 

ABAP Unit

ABAP Unit is a test framework for unit tests. ABAP Unit can be used to:

  • run single tests or mass tests
  • evaluate test results

Single texts can be started directly in the tool for the program in question. More comprehensive test runs are executed from ABAP Unit Browser in ABAP Workbench or by using ABAP Test Cockpit. ABAP Unit is closely associated with Coverage Analyzer, enabling test coverage to be measured as well.

In ABAP programs, unit tests are performed as test methods in local test classes. They are not part of the production code of a program, but are transported in the same way. Test methods of this type are executed and evaluated using ABAP Unit Framework. The test methods generally call the tested units of the production code and then check the results using methods of the class CL_ABAP_UNIT_ASSERT. Test classes and test methods are defined using the following language elements. Special test includes are used to define test classes in class pools and function groups.

If test classes implement interfaces, then not all interface methods generally need to be implemented there. The error message or warning that otherwise occurs can be hidden in test classes by using an addition of the statement INTERFACES.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • All components required for tests in the context of ABAP Unit should be defined exclusively in test classes. This ensures that they are not generated in production systems and cannot be addressed by production code. Alongside test classes with test methods, this also includes test dummies and other helper classes that do not contain test methods.

  • For more information, see the

SAP NetWeaver documentation in SAP Help Portal.

Continue

CLASS - FOR TESTING

METHODS - FOR TESTING

INTERFACES - PARTIALLY IMPLEMENTED