I told you so.

 I can't stop but smile at what I've written in this forum thread.

A decade ago, I am constantly having this similar debate with my managers, project leader, team leader, quality engineers, etc. about the merits of unit testing. As I was still inexperienced then, I am not really in favor of unit testing because (1) I'm the one doing the task, (2) I have to spend a lot of time doing it - that takes away from 'coding' time, and (3) I can't see the benefit of doing it because we already have a dedicated team of system testers that will catch the defects anyways. I get annoyed because the people on the other end of the debate aren't really doing any of the coding so they definitely don't understand what they are saying.

Now, a decade after, it feels like I'm channelling my managers/project/team leaders. I've gained enough knowledge to know the benefits of unit testing, had enough practice to know how to do it properly so I don't really spend a lot of additional time writing tests and I don't mind doing the task because it still is coding. I'm now on the other side of the debate - pro-unit-testing, pro-TDD even, and I'm still on the trenches, writing code.

Published 11-04-2008 7:10 PM by jop
Filed under: ,

Comments

# re: I told you so.

Yes, it's truely beneficial having a Unit Test.  ^_^ From my previous  experience as System Admin to Business Analyst and  now I'm into Testing which I have to find valid bugs or defects from the system before deployment  haha  'BUGS' lagot kayo..

Wednesday, November 05, 2008 5:47 PM by giniedpooh

# re: I told you so.

Hi Jop, Lamia here

Maybe I'm still in your old situation. Still inexperienced about the said topic.

I have this TL who writes unit tests for his data access codes and sometimes would boast I already tested this and that using my unit tests.

But then, when we use his code we find out that there are things missing and some of them still not working. We are in very critical stage of development and I always thought that if he had time writing those unit tests, he had time to write what we really needed instead. He spent so much time on those tests but we didn't really move forward.

I guess what I'm saying here is that it's not only important to see that your unit test returned a pass status(sorry for the noob statement), you have to make sure it behaves correctly.

I'm still finding my plain old print on the standard out or log, testing in debug mode more effective than my TL'S unit testing strategy. Atleast during this time.

Thursday, November 06, 2008 5:09 AM by Lamia

# re: I told you so.

Lamia,

Unit testing shouldn't be as hard as writing those print statements - except that you are putting it out of the production code and into a separate method or procedure. Instead of visually checking the results of an operation by reading the output logs, you are writing your expectaions in code and letting the computer compare it to the actual results. I would have to say that testing is just like any other skill, it has to be practiced so you become good at it.

You also have to ask your team what really is the problem - is it the writing of the tests or understanding of the specs? If the tests are wrong, then I would bet that those who wrote the test did not really understand the specs.

Thursday, November 06, 2008 5:59 AM by jop

# re: I told you so.

lamia may tawag dyan sa too much print/logging..."scroll-blindness" especially pag sobrang dami nang naka-log/print na entries.

better to move those things into an automated unit test ;)

Thursday, November 06, 2008 6:43 PM by cruizer

# re: I told you so.

Yeah, I'm thinking of putting it in practice on the next pet project that I would make.

Monday, November 10, 2008 9:51 PM by lamia

# re: I told you so.

Great! Post your problems in the forums and I'll see how I can help.

Tuesday, November 11, 2008 12:14 AM by jop