简体   繁体   中英

Stable test data for a SAP function module?

We extract data from SAP IS-U to create RDI which gets used to create PDF via caps .

We want to create automated integration tests.

The function modules we want to test are not trivial. For example creating an annual invoice reads a lot of data in a lot of tables. We need to be sure that all this data does not change. Otherwise the tests will fail.

Therefore we need stable test data inside SAP. Unfortunately we don't have this at the moment.

The sap development systems get accessed by many people. And from time to time these systems get updated with data from the production system.

How to get stable test data for SAP IS-U?

My personal opinion: the provider of the custom solution/component (in this case the IS-U) should provide stable test data. Otherwise every development team starts to create its own stable test data again and again.

From our discussion under the question I could say that the simplest solution would be to request for a separate client in your test system where the data could not be updated by the periodical copy from the production. This would ensure that your data remain stable for your post conditions in your tests.

Look at the ABAP TestDouble Framework available since ABAP 740 SP09. It was introduced exactly for this, for being independent on the productive database state and without changing production code.

The approach used to achieve this is called mocked DAO and described in the blogs below

The mocking is achieved by creation of test double object and configuring method output values through cl_abap_testdouble class methods

cl_abap_testdouble=>create( )
cl_abap_testdouble=>configure_call( )

Consider this whole blog series that describes DAO concept and TestDouble:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM