Agile Engineering Practices

79
An Introduction to Agile Engineering Practices 1 Kane Mar

description

My presentation to the Seattle Scrum Users group on 29th May, 2008

Transcript of Agile Engineering Practices

Page 1: Agile Engineering Practices

An Introduction to Agile Engineering Practices

1

Kane Mar

Page 2: Agile Engineering Practices

“The New New Product Development Game”

- Takeuchi and Nonaka

2

Page 3: Agile Engineering Practices

photo: http://www.flickr.com/photos/nicmcphee/

3

Page 4: Agile Engineering Practices

4

Page 5: Agile Engineering Practices

From: Kent BeckTo: Jeff Sutherland <jsutherland>Reply: [email protected]: Mon, 15 May 1995 18:01:15 -0400 (EDT)Subj: HBR paper

_________________________ Is there a good place to get reprints of the SCRUM paper from

HBR? I've written patterns for something very similar and I want to make sure I steal as many ideas as possible.

Kent

5

Page 6: Agile Engineering Practices

6

Continuous Integration

Page 7: Agile Engineering Practices

What is Continuous Integration?

7

Page 8: Agile Engineering Practices

“Continuous Integration is a software development practice where members of a

team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day.

Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible.”

-Martin Fowler

8

Page 9: Agile Engineering Practices

9

Commit

Page 10: Agile Engineering Practices

10

1. Compile & Build2. Unit Tests3. Integration Tests4. Report Errors

Commit

Page 11: Agile Engineering Practices

11

1. Compile & Build2. Unit Tests3. Integration Tests4. Report Errors

Commit

Checkout

Page 12: Agile Engineering Practices

12

1. Compile & Build2. Unit Tests3. Integration Tests4. Report Errors

Commit

Checkout

Page 13: Agile Engineering Practices

13

1. Compile & Build2. Unit Tests3. Integration Tests4. Report Errors

Commit

Checkout

Page 14: Agile Engineering Practices

14

Page 15: Agile Engineering Practices

Why is Continuous Integration important?

15

Page 16: Agile Engineering Practices

1. Reducing Risk.

16

Page 17: Agile Engineering Practices

When we are integrating the product all the time the risk of a

failed integration is spread throughout the duration of the

project ...

17

Page 18: Agile Engineering Practices

rather than being left until the end.

18

Page 19: Agile Engineering Practices

2. Behavior.

19

Page 20: Agile Engineering Practices

If doing a complete build and test of any product is difficult ...

20

Page 21: Agile Engineering Practices

doing it “continuously” is very difficult.

21

Page 22: Agile Engineering Practices

Teams need to develop different

ways of working.

22

Page 23: Agile Engineering Practices

Never letting the build break.

23

Page 24: Agile Engineering Practices

24

1. Compile & Build2. Unit Tests3. Integration Tests4. Report Errors

Commit

CheckoutA broken build or integration test here ...

Page 25: Agile Engineering Practices

25

1. Compile & Build2. Unit Tests3. Integration Tests4. Report Errors

Commit

CheckoutA broken build or integration test here ...

will get propagated here, here and here.

Page 26: Agile Engineering Practices

The Friday Afternoon Pattern of broken builds.

26

Page 27: Agile Engineering Practices

Delivering smaller increments of well tested functionality.

27

Page 28: Agile Engineering Practices

Investing in automated testing frameworks.

28

Page 29: Agile Engineering Practices

Test, Test and Test again.

29

Page 30: Agile Engineering Practices

I believe that all teams should practice CI.

30

Page 31: Agile Engineering Practices

The tools are free, like free beer.

31

Page 32: Agile Engineering Practices

The only price to pay for introducing CI is ...

32

Page 33: Agile Engineering Practices

education.

33

Page 34: Agile Engineering Practices

✦ http://www.martinfowler.com/articles/continuousIntegration.html

✦ http://cruisecontrol.sourceforge.net/✦ http://www.jetbrains.com/teamcity/✦ http://luntbuild.javaforge.com/✦ https://hudson.dev.java.net/

34

References

Page 35: Agile Engineering Practices

35

Test Driven Development

Page 36: Agile Engineering Practices

What is Test Driven Development?

36

Page 37: Agile Engineering Practices

1. Add a test

37

Page 38: Agile Engineering Practices

2. Run all test and see the new ones fail

38

Page 39: Agile Engineering Practices

3. Write some code

39

Page 40: Agile Engineering Practices

4. Run the automated tests and see them succeed

40

Page 41: Agile Engineering Practices

5. Refactor

41

Page 42: Agile Engineering Practices

Red/Green/Refactor

42

Page 43: Agile Engineering Practices

Why is TDD important?

43

Page 44: Agile Engineering Practices

TDD is a method of designing software, not merely an

approach to testing.

44

Page 45: Agile Engineering Practices

“We found that test-first students on average wrote more tests and, in turn, students who wrote more tests tended to be

more productive.”- Erdogmus, Hakan; Morisio,

Torchiano45

Page 46: Agile Engineering Practices

Over a period of time, TDD will lead to suite of automated

integration tests.

46

Page 47: Agile Engineering Practices

✦ Erdogmus, Hakan; Morisio, Torchiano. “On the Effectiveness of Test-first Approach to Programming,” Proceedings of the IEEE Transactions on Software Engineering, 31(1). January 2005. (NRC 47445). “We found that test-first students on average wrote more tests and, in turn, students who wrote more tests tended to be more productive.”

✦ Newkirk, JW and Vorontsov, AA. “Test-Driven Development in Microsoft .NET,” Microsoft Press, 2004.

✦ Feathers, M. “Working Effectively with Legacy Code,” Prentice Hall, 2004

✦ Beck, K. “Test-Driven Development by Example,” Addison Wesley, 2003

✦ Muller, Matthias M.; Padberg, Frank. “About the Return on Investment of Test-Driven Development (PDF)” Universitat Karlsruhe, Germany

47

References

Page 48: Agile Engineering Practices

48

Refactoring

Page 49: Agile Engineering Practices

What is Refactoring?

49

Page 50: Agile Engineering Practices

“Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without

changing its external behavior.”- Martin Fowler

50

Page 51: Agile Engineering Practices

“Each transformation (called a 'refactoring') does little, but a sequence of

transformations can produce a significant restructuring.”

51

Page 52: Agile Engineering Practices

double disabilityAmount() { if (_seniority < 2) return 0; if (_monthsDisabled > 12) return 0; if (_isPartTime) return 0; // compute the disability amount

double disabilityAmount() { if (isNotEligableForDisability()) return 0; // compute the disability amount

52

Page 53: Agile Engineering Practices

“Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without

changing its external behavior.”- Martin Fowler

53

Page 54: Agile Engineering Practices

How do we establish that the behavior is unchanged?

54

Page 55: Agile Engineering Practices

Continuous Integrationand

Test Driven Development

55

Page 56: Agile Engineering Practices

The term Refactoring is poorly used.

56

Page 57: Agile Engineering Practices

“If somebody talks about a system being broken for a

couple of days while they are refactoring ...”

57

Page 58: Agile Engineering Practices

“you can be pretty sure they are not refactoring ... “

58

Page 59: Agile Engineering Practices

“Refactoring is a very specific technique, founded on using

small behavior-preserving transformations”- Martin Fowler

59

Page 60: Agile Engineering Practices

✦ Fowler, Martin (1999). “Refactoring.” Addison-Wesley. ISBN 0-201-48567-2.

✦ http://martinfowler.com/bliki/RefactoringMalapropism.html

60

References

Page 61: Agile Engineering Practices

61

Pair Programming

Page 62: Agile Engineering Practices

What is Pair Programming?

62

Page 63: Agile Engineering Practices

Two team members working on the same code base and working

side-by-side

63

Page 64: Agile Engineering Practices

photo: http://www.flickr.com/photos/improveit/

64

Page 65: Agile Engineering Practices

“I told you Slashdot was more popular than Digg”

65

Page 66: Agile Engineering Practices

Modern software development is full of drama ...

66

Page 67: Agile Engineering Practices

photo: http://www.flickr.com/photos/improveit/

67

Page 68: Agile Engineering Practices

photo: http://www.flickr.com/photos/improveit/

68

Page 69: Agile Engineering Practices

The thrill of victory ...

69

Page 70: Agile Engineering Practices

And the agony of defeat.

70

Page 71: Agile Engineering Practices

Why is Pair Programming important?

71

Page 72: Agile Engineering Practices

Pair Programming significantly reduces the number of defects, and greatly increase the quality

of the code.

72

Page 73: Agile Engineering Practices

It is, however, very difficult to introduce.

73

Page 74: Agile Engineering Practices

There are many issues mostly related to loss of personal space

and lack of privacy.

74

Page 75: Agile Engineering Practices

75

Why do we care?

Page 76: Agile Engineering Practices

76

Page 77: Agile Engineering Practices

80% of the cost of software is incurred after it has gone live.

77

Page 78: Agile Engineering Practices

What would it mean to you if your cost of change was linear

rather than exponential?

78

Page 79: Agile Engineering Practices

Thank You!

79