2015 Apr 22 6:23 PM
Forever looking to improve code quality within the commercial constraints of a project lifecycle, I've given up trying TDD as it just takes too long and is impractical in many situations. But having reread 'The clean coder', I was drawn in to the importance of automating user acceptance tests. im finding writing end to end tests in ABAP unit actually quite doable and a good investment of time. The tests take a while to complete but that doesn't really matter In my situation. The people who will support the solution going forward, are finding that the tests are great documentation too... Saves me writing docx's.
Forever looking to improve code quality within the commercial constraints of a project lifecycle, I've given up trying TDD as it just takes too long and is impractical in many situations. But having reread 'The clean coder', I was drawn in to the importance of automating user acceptance tests. im finding writing end to end tests in ABAP unit actually quite doable and a good investment of time. The tests take a while to complete but that doesn't really matter In my situation. The people who will support the solution going forward, are finding that the tests are great documentation too... Saves me writing docx's.
2015 Apr 22 9:19 PM
You aren't really writing "User Acceptance Tests" if you are writing them in ABAP... You might be writing 'integration tests' which are also valuable. However, I really think you're missing a ton of goodness that unit tests have to offer.
TDD really doesn't take that much more time once you get used to it and get good at it. It's also easier once you get a good base of classes that are easy to test/mock/etc.
Check out mockA - it is absolutely necessary in my opinion to get anything done quickly in abap unit tests:
2015 Apr 25 10:00 AM
It is very easy to think that writing ABAP unit tests - or indeed unit tests in any language - adds time to the development process, and in fact may even double it. The reason being, it's true,
So, the logic is, if this doubles development time, don't bother, what a crazy thing to do.
I have found though, if you do write a test first, and the write the actual code, and run the test, you will find the "schoolboy errors" that even the most accomplished programmer will make.
You might say you would find those low level errors anyway as soon as you test it (I hope programmers test their own code) or during UAT or when the end users in production run the program. Bob Martin, as mentioned earlier would try to prevent that situation by use of unit tests.
The real benefit though comes when a program gets changed. Typically you write a program once and change it a hundred times.
When changing one part you may possibly break another part. That is what unit tests are trying to stop.
Look up Michael Feathers writing on the subject - he claims that any code without unit tests is no sort of code at all, and I am inclined to agree with him.
Cheersy Cheers
Paul
2015 Apr 25 1:21 PM
Hi Jurgen,
Being developer,it is good to maintain good quality of ABAP code with thorough documentation within code itself.
I will prefer it to use in ABAP code in case of urgent code bug fix and documentation in document will take more effort.
We can have design document where technical process lead can give approval followed by QA code review of ABAP program.
It is only developer who has to debug code.
I hope you will understand from developer point of view.
BR,
Praveen