jitterted,
@jitterted@sfba.social avatar

On today's solo stream, I was doing my #TDD as usual, and, because I use Predictive Test-Driven Development (see https://ted.dev/articles/2021/03/05/clarifying-the-goal-of-behavior-change/), I was able to avoid writing code that wouldn't get the test to pass.

Why? Because 3 separate times, I predicted how the test should fail, and it failed differently! They failed in the unexpected way because I had either written the test setup incorrectly, or misunderstood a library method¹.

Had I just looked out for a failing test, I would have started writing code to make it pass, and been disappointed that it didn't pass when I was done.

--
¹ Turns out Java's String.indent(4) normalizes line endings, meaning it will add a line ending to the last line, even if it didn't have one before! Surprise!

bradwilson,
@bradwilson@mastodon.social avatar

@jitterted I have always thought the circle diagram for #TDD sent the wrong message to new practitioners. Refactoring should always start and end in green. If you refactor and things go red you’ve done something else other than refactoring.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • magazineikmin
  • rosin
  • Youngstown
  • ngwrru68w68
  • khanakhh
  • slotface
  • InstantRegret
  • mdbf
  • GTA5RPClips
  • kavyap
  • thenastyranch
  • DreamBathrooms
  • everett
  • tacticalgear
  • JUstTest
  • tester
  • Durango
  • cubers
  • ethstaker
  • cisconetworking
  • modclub
  • osvaldo12
  • Leos
  • normalnudes
  • megavids
  • provamag3
  • anitta
  • lostlight
  • All magazines