Hacker News new | ask | show | jobs
by MrGilbert 2532 days ago
I'd say it's too late then. You have to make at least some assumption beforehand, otherwise you'll have to rewrite huge portions of your lib. Sorry, I kindly disagree.

It's like adding unit tests AFTER you've written everything. Just don't do it.

1 comments

>It's like adding unit tests AFTER you've written everything. Just don't do it.

Funny you say this, because that's exactly what I do :)

I don't start unit tests on a new project/library until I flesh out most of the major components as I'm sure I'd be rewriting things multiple times as I'm iterating in the beginning. My guess is this method isn't uncommon....

Yeah, I know - that's how it's mostly done. I guess a Mish-Mash might make some sense? Because, often, I see people in my team creating "ConsoleApplication1"-kind of projects, so that they can build their components and already test them. That's when I mostly say "write a Unit test instead."