News for hackers. Stuff that matters.
Re:It's OK Not to Write Unit Tests by jshen on Thursday November 05, 2009 @01:42AM (#923463)
lines of code is very dependent on the language. I have one rails app that's in the 5k range, excluding tests, and it's been running for over a year with no restarts and no need for bug fixes. I think that says something about the effectiveness of my process.

I question the design decisions of any code base with tens of thousands lines of code.

Re:It's OK Not to Write Unit Tests by munctional on Thursday November 05, 2009 @03:42AM (#923546)
If your app has been running for over a year, you might want to look into this (before someone else does)... http://groups.google.com/group/rubyonrails-security/msg/7f57...
Re:It's OK Not to Write Unit Tests by jshen on Thursday November 05, 2009 @12:29PM (#924226)
thanks for the pointer. the site wasn't affected by that.
Re:It's OK Not to Write Unit Tests by davidw on Thursday November 05, 2009 @05:29AM (#923619)
> I question the design decisions of any code base with tens of thousands lines of code.

What operating system are you running on?

Re:It's OK Not to Write Unit Tests by jshen on Thursday November 05, 2009 @12:14PM (#924187)
my servers are either debian or ubuntu, and my laptop is a mac. You do realize that the OS isn't a single monolithic code base. It's a bunch of smaller code bases that work together, which is precisely the point I was making.
Re:It's OK Not to Write Unit Tests by davidw on Thursday November 05, 2009 @01:46PM (#924433)
Want to take a guess at how many lines of code are in the Linux kernel?
Re:It's OK Not to Write Unit Tests by jshen on Thursday November 05, 2009 @02:50PM (#924589)
that's the exception, not the rule right? It's also a example of something that I would absolutely write thorough tests for.

I'm also curious how modular it is. Does a kernel hacker have to keep the structure of that whole set of code in his/her head? I'm guessing there are a lot of clean seams in it that in practice reduce the actual lok related to a project down to a much smaller number.

Re:It's OK Not to Write Unit Tests by jshen on Thursday November 05, 2009 @09:28PM (#925302)
This is from linus' chapter in "open sources"

"With the 2.0 kernel linux really grew up a lot. This was the point we added loadable kernel modules. This obviously improved modularity by making an explicit structure for writing modules. Programmers could work on different modules without risk of interference."

Re:It's OK Not to Write Unit Tests by plinkplonk on Thursday November 05, 2009 @09:31PM (#925309)
Meaningless. You made an explicit statement that you thought all code bases with more than 10 k lines have "questionable design", using a piddly little rails app as an example.

When someone pointed out that linux kernel had millions of lines now you are retreating to "but it is modular". Programming languages have had modules since the eighties. If someone points out a 25,000 line module what will you say? Each function has less than 10 k lines?

The point is that there are well designed code bases (the design includes modularization) with sizes well above 10 k lines , which directly contradicts your point. I've worked on well designed enterprise systems with a few million lines of code.

Re:It's OK Not to Write Unit Tests by jshen on Friday November 06, 2009 @12:00AM (#925457)
You've flipped my statement which changes its meaning. I said I'd question the design of any code base that large. Some would pass that questioning. I did not say that all large code bases have questionable design.

I won't debate a strawman anymore so I'll move on. Btw, are device drivers counted in that millions of lines of code? If so those are very independent things.

This thread was about test coverage, how many of those millions of lines of kernel code are covered by a unit test?

EDIT: so you agree with my original assertions that large test suites may not be worth the cost?

Re:It's OK Not to Write Unit Tests by plinkplonk on Friday November 06, 2009 @12:07AM (#925468)
"how many of those millions of lines of kernel code are covered by a unit test? "

Not many. And yet the kernel is an awesome piece of code. That was the point. I don't have the time to debate test-driven/test-coverage fanatics either.