begin  quoting Andrew Lentvorski as of Thu, Oct 25, 2007 at 06:09:38PM -0700:
[snip]
> However ... the crying comes from the fact that writing unit tests is 
> often more work than writing the original code.  Taking a quick look at 

Hm... in time at the keyboard and LOC, sure.

In *work*? I go thru a lot of scratch paper writing code, and not too
much writing tests...

> my circular buffer written in C, I have *10 times* the code doing unit 
> tests that I have actually implementing the circular buffer.  Almost all 
> of those tests represent a bug that I had to track down--generally a 
> boundary case (insert and delete that moves back and forth on the 
> boundary, full/empty inserts and delete, fencepost errors, etc.)
> 
> This is probably an exception--a core data structure should get tested 
> more strongly than most units--but I have heard that 2-3 times the code 
> in unit tests that you have in the implementation is not unusual.

The advantage of testing a core data structure is that it's easier than
testing code that has more interaction with the "outside world". So yah,
you need to really bang on 'em, but it's nice that they're self-contained
as well.

Testing core data structures is practically fun.

(Or am I just a sick, sick man?)

[snip]
> (See: http://www.phdcomics.com/comics/archive.php?comicid=929)

<laugh>

<cough>

<wheeze>

Oh, you [censored]. I'm going to be out of town, I don't have time to
pick up another webcomic....

-- 
Remind me again in a month, eh?
Stewart Stremler


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to