SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
The slides of my "Baby Steps TDD Approaches" session at the Softwerkskammer Munich meetup on 9th of April 2015 where I present a tool box which you can use to reach smaller steps to optimize feedback speed and reduce risk during programming.
Software Developer and IT-Consultant
at
codecentric AG
The slides of my "Baby Steps TDD Approaches" session at the Softwerkskammer Munich meetup on 9th of April 2015 where I present a tool box which you can use to reach smaller steps to optimize feedback speed and reduce risk during programming.
4.
● 2011 Kent Beck‘s
Responsive Design
● 2013 Adi Bolboaca
Taking Baby Steps
● 2014 Seb Rose & …
Diamond Kata
● [2014 Mikado Method]
How I stumbled upon…
5.
Leap
change 1
Initial code state
change 2
state 1
state 2
…
change n
target code state
● slow feedback
● high risk
● exponential complexity
● problems hard to find
6.
Stepping Stone
change 1
Initial state
change 2
state 1
state 2
…
change n
target state
get green asap
● commit on green
● revert to green
+
7.
Stepping Stone
change 1
Initial state
change 2
state 1
state 2
…
change n
target state
+ fast feedback
+ less risk
- a bit more effort
8.
"Taking Baby Steps“
Kata Contraints (Adi Bolboaca, Erik Talboom)
● Write Feature
● Test
● Implement
● Refactoring
2 min.
2 min.
red?
green?
git reset --hard
git commit
9.
The “Diamond Kata“
A => A B => _A_
B_B
_A_
C => __A__
_B_B_
C___C
_B_B_
__A__
10.
Parallel
● Old and new version
parallel at the same time
● Switch one usage at a time
old
create
new
delete old
old not used
anymore
11.
My too big Feature
Simplification
baby
feature
Layer 1
Layer 2
integrated test against vertical slice
12.
My too big Feature
Simplification
baby
feature
Layer 1
Layer 2
Narrow focus of test
C => __A__
_B_B_
C___C
_B_B_
__A__
C => __A__
13.
Outside-In TDD
Feature
Layer 1
Layer 2
Unit test
Mocks
14.
Component
Feature
Layer 1
Component
Helper Class vs. Method?
Unit test bottom up / inside-out
15.
On-Site TDD
• Temporary assertions in production code
• Delete afterwards
• Even quicker: a REPL
public String diamond(String s) {
if (s.equals("A")) {
return s;
} else {
assertEquals("A", predecessor(s));
return (predecessor(s) + s);
}
}
16.
Test-Recycling
• Start with simple test
• Subsequent rewrites of the
same tests
B => AB
B => ABB
B => AnBBn
17.
Let‘s code the “Diamond Kata“!
Contraints "Taking Baby Steps“
● Write Feature
● Test
● Implement
● Refactoring
● [Don‘t talk]
A => A B => _A_
B_B
_A_
C => __A__
_B_B_
C___C
_B_B_
__A__
2 min.
2 min.
red?
green?
git reset --hard
git commit