Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# From Bryan Liles on the Practicing Ruby Discussion List
1. TDD is a great tool. As a tool, you'll use it when appropriate.
TATFT mostly means that you should be thinking about how you can put
whatever you are creating under test at all times. Writing tests for
the sake of writing tests is silly.
2. Like Gregory stated, brittle tests aren't helping anyone. Think
about the ingress/egress points of your objects at all times.
3. Spikes are good. Sometimes you don't know where to start so
planting your stake in the ground and working outwards is sometimes
the only way to get some momentum.
4. Don't be afraid to delete tests. I've deleted removed plenty of
useless specs/tests around ActiveRecord attributes. I prefer to test
around behavior. (this is a personal preference and might not be the
best idea in all cases of course)
5. Always think about the next guy. Your simple code that isn't
intention revealing to anyone but yourself might be helped along with
a few tests as documentation.
6. Always write tests around your regressions. Seeing a bug once
sucks, seeing it pop up again is avoidable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment