Click to See Complete Forum and Search --> : Testing: do you do it?


klamath
01-15-2001, 01:08 AM
I've been considering writing unit tests for a project I'm working on, but I don't know if it's worth the investment. Will it actually catch bugs and make sure the code works? How long does it take?

Do you guys use unit testing in your code? (FYI, I'll probably be using JUnit from www.junit.org). (http://www.junit.org).) And for that matter, what about functional testing?

------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
Looking for an open source project to contribute to? Check out the Better Bulletin Board (http://bbb.sourceforge.net)

Dru Lee Parsec
01-15-2001, 04:40 PM
Yes and no. I moved into the programming department from the QA department so I tend to test more than normal 'cause it's part of my background.

In Extreme programming you write a unit test program for every class that you write. If you add something to a class you have to
A) make sure nothing broke the old unit test.
B) add new test to check out your new code.

I don't know anyone who does that.

But I do constantly test my code while I'm writing it in the same way I would if I was a QA analyst. So I guess I do unit and functional testing.

But nothing can compare to having a 2nd pair of eyes bash your code. THAT will find bugs you never know existed.

klamath
01-15-2001, 07:15 PM
But I do constantly test my code while I'm writing it in the same way I would if I was a QA analyst


Yeah, I think that's pretty common. I was talking more about automated tasks, which should be run regularly (e.g. once an hour), and make sure your code works as its supposed to.

------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
Looking for an open source project to contribute to? Check out the Better Bulletin Board (http://bbb.sourceforge.net)

Sterling
01-15-2001, 07:20 PM
I test each major bit of my code. As I'm usually an OO or semi-OO programmer, this means testing most classes that can work independantly of the rest of the program to varying degrees. And testing all my algorithms that I use elsewheres in code. Having a smaller program that just does one thing lets you eliminate errors or bugs much faster than a larger program, and helps isolate errors.

Autoconf and automake (been playing with those a lot lately... Major PITA) have faculties for test and check suites for libraries. Unless you're writing a major library, I don't really recommend using these. You should've tested any libraries that make up your program before release.

------------------
-Sterling
"There is no Linuxnewbie.org cabal..."