ABAP UNIT

Module Objectives

  • Purpose of ABAP Unit
  • Creating Unit Tests
  • Fixture Methods
  • ABAP Unit Test Class Wizard
  • ABAP Unit Test Classes in ADT

Purpose of ABAP Unit

  • ABAP Unit is part of the test landscape for ABAP programs. ABAP Unit lets you implement unit tests.
  • ABAP unit tests are methods of specially designated ABAP classes. Test methods work as scripts, with which code under test can be run, and with which the results of a test can be evaluated.
  • ABAP unit lets you test the code at unit level, independent of the entire solution.

Creating Unit Tests

ABAP unit tests are implemented in the form of test methods in local test classes in any ABAP programs. The expected results are checked with static methods of help class CL_ABAP_UNIT_ASSERT or CL_AUNIT_ASSERT.

Unit test
Unit test


Test Properties

Risk Level

  • Harmless – the test does not affect any existing processes and/or Database data.
  • Dangerous– the test will change Database or Persistent Data
  • Critical – the test will affect customizing data

Duration

  • Short – test run is expected to take less than a minute
  • Medium - test run is expected to take up to 10 minutes
  • Long - test run is expected to run for more than 10 minutes

Methods of CL_AUNIT_ASSERT:

Methods of CL_AUNIT_ASSERT
Methods of CL_AUNIT_ASSERT

Fixture Methods

  • Test fixture is the test configuration like test data or test objects. This data would be used within the test methods.
  • Fixture methods would be executed before the actual test method gets executed. So when the test is getting performed, the test data or test objects setup in fixture method can be used.
  • In ABAP, the test fixture is achieved using predefined methods. These method would be called automatically by ABAP framework if they exist in the test class.
  • SETUP()

This method is triggered before the execution of a test method
  • TEARDOWN()

This method is triggered after the execution of a test method
  • CLASS_SETUP()

This method is triggered before the execution of ALL test methods
  • CLASS_TEARDOWN()

This method is triggered after the execution of ALL test methods

ABAP Unit Test Class Wizard

We can use the ABAP Unit Test Class wizard to generate a local ABAP class for unit testing.
Note the following about the wizard:
  • It is usable only with ABAP class pools or function pools. For other types of programs (such as reports) you must create the local ABAP Unit test class manually.
  • It generates a basic local test class. You will still need to provide any fixture setup and teardown, adjust the calls to your methods, and adjust the assert conditions in the test methods.
ABAP Unit Test Classes in ADT
ABAP Unit Test Classes in ADT

Comments

  1. Really nice topics you had discussed above. I am much impressed. Thank you for providing this nice information here.

    Game Testing Company

    Video Game Testing Company

    Mobile Game Testing

    Focus Group Testing

    Game QA Testing

    ReplyDelete
  2. As we know there are many companies which are converting into Big data cloud solutions. with the right direction we can definitely predict the future.

    ReplyDelete
  3. Looking for the best SAP Ariba Training in Bangalore, then don't delay join IntelliMindz SAP Ariba Training in Bangalore. Join our SAP Ariba training to get hands-on training and practice in SAP Ariba Software. Any Queries call @ 9655877677. IntelliMindz is the best IT Training Institute in Bangalore with placement, offering 200 and more software courses with 100% Placement Assistance.
    SAP Ariba in Bangalore
    SAP Ariba in Chennai
    SAP Ariba Online Course

    ReplyDelete
  4. Abap Unit >>>>> Download Now

    >>>>> Download Full

    Abap Unit >>>>> Download LINK

    >>>>> Download Now

    Abap Unit >>>>> Download Full

    >>>>> Download LINK zo

    ReplyDelete

Post a Comment

Popular posts from this blog

SAP ABAP SELECT STATEMENT

SAP ADOBE FORMS

ABAP AUTHORIZATION CONCEPT