3 ms·
My home projects become tragic when they get past the trival size and I haven't been TDD'ing and designing all the way through. I think part of my problem is t
by EdSharkey 11y ago
My home projects become tragic when they get past the trival size and I haven't been TDD'ing and designing all the way through.
I think part of my problem is that I cannot devote a consistent level of effort every week to my current home project. Sometimes I'll leave and when I come back to it, I'm lost without a test suite and wind up rewriting huge swaths of it.
Really good tests also serve as up-to-date documentation of your design. If you code in Java or Groovy, check out the Spock Framework. Spock tests read like a story. I wish there was a Spock-like DSL for JavaScript development.
- vorg 11y agoSpock hacks into Groovy's AST to make labelled expressions have special meanings: def "adder-test"() { given: "a new Adder class is created" def adder = new Adder(); expect: "Adding two numbers to return the sum" adder.add(3, 4) == 7 } It could all easily break if the Groovy parser or AST is updated. And very clunky, which says something about Groovy's design post v 1.5.