Live data from Hacker News

Ask HN: Should you TDD a MVP?

news.ycombinator.com

21–30 of 38 posts

Re: Ask HN: Should you TDD a MVP?

#21
You should at least put a testing framework in place, and test some low-hanging fruit. That'll make it easier to get momentum going for more testing if things continue, and at least give you some minimal coverage.

Re: Ask HN: Should you TDD a MVP?

#23
Seen that TDD refer to "Test Driven Development" I was nearly sure that the question asked about "MVP" / Model View Presentation.

I've implemented lots of different of UIs using MVC type 1 and 2, HMVC / PAC etc. and, as a developer, I don't have single clue as to what "MVP" means here. Maybe some context to remove the ambiguity would be good in laconic questions like this one, especially seen that the other acronym is used.

Google for "TDD test driven development MVC" and you'll see that I'm 100% correct on this one ; )

Re: Ask HN: Should you TDD a MVP?

#24
Those that TDD a lot have come to realise what TDD does is help you find a good design. It teaches you something about the way in which you code and design and allows you to cheaply play with the alternatives. It also ensures the code works and ensures so in the future as you undergo changes.

BDD for functional testing ensures that the functionality you test works and again that before you cut code you have thought about how your functionality is going to work. These are valuable exercises to do with or without the code to run.

So when it comes to an MVP to test the idea how well does it have to work and how well does it have to be designed? Some amount of your system will be critical and if in the process of changing it you break that functionality you may have no product. A certain amount of confidence in the core of what you are building is important, having it automated will allow you to change quickly. Ensuring 100% code coverage is not important, some bugs when you are small are probably acceptable.

Re: Ask HN: Should you TDD a MVP?

#25

Seen that TDD refer to "Test Driven Development" I was nearly sure that the question asked about "MVP" / Model View Presentation. I've implemented lots of different of UIs using MVC type 1 and 2, HMVC / PAC etc. and, as a developer, I don't have single clue as to what "MVP" means here. Maybe some context to remove the ambiguity would be good in laconic questions like this one, especially seen that the other acronym i…

I believe by MVP he means "minimum viable product" http://en.wikipedia.org/wiki/Minimum_viable_product

Re: Ask HN: Should you TDD a MVP?

#26

Seen that TDD refer to "Test Driven Development" I was nearly sure that the question asked about "MVP" / Model View Presentation. I've implemented lots of different of UIs using MVC type 1 and 2, HMVC / PAC etc. and, as a developer, I don't have single clue as to what "MVP" means here. Maybe some context to remove the ambiguity would be good in laconic questions like this one, especially seen that the other acronym i…

[deleted]

Re: Ask HN: Should you TDD a MVP?

#27
post #21

You should at least put a testing framework in place, and test some low-hanging fruit. That'll make it easier to get momentum going for more testing if things continue, and at least give you some minimal coverage.

And test at least fundamental parts of user interaction with the MVP: sign up, login/logoff, conversion funnel, what else depends of MVP. MVP may have limited set of features, but implemented ones should work.

This not TDD but rather BDD without unnecessary fluff.

Additionally manual testing is repetitive work. It is better to outsource it to the computer to make sure that testing is in fact done when needed - preferably after each code change. By doing testing this way is far easier to isolate immediate cause of failing test - developer knows what was changed recently.

Re: Ask HN: Should you TDD a MVP?

#28
I would TDD in either case simply because if you end up maintaining it at all, you're going to wish you had tests. Also, I wrote an architecture that makes starting from day one using TDD much easier. It's called Obvious: http://obvious.retromocha.com

Once you understand the concepts, you can whip up a simple crud app in a couple hours. Example app here: https://github.com/RetroMocha/obvious_status

Re: Ask HN: Should you TDD a MVP?

#29

This is a really good and interesting question, and it's one I've been struggling with myself. The problem boils down to this: TDD makes your software more maintainable (if you do it well) and it lowers your cost of development. However, it also takes significant time and effort to figure out how to test-drive a technology for the first time. Everybody can TDD a Stack class; TDD'ing a database, or a web server, or Ja…

I think this is the comment I agree with the most so far.

I believe TDD is important, especially for a MVP one could argue. Do MVPs change a lot? Yes, obviously because you are learning and adapting to the needs of you customers. This is where have good test coverage (thanks to TDD) is a big asset. You can refactor, change, pivot, all you want, without the worry that removing this feature, tweaking that feature, or adding this other feature, won't break something else.

And manual testing is way more expensive then investing in automated testing.

In my opinion, unless it is a very short lived project that you don't plan to iterate on and isn't very important, you should have good test coverage. And good test coverage is best achieved with TDD.

This is of course just my 2 coins

Re: Ask HN: Should you TDD a MVP?

#30

This is a really good and interesting question, and it's one I've been struggling with myself. The problem boils down to this: TDD makes your software more maintainable (if you do it well) and it lowers your cost of development. However, it also takes significant time and effort to figure out how to test-drive a technology for the first time. Everybody can TDD a Stack class; TDD'ing a database, or a web server, or Ja…

If you do decide to add tests to an existing code base, I found "Working Effectively with Legacy Code"[1] to be a good guide. Check out the table of contents.

[1] http://www.amazon.com/Working-Effectively-Legacy-Michael-Fea...

Post reply on HN