Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

RAP400 - Writing ABAP Unit Tests for Apps built with the ABAP RESTful Application Programming Model (RAP)

Build and test modern Apps with the ABAP RESTful Application Programming Model (RAP)

Description

This repository contains the exercise materials for a RAP workshop on testability called RAP400 - Writing ABAP Unit Tests for Apps built with the ABAP RESTful Application Programming Model (RAP) - which is all about quality assurance in the development of modern Apps with RAP.

Overview

In this session we will guide you through the development of a transactional UI service and the creation of different types of ABAP Unit tests for a RAP business object (BO) developed with the ABAP RESTful Application Programming Model (RAP) and and the OData service exposing the BO for a transactional SAP Fiori elements-based application.

The RAP service to be tested with ABAP unit tests will be exposed for a UI use case with the OData V2 protocol, and the resulting app will look like this:

RAP400 Overview - Travel

RAP400 Overview - ABAP Unit Testing

You will write different ABAP Unit tests in the following exercises to ensure the quality of an OData service developed with the ABAP RESTful Application Programming Model. The OData service is based on the ABAP Flight Reference Scenario. It is the underlying UI service of a SAP Fiori elements based Travel managing app - i.e. creating, updating and deleting travel records.

Please Note
The focus of this session is not on any development methodology such as Agile/Scrum or test-driven development (TDD), but rather on the technical implementation of unit tests, i.e. how to write ABAP unit tests for a given RAP based applications.

About ABAP Unit Tests

Ensuring the high quality of applications has a very high priority in the whole software development lifecycle. As an application developer, you want to be able to write, for example, unit, scenario and integration tests to verify the application behavior as a whole. The ABAP platform offers different mechanisms and frameworks to achieve this. The main options here are ABAP Unit Tests und the ABAP Test Cockpit.

Writing ABAP Unit tests is the way to provide high quality software, which can be easily evolved over time without introducing regressions. In methodologies, like extreme programming and test driven development, the role of unit testing is even more important.

ABAP unit is the state-of-the-art unit testing framework for ABAP. It's embedded into the ABAP programming language which supports you in writing unit tests. In ADT you have various possibilities to execute the unit tests and to evaluate the results concerning functional correctness and code coverage.

Read more:

Requirements

The requirements to follow the exercises in this repository are:

Exercises

Follow these steps to build a RAP-based simple App with a helper class and write various ABAP unit tests for it.

Exercises
Getting Started
Exercise 1 - Build your transactional UI service
Exercise 2 - Write ABAP Unit Tests using Local Method Invocation
Exercise 3 - Write ABAP Unit Tests using Entity Manipulation Language (EML)
Exercise 4 - Write ABAP Unit Tests using the Local Proxy Client (LCP)

How to obtain support

Support for the content in this repository is available during the actual time of the online session for which this content has been designed. Otherwise, you may request support via the Issues tab.

How to get familiar with the ABAP RESTful Application Programming Model

You can find further information on the ABAP RESTful Application Programming Model (RAP) here:

License

Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.