Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP UNIT - Test Driven Development

shaik_a
Explorer
0 Kudos

Dear ABAPers,

I hope some of you may have also ventured into this area of Test Driven Development. I have just started looking into this new and exciting way of development. My understanding after having gone through the available blogs and some reading material on TDD, is that, we have to religiously embrace Object Oriented programing to actually benefit from TDD methodology. That raised a big question in my mind, how do we implement this technique when we are coding in the user exits like MV45AFZZ, which is mostly classical ABAP programming?

Please help me understand the TDD a bit more than I currently do.

Thanks much,

SMA.

<- removed by moderator ->

Edited by: Neil Gardiner on Sep 29, 2010 10:38 AM

3 REPLIES 3

dirk_wittenberg
Contributor
0 Kudos

Hello,

TDD means that you first write a test and in the second step the coding making the test pass. As this technique comes from the OO--world all articles are surely about OO but in ABAP-word you can also write unit tests for FORMs or FUNCTIONS. Otherwise you can but all your logic in a global class and call this from within your user-exit. Within the global class you have all support for the unit-tests.

Hope this helps you

Dirk

former_member183804
Active Contributor
0 Kudos

As Dirk already mentioned TDD is writing test before writing productive code. This approach is not limited to OO practices or unit tests.

E.g. writing an eCatt script in advance that passes as soon the scenario is working, adheres to TDD practices also..

Vice versa if one practices unit testing and oo patterns it is no TDD if the tests are written after the productive code.

Regards

Klaus

Former Member
0 Kudos

Have you looked at the code inside the methods? Mostly looks like classic ABAP to me