4 ms·
tests can be used to clarify your intentions and what you are attempting to build. It's best place when you are actually starting from a clean slate. Just writ
by hackerm0nkey 7y ago
tests can be used to clarify your intentions and what you are attempting to build. It's best place when you are actually starting from a clean slate.
Just write enough code to make the test pass, no more no less. Refactor and repeat.
In recent years I've never written any new piece of code without test first and can not be any happier. Beside the confidence a test gives you, it really a great way to pin down your thoughts and write what makes them meterialize.
- jacobush 7y agoYeah... I have read that and told that to others many times. But the thing is some of my best work (rare, though) has not been to spec. To any spec. More like, when you are doodling on a paper. "This might be a lake with a duck. Nope scratch that, it's actually a dragon and those are its scales. Yep."
- hackerm0nkey 7y agoYes, I understand what you mean. When I face uncertainty, I explore with not so much emphasis on testing. But once I am over with that exploratory phase, I funnel the learning into the TDD process to solidify my implementation and guide my design. BTW, I rarely work from a well-defined spec these days.