Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
MichaelSauter
Advisor
Advisor
Are you tired of long-running, unstable tests? Test Isolation might help with that. In most technology stacks, there is an abundance of frameworks and tools to help with that. But in the ABAP environment, there are fewer open source libraries to help there and it's harder to import them into the systems to use them.

But how can I isolate my unit tests in ABAP, then?

Actually, there are quite a few helpful tools to help there and there are more and more coming.

But finding the existing ones, learning about new ones and being able to use them can still be hard. That's why I created a repository containing examples of all existing test isolation tools which are currently available in the ABAP platform.

The Idea


The idea of this repository is to show how to use any test environment, helper class and some common design patterns that help with isolating your code under test from its depended-on components.

How To Use This Repository


If you want to isolate your code under test from the components it uses, you need to take a look at what your depended-on component is. Each isolation technique for a specific kind of depended-on component is used separate test class of the global class ZATI_CL_CODE_UNDER_TEST.
The table below shows which test class uses which tool to isolate against which kind of depended-on component.

 
















































Test Class Depended-On Component Tool
ltc_call_other_object Classes Self-made test doubles
ltc_call_other_object_fw Classes ABAP Object Oriented Test Double Framework
ltc_call_function_module Function Modules Function Module Test Double Framework
ltc_select_database_table Database Tables and CDS Entities ABAP SQL Test Double Framework
ltc_select_cds_entity Database Artefacts which are used in CDS ABAP CDS Test Double Framework
ltc_call_authority_check Authority Checks Classic ABAP Authority Check Test Helper API
ltcl_call_rap_bo_tx_bf_dbl RAP Business Objects Transactional Buffer Double Support
ltcl_call_rap_bo_mock_eml_api RAP Business Objects Mock EML API Support

The Future of This Repository


I'll do my best to stay up-to-date with frameworks that come up in the ABAP stack, but you are all invited to contribute to the repository! Share your thoughts, comment on this post if I missed something and let me know what you need there.

If you feel like having a more detailed explanation, a tour through the terminology being used and the repository itself, you can join on September 7th here. If you want to add it to your calendar, here's the download.
11 Comments
Michael_Keller
Active Contributor
Is it possible to add some release information so that it's clear from which Application Server ABAP version a tool/framework is available? I guess ABAP SQL Test Double Framework is until now not available for 7.50.
MichaelSauter
Advisor
Advisor

Hi Michael, thanks for the feedback, I'll add it as soon as I figure out the releases 😉 From what I can see, the ABAP SQL Test Double Framework seems to have been released with 752...

 

And if anyone knows the release dates, feel free to comment in the pull request.

Michael_Keller
Active Contributor
0 Kudos

This is currently a big topic for me: Knowing exactly what is possible with which release 🙂

Technologically, but also economically very important, because after all you have to make your customers a suitable offer. It heavy dependes on his systems/releases.

Oh,I forget to say "thanks" for your effort to compile the information. For me, really helpful!

MichaelSauter
Advisor
Advisor
You're more than welcome, I'm glad it helps 🙂
Siarljp
Active Participant
Good idea! I like it. The RAP doubles and mock support I did not know about, that could come in handy. One thing I have seen (that doesn't seem to get talked about so much) is the use of Test Data Containers from eCATT combined with ABAP Unit tests, in older systems, where the frameworks are missing, these are quite a useful alternative:

https://help.sap.com/viewer/c6663103e6ad47dcb8bb830d85137077/202009.002/en-US/49708b9981463e90e10000...

You can use CL_APL_ECATT_TDC_API to retrieve your data from the containers.
MichaelSauter
Advisor
Advisor
0 Kudos
Just FYI: I added the versions to the repository now 🙂
lenapadeken
Product and Topic Expert
Product and Topic Expert
We're currently working on "Feature Tables", which display exactly that: Keywords and ABAP release. For the latest version, feature tables are available for ABAP CDS and RAP BDL. More to come!
MichaelSauter
Advisor
Advisor
0 Kudos
I heard of those but never really used them myself, to be honest...

If you have an example of how you use them to isolate your tests, I'll happily include them in the repository 🙂
Siarljp
Active Participant
Ah ok - then this sounds like a blog topic for me 🙂 always good to have something to share. It will take me a little time to sort that out - as I am a consultant and just started with a new customer, but when I get a window - I will post - and update with a link here (hopefully).

 
Jelena
Active Contributor
Thanks for sharing! Great to see more open source ABAP stuff!

Here you can see my presentation at ABAPConf about unit Tests and test data container with examples. Works with 7.31: https://m.youtube.com/watch?v=Yeo9rz-7Pdc&t=11098s

Labels in this area