Live data from Hacker News

Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

news.ycombinator.com

21–30 of 41 posts

Re: Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

#22

A point on terminology: unit testing is an upstream, in-development process, done usually either by development or CM. For example, a java build tool like maven can include running unit tests during the build process. Automated testing is usually a downstream process done by QA. Currently I do SilkTest automation, using the 4-Test language of Borland SilkTest. That is under the "umbrella" of QA. In the past though I…

In addition to the cultural resistance, retrofitting unit tests into an existing codebase is usually a big technical challenge; certainly much harder than doing TDD to begin with.

Re: Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

#23
post #9

Earlier quoted context omitted.

The quick and dirty jobs that we all do every now and then.

These times are when you need automated testing the most.

I don't really need automated testing tools when I write a small program that I just use myself for some task.

If it works it works, if it doesn't I do it again.

Re: Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

#24
post #2

I've admitted on a few occasions that I've never written a unit test for anything. This is something I keep meaning to change, if only I could find the time. For the time being, I can still keep the code dependencies and side-effects in my head so it has yet to cause any serious issues. I still slap my own hand, though.

Don't worry, working with TDD is kind of like wearing a seat belt.

You could do it even if you've never had an accident, many people do.

But most of the time you start doing it AFTER you go off the road once.

Re: Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

#25
post #2

I've admitted on a few occasions that I've never written a unit test for anything. This is something I keep meaning to change, if only I could find the time. For the time being, I can still keep the code dependencies and side-effects in my head so it has yet to cause any serious issues. I still slap my own hand, though.

> if I could only find the time The asinine thing about this is that unit testing saves a massive amount of time in the long run. In the short run, even, it saves time. You're really shooting yourself in the foot.

is the any studies done you can point out, or is it just personal anecdotal evidence?

Re: Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

#26
Personally, I write a lot of tests. It dominates my development process. I'm always thinking about structuring the code I'm writing in such a way that it can be tested.

I didn't always. I think a project has to grow past a certain size, to the point where you can't immediately remember what all the parts do, before the need for tests becomes painfully apparent.

Re: Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

#28
We are very test focused, but I wouldn't claim we are TDD. We also have layers of testing which I consider important.

We have a quick set of unit tests that we run before very check in (10 seconds).

Next our CI kicks off after check in and runs 10 minutes worth of full system tests, booting up opensource software and running it against the system, destroying DBs and recreating them from scratch and running again, etc.

* Finally we have nightly test which run for a few hours, at this point we have 15 projects run against our system. We run projects over and over to test stability, we do security testing against the current code. We have multiple simulated users running against the system checking for performance bottle necks. This phase doesn't catch new issues that often, but helps us to assure we don't regress in performance, security, or overall compatibility support.

Re: Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

#29
post #9
post #8

Earlier quoted context omitted.

Which situations do you think call for "no automated tests"?

The quick and dirty jobs that we all do every now and then.

Yeah many times when you are 'spiking' and idea you can work through a simple small example fastest without testing. I agree when you are quickly just trying to see if something is possible testing will slow you down, and isn't worth the benefits of TDD.

Then when I start to integrate that solution into real production code I go back and add some tests. (mostly integration tests)

Re: Poll: What proportion of start-ups/non-start-ups use automated unit tests/TDD?

#30
Write tests first: http://c2.com/cgi/wiki?CodeUnitTestFirst

It's more fun that way. Instead of your code breaking when you add the test, it's broken until you add the functionality.

My code has many many tests. My co-workers would laugh at me, telling me I spent all my time writing tests. But if my code even RUNS, I'm confident that it is correct. I would get the last laugh, because my co-workers would always be doing frantic debugging right before a deadline because they just uncovered a silent bug.

Post reply on HN