|
|
|
|
|
by quii
2339 days ago
|
|
Hello, I wrote learn go with tests! Your comment is exactly what I try to get across in the book but it's not always easy. If you cant decide how you want something to look (as that's not always easy) just take a punt on something. Make sure it's a small decision and make something useful. Sure you might have to change it, but at least you'll be basing that on some real feedback. |
|
One thing I was uncomfortable with about TDD is the step to "just write enough to make the test pass". The danger seems to be when you have to walk away from some code and you or whoever picks up your code doesn't know what you were up to.
In a simple app and a few tests you could probably tell, but the larger an application gets, the less you can put effort into finding out "this test works because the application works how it should" or "this test works because someone wrote just enough code and hardcoded some value somewhere in order to make the test pass".
It seems "safer" to write tests that are going to stay broken until every little corner of everything works properly, even though this is less iterative.
As mentioned above I have little TDD experience, so maybe I'm missing something.