This document discusses test-driven development (TDD) and testing. It provides guidance on practicing TDD through following three laws: 1) No production code without a failing test, 2) Tests can only be written to the point of failure, and 3) Only write production code to pass a single failing test. It also recommends practicing TDD in cycles, with cycles occurring at the seconds, minutes, and hours level following the red-green-refactor process. Finally, it suggests using testing katas to build skills through repetition of simple testing problems.
26. “Figure out what test will best move your
code towards completion.
(Take as much time as you need. This is the
hardest step for beginners.)
-James Shore
26@theBConnolly
Think:
28. “Making a commit at this point will improve
your process even more. You will have
autonomous chunks of work that are small
and easy to understand.
-Cecil Williams
28@theBConnolly
Commit:
46. “ Seconds - Follow the 3 Laws
46@theBConnolly
Cycles of TDD
Minutes - Red, Green, Refactor
10 Minutes - Specific / Generic Cycle
http://blog.cleancoder.com/uncle-bob/2014/12/17/TheCyclesOfTDD.html
47. “As the tests get more specific, the code gets
more generic
-”Uncle” Bob Martin
47@theBConnolly
Specific / Generic Cycle
48. “ Seconds - Follow the 3 Laws
48@theBConnolly
Cycles of TDD
Minutes - Red, Green, Refactor
10 Minutes - Specific / Generic Cycle
Hours - Architectural Boundaries
http://blog.cleancoder.com/uncle-bob/2014/12/17/TheCyclesOfTDD.html
49. “
49@theBConnolly
Cycles of Test Driven Testing
Minutes - Follow the 3 Laws
30 Minutes-ish - Think, Red, Green,
Refactor, Commit
Hours-ish - Specific / Generic Cycle
50. As testers intentions get more
specific
The testers perspective becomes
more holistic
50@theBConnolly
51. Be Well, Create, Share
Connect With Me
@theBConnolly
brendanconnolly.net
|
Editor's Notes
But there is nothing to test, Forces test first.
Solutions tend to grow organically
Requirements tell us what software has to do, but its often developer discretion on how those requirements are implemented.
Organic growth vs. explicit design
Designers don’t always end up consumers of their designs.
Existing code is read much more often that new code is written
Sometimes our efforts drift, navigating by gut feelings and intuituions.
Its not bad but its good to have a lens to focus our efforts
TDD isn’t a magic bullet, good patterns can emerge
Can have strategy without needing test plan written up front.
It’s fine for the first mission to be a scouting mission, consider rules of engagement
Be free to gather information,
Clear intent doesn’t mean we aren’t overly ambitious.
TDD is like a microcosm of an agile transition. We don’t want to drive decisions by just what we think. Instead force a feedback cycle to drive
New features are like being in a new place, knowing you need to get somewhere, but your only tool is a wrinkled map.
All you really want is someone to give you directions, but thats a lot of trust and risk
You are making decisions when yo uknow the least.
We made a plan, but now we feel compelled to follow that plan
Replace the baggage of a plan, a series of distance intervals that result in arriving at the destination
Planning testing up front introduces the same baggage, sunk costs
We now treat test and production code as 2 sides of the same coin
Tests first puts the priority on process over destination
The cycle has to feed itself a
Processing information is a difficult task, multi tasking is impossible.
We sometimes look for bugs to grant us team credibility. We are looking to justify contributions
We aren’t bug hunters thats just an artifact
Wouldn’t you rather evaluate software on its merits not its flaws
Bugs a
Many dimensions to testing, context shifting, persona bleeds
Be active in present in testing rather than a passive
Put tester willpower requiring tasks first
The more we do the more we have to un
A mantra for devs doing TDD
Super relatable but where does design step in? It can’t just
Super relatable but where does design step in? It can’t just