Technology-Driven Development:Using Automation andDevelopment Techniquesto Grow an Agile Culture
Jul/29/2014Hiroyuki ItoDevelopment Process Optimization Department, Rakuten, Inc.http://www.rakuten.co.jp/
2
Hiroyuki Ito
About me
Test-Driven
Development Group
@hageyahhoo
(The Hiro)
3
http://global.rakuten.com/corp/about/strength/business_model.html
4
It’s my 3rd time to be here!
Agile2014 : as a Speaker
5
This session’s theme
Technology-Driven
Development
6
Additional possibilities of automation
7
“TDD” stands for three purposes
Efficiency
Learning
Collaboration
8
By three approaches
CI/CD
TDD
BDD
9
Three approaches by
CI/CD
TDD
BDD
10
Agenda
1. Conditions and Challenges
3. TDD
2. CI/CD
4. BDD
5. Results, Problems, Possibility and Future
6. Conclusions
11
1. Conditions and Challenges
3. TDD
2. CI/CD
4. BDD
5. Results, Problems, Possibility and Future
6. Conclusions
12
At the end of April 2013
BusinessAnalyst
UI/UXDesigners
Developers
13
At the end of April 2013
BusinessAnalyst
Agile Coach(The Hiro)
UI/UXDesigners
Developers
HELP!
14
Our target application is
15
Conditions and Challenges
16
Conditions and Challenges
None of the team members hadany experience with agile
17
Conditions and Challenges
None of the team members hadany experience with agile
There had beenmany manual operations
18
Conditions and Challenges
None of the team members hadany experience with agile
There had beenmany manual operations
Most of the team memberswere young and immature
19
What do you think?
20
I was so much excited!
21
I canachieve anything
through such a challenging project!
WHY?
22
Three approaches
CI/CD
TDD
BDD
23
1. Conditions and Challenges
3. TDD
2. CI/CD
4. BDD
5. Results, Problems, Possibility and Future
6. Conclusions
24
Challenges
Low performance• So many manual tasks
Going in circles• No clear vision and no requirements• No timely progress information
25
Before CI/CD
• Install applications : 0.5 hour/change• 5-minite work for 6 persons
• Regression testing : 4 hours/change
• Need to retry if we find bugs…
• Change requests : 3 times/week
13.5 hours/week
26
The Implementation of CI/CD in our project
27
The Implementation of CI/CD in our project
My PC
28
The Implementation of CI/CD in our project
Check-in build (hourly) My PC
29
The Implementation of CI/CD in our project
Check-in build (hourly) My PC
Build applicationsand run regression tests
automatically
30
The Implementation of CI/CD in our project
Check-in build (hourly) My PC
Deliver toall team members
automatically
Build applicationsand run regression tests
automatically
31
The Implementation of CI/CD in our project
Check-in build (hourly) My PC
We demonstrate latest applicationto the business analyst and managersin every daily scrum
Deliver toall team members
automatically
Build applicationsand run regression tests
automatically
32
Shared understanding by the working software
BusinessAnalyst
UI/UXDesigners
Developers
Get fast feedbackKnow aboutthe progress
33
• Install applications : 2 minutes/change
• Regression testing : 3 minutes/change
• Change requests : 3 times/week
15 minutes/week
After CI/CD
34
• Install applications : 2 minutes/change
• Regression testing : 3 minutes/change
• Change requests : 3 times/week
15 minutes/week
After CI/CD
13 hours!
35
1. Conditions and Challenges
3. TDD
2. CI/CD
4. BDD
5. Results, Problems, Possibility and Future
6. Conclusions
36
Challenge
Lack of skill and knowledge of Android• the architecture of Android• how to develop the Android application• how to access the database on the
device• how to implement the UI
37
Before TDD
Model
Controller DBDao
Activity
DBDao
DBDao
• Could not test after we implemented all components(Debug Later Programming)
• It took five days to implement one activity set
38
Too difficult to use Android JUnit
39
Too difficult to use Android JUnit
java.lang.RuntimeException: Stub! ( ゚ Д ゚ )
40
Too difficult to use Android JUnit
java.lang.RuntimeException: Stub! ( ゚ Д ゚ )
Why we need an emulator or a device? :-o
41
Too difficult to use Android JUnit
java.lang.RuntimeException: Stub! ( ゚ Д ゚ )
Why we need an emulator or a device? :-o
Please don’t start a heavy lifecycle of Android for each test case :-<
42
Solution to do TDD on Android
43
Solution to do TDD on Android
• Robolectric : Do all unit testing only on JVM• http://robolectric.org/• Without any emulator or device!
44
Solution to do TDD on Android
• Robolectric : Do all unit testing only on JVM• http://robolectric.org/• Without any emulator or device!
• Mockito : Can use the “Test Double”• http://code.google.com/p/mockito/
45
@Beforepublic void setUp() {
Create database for Test;Insert test data;
}
@Testpublic void findXxx() {
Assertions;}
@Afterpublic void tearDown() {
Drop Database for Test;}
Image of Unit testing for Dao by using Robolectric
5 minutes -> 0.5 secondsto run each test case.
46
After TDD
Model
Controller DBDao
Activity
DBDao
DBDao
• Can test each component independently and separately• It takes one day to implement one activity set
(five times faster than at the start of the project)
47
1. Conditions and Challenges
3. TDD
2. CI/CD
4. BDD
5. Results, Problems, Possibility and Future
6. Conclusions
48
Challenges
Avoid feature creep
Detect bugs and regressionson use-cases
Learn domain knowledge effectively
49
Example of feature creep
BusinessAnalyst
UI/UXDesigners
Developers
DONE!
50
Example of feature creep
BusinessAnalyst
UI/UXDesigners
Developers
MORE!MORE!MORE!
More features!
DONE!
51
Example of feature creep
BusinessAnalyst
UI/UXDesigners
Developers
MORE!MORE!MORE!
More features!
DONE!
NUUN
52
Example of feature creep
BusinessAnalyst
UI/UXDesigners
Developers
MORE!MORE!MORE!
More features!
DONE!
NUUN Need discipline!
53
Calabash-android: improve the discipline
• The wrapper of Cucumber for Android• As an executable specification• As a communication tool
Specifying collaboratively withbusiness analyst, designers and developers
• By specification with examples
54
Example of BDD test scenario with Calabash-Android
Feature: Input Scenario: Input today’s data
Given I kick drumroll And drumroll show today When press next Then I should see ”xxx" screen
When I press keys and calculator should show like this: | 2 | 2 | | 0 | 20 | | 0 | 200 | | * | 200 | | 3 | 3 | | = | 600 | Then take photo…
• Feature : name of all cases• Scenario : name of each
case
These statements areRUNNABLE!
We can write datawith table style like this
55
We want to…
Process of BDD
BusinessAnalyst
UI/UXDesigners
Developers
We want to…
56
Process of BDD
BusinessAnalyst
UI/UXDesigners
DevelopersGIVEN …WHEN …THEN …
Is that right?
MORE!MORE!MORE!
We want to…
57
Process of BDD
BusinessAnalyst
UI/UXDesigners
Developers
MORE!MORE!MORE!
OK, go ahead!
GIVEN …WHEN …THEN …
Is that right?
58
Process of BDD
BusinessAnalyst
UI/UXDesigners
Developers
Is it OK?
GIVEN …WHEN …THEN …
59
Process of BDD
BusinessAnalyst
UI/UXDesigners
Developers
MORE!MORE!MORE!Sure!
GIVEN …WHEN …THEN …
Is it OK?
60
After BDD
• Change requests : -70%
• Regressions : -60%
• Bugs : -67%
61
After BDD
• Change requests : -70%
• Regressions : -60%
• Bugs : -67%
Improved!
62
1. Conditions and Challenges
3. TDD
2. CI/CD
4. BDD
5. Results, Problems, Possibility and Future
6. Conclusions
63
Results
64
Challenges
65
[Example] Changing scope
BusinessAnalyst
Agile Coach(The Hiro)
UI/UXDesigners
Developers
Please change scope!Please change scope!Please change scope!
66
[Example] Changing scope
BusinessAnalyst
Agile Coach(The Hiro)
UI/UXDesigners
Developers
No!Do all we planned
at first!
Please change scope!Please change scope!Please change scope!
67
BusinessAnalyst
Agile Coach(The Hiro)
UI/UXDesigners
Developers
Belong toanother (subsidiary) company
It’s impossibleto change the scope
within our company…
[Example] Changing scope
68
Asked for one executive
YES, YOU CAN!
We changed scope!
69
Technical excellence and working softwareare not the only way to improve projects.
Point
Anything is OK for improving your situation! (Anything goes/Vale tudo)
70
Possibility and future
71
[Example] Growing a collaborative culture
Developers
Got some slack time!
72
[Example] Growing a collaborative culture
Developers
Got some slack time!
Too slowemulator…
73
[Example] Growing a collaborative culture
Developers
Got some slack time!
Too slowemulator…
How aboutGenymotion?
74
[Example] Growing a collaborative culture
Developers
• Over 10 times faster• Can run via Calabash-Android
Got some slack time!
Too slowemulator…
How aboutGenymotion?
75
• Install applications : 2 minutes/change
• Regression testing : 3 minutes/change
• Change requests : 3 times/week
Can enhance “TDD” by numerical measurement
[e.g.]
76
BusinessAnalyst
Executive
Manager
Agile Coach(The Hiro)UI/UX
Designers
Developers
Use “TDD” as a measure for total optimization
Over barriers/silos
77
Don’t lose the whole picture!
78
1. Conditions and Challenges
3. TDD
2. CI/CD
4. BDD
5. Results, Problems, Possibility and Future
6. Conclusions
79
Three purposes
Efficiency
Learning
Collaboration
80
Three approaches
CI/CD
TDD
BDD
81
Three approaches by
CI/CD
TDD
BDD
82
We found this practice• through the project• with passionate members• with a lot of trial and error
83
Experience from Gemba現場主義
84
Find your answerby yourself
through your experience
85
Find your treasure!
Top Related