DoodleDriven
Development
CiaranMcNulty@Cukenfest2019
IlikeDraw-ers
@ruby_gem @jennyjmar @mattwynne
Discovery
↓!
Formulation
↓ !
Automation
Conversations
↓!
Gherkin/G-W-T
↓ !
Cucumber
Drawings
↓ !
?
↓ !
?
!
Discoveringwhat's
important
Scenario: Present for full amount
Given I have a pending transaction for £100
When a presentment for £100 is received
Then I should have a completed transaction for £100
Scenario: Present for less than full amount
Given I have a pending transaction for £100
When a presentment for £50 is received
Then I should have a completed transaction for £50
And I should have a pending transaction for £50
1picture=1000words
Joel Goodman/M.E.N.
Effectivediscoverywithdrawings
· Create the conditions where it can happen
· Pick the right formats
· Don't force it
!
Formulating
diagrams
Gherkinisgreat:
1. Looks like the conversation
2. Trackable in VCS
3. Parseable by machines
Potentialformats
· HTML+SVG+CSS
· Mermaid.js
· Asciio
· Asciitosvg
· GraphViz
Graphviz
digraph {
"No transactions" -> "Pending £100" [label="£100 Authorisation"];
"Pending £100" -> "Completed £110" [label="£110 Presentment"];
"Pending £100" -> "Completed £50 n Pending £50" [label="£50 Presentment"];
"Completed £50 n Pending £50" -> "Completed £50 n Completed £50" [label="£50 Presentment"];
"Pending £100" -> "Completed £100" [label="£100 Presentment"];
"Completed £100" -> "Completed £100 n Completed £100" [label="£100 Presentment"];
}
Contextualise
Effectiveformulation
· Find a format that is 'close enough'
· Try and forget the tools during discovery
· Sync based on mtime
Drawings
↓!
Appropriateformats
↓ !
?
!
Automating
diagrams
digraph {
"No transactions" -> "Pending £100" [label="£100 Authorisation"];
"Pending £100" -> "Completed £110" [label="£110 Presentment"];
"Pending £100" -> "Completed £50 n Pending £50" [label="£50 Presentment"];
"Completed £50 n Pending £50" -> "Completed £50 n Completed £50" [label="£50 Presentment"];
"Pending £100" -> "Completed £100" [label="£100 Presentment"];
"Completed £100" -> "Completed £100 n Completed £100" [label="£100 Presentment"];
}
foreach (file('/presentment.dot') as $line) {
if (!preg_match('/->/', $line)) {
continue;
}
$pattern = '/"(?<start>.*)".*->.*"(?<end>.*)".*label="(?<transition>.*?)"/';
if (!preg_match($pattern, $line, $matches)) {
throw new Exception ("Cannot parse line:n$line");
}
$this->setUp($matches['start']);
$this->applyEvent($matches['end']);
$this->assertEndState($matches['transition']);
}
Effectiveautomation
· Cheat the format
· Do the easiest thing that works
· Write brittle tests
!
Domoredrawing!
Findmachineformats!
Writescrappytests
Onemorething:
Exploratorytesting
CiaranMcNulty
· ciaran@crania.uk
· @BDDLondon

Doodle Driven Development