Thoughts on testing
Image via Wikipedia
Integrating unit testing into Java development as a means to prove suitability and strength of the application. Is there any benefit to doing this or is it just a waste of time and effort?
What happens over time as the code develops and the tests do not, do they merely become a hindrance to the process of creating code?
Interesting…I wrote this a while back and never finished it….now I think I really understand what I was doing when I was writing the tests first and using them to develop the tool/application as I went along. Having just finished the first rewrite of a community contribution which involved rewriting the code in a more object oriented way I deliberately setout to ensure that this rewrite included unit testing. I also deliberately setout to write the tests first and not as a result of writing the code, in some areas I succeeded but in others I have to admit that I wrote the code first and wrote the tests around the code…unfortunately they were probably the classes that I had the most problems with.
Another area I had problems with was not understansing all the tests I needed to write to thoroughly test the application. Something that involves just as much thought as the actual design….tip no1 – think of every possible test case and write it….then write the code…you won’t get bitten in the ass when you deliver it….
Is there time for writing tests?? The real saving with writing tests comes after the fact…when there is a bug or when you need to alter the functionality, this is when you reap the rewards of putting the time and effort into creating tests in the first place…is there time?? yes, build the time into the initial estimate…if they ask why so long then tell them…I need the time to prove to the customer that it works…..
Feelings on the whole TDD process….much better and when you come back to working with the code again and having to refactor some of the code it is so much easier with tests in place that show you it works….do yourself and those that will come after you a favour and write the tests…
Related articles
- Why do we (not) write tests [via Zemanta]
No comments yet.





