
Checkpoints
Checkpoints in ABAP are non-operational statements that are used solely for test purposes. Checkpoints can be "always active" or activatible. The latter type are ignored unless they are activated explicitly in the system first. This can be done while the system is running and restricted to specified users or application servers.
Breakpoints
The statement BREAK-POINT is used to define a breakpoint. In dialog programming, the program is paused when this statement is reached and the ABAP debugger is started. In background processing, the execution of the program is not interrupted. This statement has an "always active" variant and an activatible variant.
Logpoints
The statement LOG-POINT is used to log the program flow. The occurrence of this statement is recorded in an aggregating log. As an option, variable content can also be included in the log. This statement is only possible in an activatible variant.
Assertions
The statement ASSERT represents an assertion, which can be used to check the associated logical expression at runtime. If the logical condition is not met, and the assertion is an "always active" assertion, a runtime error occurs. If the assertion is activatible, the program can be paused in the debugger in the same way as BREAK-POINT or the logging configured in the same way as LOG-POINT. In non-active assertions, the logical expression is not evaluated.
Unit Tests
In each ABAP program, unit tests can be incorporated by declaring and implementing a local test class. The addition FOR TESTING of the statement CLASS DEFINITION flags a local class as a test class. Within the test class, test methods can be implemented that call the functions of the wrapper program and verify the results. The wrapper program cannot, however, access components of the test class.
Test methods within a test class are flagged using the addition FOR TESTING of the statement METHODS. In a test run started from ABAP Workbench or Eclipse, the runtime environment executes the test methods in sequence. The test methods report their results to the unit test infrastructure using methods of the class cl_aunit_assert. A text class can contain other methods alongside the test methods. Private methods with the following predefined names can be implemented to construct suitable test configurations (also known as fixtures): class_setup, class_teardown, setup, and teardown. The first two methods are static and are executed once automatically either before or after all tests in the class. The latter two methods are instance methods are called by the runtime environment before or after each execution of a text method.