Show TOC

Test MethodsLocate this document in the navigation structure

Definition

Test methods are parameterless instance methods of Test Classes and are declared using the FOR TESTING addition to the METHODS statement. Each test method corresponds to an ABAP Unit test. In a test method, the test code is generally implemented by calling production sections of the program under specific starting conditions (fixtures) and checking the results or statuses with the methods of the system class CL_AUNIT_ASSERT.

Currently, all instance methods in global test classes are automatically test methods.

Note

Test methods should be private, or protected if the methods are inherited. Since test classes implicitly offer friendship to the test driver in the runtime environment, the driver can call them. The test methods of a test must only be public in the rare cases where this test is to execute the tests of other test classes.