by DanielBMarkham · 15y ago · 0 comments
So to your example, you sell a mock-up. If they want it, then you go back and test-first and code. If you can find out they want time tracking without coding, what are you coding for? If you are coding one thing and they really want something else, what are you coding for?
I'd argue that if you have customers that are directing your sprints, timeboxes, or whatever, then you're already past the point I am talking about. They have money, they have needs, they express needs to you and you go fill them. This is a great spot to be in as a startup! But at that point you're really just quasi-business programmers, and all Bob says is very applicable.
The guys I hear who do well always regret that they spend too much time on stuff that doesn't matter: coding, business plans, reading business books. Instead they should have just worked out more effective ways to find out what people want.
If you have a Minimum Viable Product that people want to pay money for, go code it. And do a good job of it, because you've already determined that people are going to pay money for it. So in that scenario, if you misunderstood your MVP, then all that TDD is going to be awesome when you refactor.
There's a third scenario that's being hinted at: you don't know what people might want, but you think you should code anyway to find out. This is like building a runway hoping that an airplane will suddenly have an emergency and need a place to land. I'd argue that you should either avoid this at all costs, or if you must code, write the cheapest, fastest throwaway crap you could imagine -- the odds are very, very high that you will never use or see that code again. If you do? You hit the lottery, and worrying about how badly you coded something is a ridiculous thing to get uptight about. Every second you spend creating an artificial world, whether that's a business plan, program, or sales chart, without validating with the customer is a waste of energy for an early startup.
But sooner or later, you'll get a rough idea of what people need, and you'll throw together a working prototype. After all, users don't visualize well, but they're great at extrapolating from things they can see.
That's when I start writing tests, even if it's just a weekend prototype. Because for me, tests are a net win by the afternoon of day 1. Why should I spent 3 days writing nasty crap when I could have a decent program in 2?
Now, this won't work for everybody. Maybe it takes a month to prototype your idea. Maybe it takes you twice as long to do TDD as it does to churn out code. Maybe your idea is just plain hard to test.
But I'm definitely in complete agreement about customer validation.
I often advocate functional and integration tests over unit tests for this very reason. A good functional test is testing use cases, which is exactly what the customer wants! Unit tests exist primarily to improve code quality and aren't very useful for anything else.