Live data from Hacker News

Ask HN: Should you TDD a MVP?

news.ycombinator.com

1–10 of 38 posts

Re: Ask HN: Should you TDD a MVP?

#2
No, if your MVP is a total throwaway that you're using solely to validate a hypothesis, and once/if it's validated you'll be redoing everything.

Yes otherwise.

My experience with TDD is that the cost/benefit curve doesn't really pay off until you need to refactor or significantly expand a project, at which point having good test coverage saves you an enormous amount of time/pain.

Re: Ask HN: Should you TDD a MVP?

#4
I think it's ok to go without tests at the start of your project, but at some point you have to transition to using TDD, otherwise the ability to refactor the codebase or change existing features becomes difficult and time-consuming.

To give a rough idea, I spent ~ 2 1/2 months working on my app (Dashku.com) before I wrote a single test for it. Then when a company approached and asked to use it with a special requirement, I realised it needed tests in order to be deemed production-worthy. Now the app has tests (both unit and integration), and I'm now resuming adding features to the product.

Re: Ask HN: Should you TDD a MVP?

#5
post #3

"In fact I usually like to TYZCMZQ when I'm not VJBDTLJX-ing!"

Okay now the less sarcastic- but equally harsh answer. If you think test driven development is not good you should not use it. If you think test driven development is good and you don't use it on your minimally viable product: then you are signaling that even you don't find the product interesting enough to even automatically exercise.

Re: Ask HN: Should you TDD a MVP?

#6
I think that this is a wrong question to ask. You have probably so many more important questions to answer while working on your MVP.

If you are accustomed to test driven development then you will know (or at least you will be able to reason about it) when to apply it and when not to. It is just another development practice. But I do not think that you will fail if you do TDD or if you do not. But you do risk failing if you emphasize the wrong things such us should we use X or Y development practice. Use whatever works for you and your team (if you are not alone).

To give you a more concrete answer: follow common sense and your team's suggestions. Avoid making a development practice one of your priorities.

Re: Ask HN: Should you TDD a MVP?

#7
post #5
post #3

"In fact I usually like to TYZCMZQ when I'm not VJBDTLJX-ing!"

Okay now the less sarcastic- but equally harsh answer. If you think test driven development is not good you should not use it. If you think test driven development is good and you don't use it on your minimally viable product: then you are signaling that even you don't find the product interesting enough to even automatically exercise.

I disagree. I like TDD, but if you're quickly building a MVP that has beforehand been decided(1) to be thrown away once you've gotten funding, just hack it like you've never hacked something before. You're aiming to prove a concept, to visually display your idea.

(1 - do make sure the non-technical people in the group really really really understand this)

Re: Ask HN: Should you TDD a MVP?

#8
When I'm starting out I find writing a cucumber scenario is a great way to focus on getting a useful feature done. It's the first thing I add to a project. The general setup is done as part of getting that first scenario to pass. After that I do whatever is fastest. I use cucumber scenarios as tracer bullets for new areas of functionality but if I'm refining perhaps I won't bother. As always though, it depends...

Re: Ask HN: Should you TDD a MVP?

#9
If TDD isn't something you normally do, it'll likely be too much overhead. If you're a TDD expert and that's what you always do, go ahead.

The purpose of an MVP is to ship something that works as quickly as possible, so it's not the ideal time to be trying out a new technique.

Re: Ask HN: Should you TDD a MVP?

#10

No, if your MVP is a total throwaway that you're using solely to validate a hypothesis, and once/if it's validated you'll be redoing everything. Yes otherwise. My experience with TDD is that the cost/benefit curve doesn't really pay off until you need to refactor or significantly expand a project, at which point having good test coverage saves you an enormous amount of time/pain.

My experience is that doing TDD doesn't take more time, even for initial development. It doesn't take less time either. It's subjective and I haven't done any measurement (I suppose it would be really hard to measure the effect of TDD, all other things being equal, since writing the same software twice using both methods would obviously be misleading).

I do have one clue that TDD takes the same time as non-TDD for me : I used to work as a freelance developer, paid by the hour, for clients to whom I didn't feel necessary to tell whether I would do TDD or not when negotiating the number of hours a given project or task would take. Then I was doing TDD and was still able to deliver on budget. Some of those clients were themselves developers who presumably would know how much time a task should take. The fact that I was doing TDD, or even writing tests at all wasn't part of the discussion about the amount of time it should take. Doing TDD didn't seem to have any effect on my ability to meet the schedule.

I think the reason it works like this for me is that I tend to do a lot more manual testing when I don't write tests (and if I don't write tests first, I tend to not write them at all because the motivation is much lower, the code is already "working" after all...)

Post reply on HN