# ABAP TEST-SEAM的使用tips和一些局限

+关注继续查看

https://blogs.sap.com/2015/10/23/abap-news-for-750-test-seams-and-injections/

It is a new syntax and try to make ABAP unit test easier, but please notice it has some limitations. So it is suggested to analysis case by case if we need add TEST-SEAM in production code.

TEST-SEAM can only be found by TEST-INJECTION which is in the same class or function group where the TEST-SEAM is declared.

If you have multiple function modules in which there are same ABAP object need to be test double, you cannot use the same declaration name of TEST-SEAM. To avoid you have many different TEST-SEAM declaration name in your production code but for same mock object, it is better to declare your mockable ABAP object in a single place, and within this single place, add TEST-SEAM to make sure UT code has chance to inject the mock object.

TEST-INJECTION in UT code should be prior to TEST-SEAM in ABAP code execution sequence. Otherwise code in TEST-INJECTION will be ignored by code execution.

7831 0

818 0

17 0

9553 0
Monkey Test 命令使用

945 0

782 0
+关注
1853

0

+ 订阅

《2021云上架构与运维峰会演讲合集》

《零基础CSS入门教程》

《零基础HTML入门教程》