85
Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture Jul/29/2014 Hiroyuki Ito Development Process Optimization Department, Rakuten, Inc. http://www.rakuten.co.jp/

Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

Embed Size (px)

DESCRIPTION

This is the report presented at Agile2014 on "Experience Report" track. 「Agile2014」の「Experience Report」トラックで発表したスライドです。 Agile2014 http://agile2014.agilealliance.org/ Track information http://agile2014.sched.org/event/356d50c44035cafe4c27c33da03c2b80# Automation and development techniques such as Continuous Integration/Continuous Delivery, TDD (Test-Driven Development) and BDD (Behavior-Driven Development) are useful for not only efficiency but also learning and collaboration. I explained these practices as "Technology-Driven Development". CI/CD・TDD・BDD といった自動化技術・技術プラクティスは、業務効率化だけではなく、メンバーの成長およびコラボレーションの促進にも効果があります。 これらのプラクティスを "Technology-Driven Development" と命名・整理した資料になります。

Citation preview

Page 1: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

Jul/29/2014

Hiroyuki Ito

Development Process Optimization Department, Rakuten, Inc.

http://www.rakuten.co.jp/

Page 2: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

2

Hiroyuki Ito

About me

Test-Driven

Development Group

@hageyahhoo

(The Hiro)

Page 4: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

4

It’s my 3rd time to be here!

Agile2014 : as a Speaker

Page 5: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

5

This session’s theme

Technology-

Driven

Development

Page 6: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

6

Additional possibilities of automation

Page 7: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

7

“TDD” stands for three purposes

Efficiency

Learning

Collaboration

Page 8: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

8

By three approaches

CI/CD

TDD

BDD

Page 9: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

9

Three approaches by

CI/CD

TDD

BDD

Page 10: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

10

Agenda

1. Conditions and Challenges

3. TDD

2. CI/CD

4. BDD

5. Results, Problems, Possibility and Future

6. Conclusions

Page 11: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

11

1. Conditions and Challenges

3. TDD

2. CI/CD

4. BDD

5. Results, Problems, Possibility and Future

6. Conclusions

Page 12: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

12

At the end of April 2013

Business

Analyst

UI/UX

Designers

Developers

Page 13: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

13

At the end of April 2013

Business

Analyst

Agile Coach

(The Hiro)

UI/UX

Designers

Developers

HELP!

Page 14: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

14

Our target application is

Page 15: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

15

Conditions and Challenges

Page 16: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

16

Conditions and Challenges

None of the team members had

any experience with agile

Page 17: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

17

Conditions and Challenges

None of the team members had

any experience with agile

There had been

many manual operations

Page 18: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

18

Conditions and Challenges

None of the team members had

any experience with agile

There had been

many manual operations

Most of the team members

were young and immature

Page 19: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

19

What do you

think?

Page 20: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

20

I was so much excited!

Page 21: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

21

I can

achieve anything

through such a

challenging project!

WHY?

Page 22: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

22

Three approaches

CI/CD

TDD

BDD

Page 23: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

23

1. Conditions and Challenges

3. TDD

2. CI/CD

4. BDD

5. Results, Problems, Possibility and Future

6. Conclusions

Page 24: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

24

Challenges

Low performance

• So many manual tasks

Going in circles

• No clear vision and no requirements

• No timely progress information

Page 25: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

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

Page 26: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

26

The Implementation of CI/CD in our project

Page 27: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

27

The Implementation of CI/CD in our project

My PC

Page 28: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

28

The Implementation of CI/CD in our project

Check-in build (hourly) My PC

Page 29: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

29

The Implementation of CI/CD in our project

Check-in build (hourly) My PC

Build applications

and run regression tests

automatically

Page 30: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

30

The Implementation of CI/CD in our project

Check-in build (hourly) My PC

Deliver to

all team members

automatically

Build applications

and run regression tests

automatically

Page 31: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

31

The Implementation of CI/CD in our project

Check-in build (hourly) My PC

We demonstrate latest application

to the business analyst and managers

in every daily scrum

Deliver to

all team members

automatically

Build applications

and run regression tests

automatically

Page 32: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

32

Shared understanding by the working software

Business

Analyst

UI/UX

Designers

Developers

Get fast feedback Know about

the progress

Page 33: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

33

• Install applications : 2 minutes/change

• Regression testing : 3 minutes/change

• Change requests : 3 times/week

15 minutes/week

After CI/CD

Page 34: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

34

• Install applications : 2 minutes/change

• Regression testing : 3 minutes/change

• Change requests : 3 times/week

15 minutes/week

After CI/CD

Page 35: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

35

1. Conditions and Challenges

3. TDD

2. CI/CD

4. BDD

5. Results, Problems, Possibility and Future

6. Conclusions

Page 36: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

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

Page 37: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

37

Before TDD

Model

Controller DB Dao

Activity

DB Dao

DB Dao

• Could not test after we implemented all components

(Debug Later Programming)

• It took five days to implement one activity set

Page 38: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

38

Too difficult to use Android JUnit

Page 39: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

39

Too difficult to use Android JUnit

java.lang.RuntimeException: Stub! (゚Д゚)

Page 40: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

40

Too difficult to use Android JUnit

java.lang.RuntimeException: Stub! (゚Д゚)

Why we need an emulator or a device? :-o

Page 41: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

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 :-<

Page 42: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

42

Solution to do TDD on Android

Page 43: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

43

Solution to do TDD on Android

• Robolectric : Do all unit testing only on JVM

• http://robolectric.org/

• Without any emulator or device!

Page 44: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

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/

Page 45: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

45

@Before

public void setUp() {

Create database for Test;

Insert test data;

}

@Test

public void findXxx() {

Assertions;

}

@After

public void tearDown() {

Drop Database for Test;

}

Image of Unit testing for Dao by using Robolectric

5 minutes -> 0.5 seconds

to run each test case.

Page 46: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

46

After TDD

Model

Controller DB Dao

Activity

DB Dao

DB Dao

• 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)

Page 47: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

47

1. Conditions and Challenges

3. TDD

2. CI/CD

4. BDD

5. Results, Problems, Possibility and Future

6. Conclusions

Page 48: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

48

Challenges

Avoid feature creep

Detect bugs and regressions

on use-cases

Learn domain knowledge effectively

Page 49: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

49

Example of feature creep

Business

Analyst

UI/UX

Designers

Developers

DONE!

Page 50: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

50

Example of feature creep

Business

Analyst

UI/UX

Designers

Developers

MORE!

MORE!

MORE!

More features!

DONE!

Page 51: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

51

Example of feature creep

Business

Analyst

UI/UX

Designers

Developers

MORE!

MORE!

MORE!

More features!

DONE!

NUUN

Page 52: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

52

Example of feature creep

Business

Analyst

UI/UX

Designers

Developers

MORE!

MORE!

MORE!

More features!

DONE!

NUUN

Page 53: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

53

Calabash-android: improve the discipline

• The wrapper of Cucumber for Android

• As an executable specification

• As a communication tool

Specifying collaboratively with

business analyst, designers and developers

• By specification with examples

Page 54: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

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 are

RUNNABLE!

We can write data

with table style like this

Page 55: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

55

We want to…

Process of BDD

Business

Analyst

UI/UX

Designers

Developers

We want to…

Page 56: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

56

Process of BDD

Business

Analyst

UI/UX

Designers

Developers GIVEN …

WHEN …

THEN …

Is that right?

MORE!

MORE!

MORE!

We want to…

Page 57: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

57

Process of BDD

Business

Analyst

UI/UX

Designers

Developers

MORE!

MORE!

MORE!

OK, go ahead!

GIVEN …

WHEN …

THEN …

Is that right?

Page 58: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

58

Process of BDD

Business

Analyst

UI/UX

Designers

Developers

Is it OK?

GIVEN …

WHEN …

THEN …

Page 59: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

59

Process of BDD

Business

Analyst

UI/UX

Designers

Developers

MORE!

MORE!

MORE!

Sure!

GIVEN …

WHEN …

THEN …

Is it OK?

Page 60: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

60

After BDD

• Change requests : -70%

• Regressions : -60%

• Bugs : -67%

Page 61: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

61

After BDD

• Change requests : -70%

• Regressions : -60%

• Bugs : -67%

Page 62: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

62

1. Conditions and Challenges

3. TDD

2. CI/CD

4. BDD

5. Results, Problems, Possibility and Future

6. Conclusions

Page 63: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

63

Results

Page 64: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

64

Challenges

Page 65: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

65

[Example] Changing scope

Business

Analyst

Agile Coach

(The Hiro)

UI/UX

Designers

Developers

Please change scope! Please change scope! Please change scope!

Page 66: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

66

[Example] Changing scope

Business

Analyst

Agile Coach

(The Hiro)

UI/UX

Designers

Developers

No!

Do all we planned

at first!

Please change scope! Please change scope! Please change scope!

Page 67: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

67

Business

Analyst

Agile Coach

(The Hiro)

UI/UX

Designers

Developers

Belong to

another (subsidiary) company

It’s impossible

to change the scope

within our company…

[Example] Changing scope

Page 68: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

68

Asked for one executive

YES, YOU CAN!

We changed scope!

Page 69: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

69

Technical excellence and working software

are not the only way to improve projects.

Point

Anything is OK for improving your situation!

(Anything goes/Vale tudo)

Page 70: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

70

Possibility and future

Page 71: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

71

[Example] Growing a collaborative culture

Developers

Got some slack time!

Page 72: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

72

[Example] Growing a collaborative culture

Developers

Got some slack time!

Too slow

emulator…

Page 73: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

73

[Example] Growing a collaborative culture

Developers

Got some slack time!

Too slow

emulator…

How about

Genymotion?

Page 74: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

74

[Example] Growing a collaborative culture

Developers

• Over 10 times faster

• Can run via Calabash-Android

Got some slack time!

Too slow

emulator…

How about

Genymotion?

Page 75: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

75

• Install applications : 2 minutes/change

• Regression testing : 3 minutes/change

• Change requests : 3 times/week

Can enhance “TDD” by numerical measurement

[e.g.]

Page 76: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

76

Business

Analyst

Executive

Manager

Agile Coach

(The Hiro) UI/UX

Designers

Developers

Use “TDD” as a measure for total optimization

Over barriers/silos

Page 77: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

77

Don’t lose the whole picture!

Page 78: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

78

1. Conditions and Challenges

3. TDD

2. CI/CD

4. BDD

5. Results, Problems, Possibility and Future

6. Conclusions

Page 79: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

79

Three purposes

Efficiency

Learning

Collaboration

Page 80: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

80

Three approaches

CI/CD

TDD

BDD

Page 81: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

81

Three approaches by

CI/CD

TDD

BDD

Page 82: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

82

We found this practice

• through the project

• with passionate members

• with a lot of trial and error

Page 83: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

83

Experience from Gemba

現場主義

Page 84: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

84

Find your answer

by yourself

through your experience

Page 85: Technology-Driven Development: Using Automation and Development Techniques to Grow an Agile Culture

85

Find your treasure!