08-19-2021 1:20 PM
Hi all,
Can anyone help me to explain how will be possible to test an include?
I'll try to explain better. I need to test a single include and not the entire program associated.
It is possible? If not, what is the best way to check the functionality of a singolar include?
Thanks
Antonio
08-19-2021 1:22 PM
08-19-2021 1:51 PM
Modern programming doesn't need includes anymore. But if you test old code, and it contains local classes only, then maybe you can create a dummy global test class to test them. I think you can include it within the macro definitions or local class implementations. If it contains obsolete subroutines, then you can create a dummy report with local test classes.
08-20-2021 7:30 AM
In the worst scenario, you can create a local report for the testing purposes. But I'd advocate for the unit tests approach.
08-20-2021 8:55 AM
An include does not exist on its own. It must be part of a program of some kind. It's just a code fragment.
Is it an include containing just forms? Or what?
08-20-2021 9:01 AM
matthew.billingham Thanks for the answer.
It is an include containing forms.
08-20-2021 9:15 AM
I am pretty sure you could do Abap Unit with this include, do you have a not too big form for a test ?
08-20-2021 9:56 AM
08-20-2021 10:29 AM
a.coronella nobody is perfect 😉
we need a part of the code starting with form ending with endform. And a little one, not something with hundred of lines
08-20-2021 11:17 AM
a.coronella I fear you will not be able to perform your tests. Not just because you are a functional, and not an ABAPer (I'm sorry for you), but because for to test an INCLUDE you MUST need to do some developments, one way or another.
As Matt pointed, an INCLUDE is not executable by itself, it's just a bunch of lines of code waiting for some "real program" to use it.
Can you test it throught ABAP Unit? Yes, you can, but you'll need to program the tests. Also, you can create a fake program for test, but, again, you need to develop the program.
The only option for you to test the INCLUDE without developing anything must be to find the programs that use it and execute them.
08-20-2021 11:24 AM
vicen.lozano thank you for the answer.
It was my doubt that isn't possible to test the single include.
Thanks for the clarification.
08-20-2021 1:00 PM
Why would functional people test directly the technical code? (whatever it's include, class, program, function module, etc.) It's the job of developers. Functional people should prepare test scenarios that testers will implement through robots.
08-23-2021 8:58 AM
This is the pyramid of test.
At the top, integration test, should be done by end-user. It the full test of the flow.
In the middle, functional test, should be done by our friend the functional.
At the bottom, Unit test, should be done by us, the developpers.
The test of an include could only be done at the bottom level, so by the developper, not the functional.