Ask HN: Should you TDD a MVP?
1–10 of 38 posts
Re: Ask HN: Should you TDD a MVP?
#2Yes 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?
#3Re: Ask HN: Should you TDD a MVP?
#4To 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"In fact I usually like to TYZCMZQ when I'm not VJBDTLJX-ing!"
Re: Ask HN: Should you TDD a MVP?
#6If 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"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.
(1 - do make sure the non-technical people in the group really really really understand this)
Re: Ask HN: Should you TDD a MVP?
#8Re: Ask HN: Should you TDD a MVP?
#9The 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?
#10No, 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.
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...)