ABAP Unit is a unit-testing framework that is integrated into the ABAP language.
In unit testing, a developer ensures that the correct behavior of the smallest testable units –
such as the methods of classes – of his or her code is verifiable. Unit testing makes it
easier to verify quality, to refactor code, to perform regression testing, and to
implement according to the test-driven development model.
The most important features for developing ABAP unit tests are the following:
- ABAP Unit tests are written in ABAP. You do not have to learn an additional scripting
language for testing.
- You write tests with the standard ABAP Development Tools (ADT). You do not have to use
additional tools for developing tests.
- ABAP Unit tests are transported with the ABAP repository objects that they test. They are
therefore available in all of the systems of your development and testing landscape.
The most important features of ABAP Unit for running and evaluating unit tests are these:
- You can run ABAP Unit tests as you develop code. You can start tests, for example, directly from the ABAP editor
in the ADT.
- Code coverage measurement is integrated into ABAP Unit testing, so that you can verify the thoroughness
of your unit testing and easily find untested code.
- ABAP Unit is integrated into the Checking Quality of ABAP Code with ATC,
so that unit testing can be automated and is part of mass quality testing.
- Test results are displayed in the ABAP Unit Runner view for easy evaluation and
analysis.
- ABAP Unit test methods have no parameters. No special knowledge or test framework is
required to run ABAP tests; they can be run by anyone, and not just by the developer.
- ABAP Unit tests cannot be executed in productively used ABAP systems.