Test-Driven Development with Int4 IFTT

icon__calendar 2020-11-24

In this article you will learn:

  • The concept of Test-Driven Development (TDD) approach
  • How the Int4 IFTT tool enables this development technique in SAP projects

Reading time: 4 minutes

Introduction

Test-Driven Development is a development approach relying on software requirements being converted to test cases before the software implementation. It is based on a simple idea, where you first create a test to verify the code which will be implemented afterwards and then do refactoring of the development (this cycle is presented in Figure 1.). Such a methodology has many advantages. Already at the beginning of creating a new functionality you know what conditions must be fulfilled to consider its implementation as correct. Despite this, it is still a rarely used practice, especially in SAP projects. Even though there are tools that allow its enablement, such as ABAP Unit Test Framework available in ABAP Development Tools or when it comes to the SAP integration area – Int4 IFTT.

Figure 1. Test-driven development lifecycle

Figure 1. Test-driven development life cycle

 

Enablement of Test-Driven Development for SAP APIs

The idea behind the TTD practice for SAP Application Programming Interfaces (APIs) is generally the same as in the context of classical software development. Whereas in terms of creating SAP interfaces, a useful thing is that often even before the implementation starts, we already know what input/output messages we expect for the systems involved into the interface to be created. This conclusion is used by one of the new Int4 IFTT functionalities called Int4 IFTT Test Case Loader. Thanks to this functinality you can upload test cases into the testing tool. Thus using the Int4 IFTT you will be able to improve application of the Test-Driven Development key elements while creating SAP APIs, i.e. first of all create test cases and then on their basis validate the implemented scenario, which in turn allows the refactoring and optimization of the solution being created.

 

Int4 IFTT Test Case Loader

Overview

The Int4 IFTT Test Case Loader is a feature thanks to which you can create test cases by uploading payloads extracted from external middleware (also non-SAP) into Int4 IFTT tool since it can cater for uploading of XML and flat files. It means that this functionality may be particularly useful in e.g. SAP PI/PO migration projects but as well when creating new SAP interfaces from scratch. The Loader feature enables uploading a single test case (consisting of a pair of input and output payloads) or mass upload from a folder using regular expression to match the input/output files. To support execution of test cases in SAP PI/PO, uploaded payloads are wrapped with SOAP XI3.0 envelope before being stored into Int4 IFTT database.

 

Figure 2. Int4 IFTT Test Case Loader main screen

Figure 2. Int4 IFTT Test Case Loader main screen

 

Usage

To upload and create test case(s) using Int4 IFTT Test Case Loader you need to fill in some data on the main screen visible in Figure 2:

1. Firstly, in the File Selection section, you should choose one of two test case creation modes:

  • single upload – for this option you should select the files with input and output messages from your local directory
  • mass upload – for this mode you need to indicate the folder where the payloads are located and additionally define regular expression (RegEx) for matching pairs of input and output files

2. In the IFTT Test Case Details section choose the folder from Int4 IFTT Cockpit in which the test case should be saved and also select Int4 IFTT Automation Object for the test case.

3. Next, in the Interface Details section provide the details about the tested scenario.

4. Finally click on the “Execute” button and upon completion of processing the results will be displayed as shown in Figure 3.

Figure 3. Int4 IFTT Test Case Loader result screen

Figure 3. Int4 IFTT Test Case Loader result screen


After completing all of the above steps, you can go to Int4 IFTT Cockpit and execute the newly created test cases.

 

Summary

Test-Driven Development is one of the fundamental techniques of creating various IT solutions. In order to fully benefit from this approach, it is worth to use tools that facilitate its implementation. Of course, some activities cannot be automated and must be done manually but where automation is possible (i.e. in case of creating and executing test cases) it will significantly help to optimize the software development process. And this will allow you to focus on the implementation part of the development cycle and result in creating better IT solutions, which is the main purpose of TDD technique.

This article has only shed some light on how the Test-Driven Development approach can be implemented in the area of SAP integration using Int4 IFTT Test Case Loader. So if you would like to find more about this (or other) Int4 IFTT features, I encourage you to read the detailed documentation available on our Wiki Page.