Hacker News new | comments | show | ask | jobs | submit login

Tests are a technique to manage programmer anxiety about code. When I feel anxious about some aspect of my code I write a test case.

Does programming language affect level of anxiety? Definitely. Does programmer skill affect level of anxiety? Absolutely.

Writing tests becomes more important when you're part of a team. Your choices affect not just your anxiety but that of your teammates. That's why it's reasonable to be more dogmatic about TDD in a team.

A lot of 'getting better at TDD' is just getting better at listening to yourself. When I started programming the little anxieties would pile up until I'd painted myself into a corner. With experience I pay more attention to the little anxieties.

After some time doing TDD I feel less anxious just knowing that I can write a test if I want. The benefit of the tests as an artifact is secondary to me; what they primarily do is keep me from getting stressed and giving up to go play poker.




Tests are a technique to manage programmer anxiety about code.

Sorry, but I think this is bullshit. If it were true, you could replace unit testing by medication.

(The following is off-topic, but I've been thinking about it for a while and this seems like as good a place as any...)

This way of talking about software development is mostly Kent Beck's doing. I came to the conclusion that it was doing more harm than good. It's not that emotions aren't a critical part of software projects (they are) or that one should try to deny them or ignore them (it eventually doesn't work). But human discourse around this stuff is very fragile. When you introduce general claims about it at a professional or research level (as Beck and the XP people did), all you end up with are a bunch of crude abstractions that people (especially computer people) begin to apply like bludgeons. This is one of the reasons why people react to XP like it's a cult. Maybe "cult" is too strong a word, but "ideologue" is not, and that's my fundamental objection to Kent Beck.

Weinberg spent years writing about the same stuff. (Hell, he was a student of Virginia Satir. The only reason that didn't cause his professional credibility to go up in smoke is that nobody in the software world knew who Virginia Satir was.) But he did so with a lot of restraint. In hindsight, I think that comes across as wiser.


Hey, I'm telling you what works for me.

And I don't have to worry about side effects from writing tests.

You're taking me too literally when I say I want to manage anxiety. If medication is a solution, so is not hacking at all, or just remaining inexperienced and non-introspective about my coding. Anxiety usually has good reason, and it requires improving the _codebase_. But my metric for how the codebase is doing is my own perception as I live and breathe it.

I have a love-hate relationship with anxiety. I need to listen to my perceptions, because that's key to where the code comes from. But those perceptions also have the ability to demotivate me away from the code. It seems like an obvious connection to me ever since my experience with burnout. Learning about the non-linearities in my motivational structure makes me a better programmer.

Has Kent Beck influenced me? Definitely. Listening to myself works for me. I don't see how thinking more about how I operate and how I learn my skills can do more harm than good. Paraphrasing Sun Tzu, "Know yourself". http://en.wikiquote.org/wiki/Sun_Tzu


I agree with this and like the way you put it: Learning about the non-linearities in my motivational structure makes me a better programmer. I also find that the value of that information grows with the difficulty of what one's trying to build.

I don't see how thinking more about how I operate and how I learn my skills can do more harm than good.

That of course is not what I said. What I said is that Kent Beck's influence in this area has done more harm than good. A couple hours later that strikes me a sloppy overstatement because I have no way of measuring this. What I should have said is that I have misgivings about it and that I've observed it having harmful (cultlike) effects on how some people interpret it. Is that Kent Beck's fault? Not entirely. Yet there is a will to systematization and authority in his writing (as well as, or perhaps I imagine this, a sort of icky pretense that this is not what's going on) that makes me want to keep my distance.

One of the signatories to the agile manifesto told me that he thought this whole "human side" thing had gone too far and it was time to get back to focusing on technology. I loved that, partly for its cheekiness but partly also because I've experienced something similar. I don't mention this as any sort of objection to what you wrote - it's just a topic I'm interested in.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: