+ All Categories
Home > Documents > eXtreme Programming (XP)

eXtreme Programming (XP)

Date post: 19-Mar-2016
Category:
Upload: magee
View: 26 times
Download: 6 times
Share this document with a friend
Description:
eXtreme Programming (XP). CSE301 University of Sunderland Harry R. Erwin, PhD. Sources. Stephens and Rosenberg, 2003, Extreme Programming Refactored: The Case Against XP, Apress. Fowler, 2000, Refactoring: Improving the Design of Existing Code, Addison-Wesley. - PowerPoint PPT Presentation
41
eXtreme Programming (XP) CSE301 University of Sunderland Harry R. Erwin, PhD
Transcript
Page 1: eXtreme Programming (XP)

eXtreme Programming (XP)

CSE301University of Sunderland

Harry R. Erwin, PhD

Page 2: eXtreme Programming (XP)

Sources

• Stephens and Rosenberg, 2003, Extreme Programming Refactored: The Case Against XP, Apress.

• Fowler, 2000, Refactoring: Improving the Design of Existing Code, Addison-Wesley.

• Martin, 2003, Agile Software Development: Principles, Patterns, and Practices, Prentice-Hall.

• Extensive discussions on comp.object• Ebert 2000,

http://www.ics.uci.edu/~ebert/teaching/fall2000/ics121/

Page 3: eXtreme Programming (XP)

Where do Agile Methods Fit?

• Projects where the risk is high.• Where you or your customer don’t know

where you’re going.• Projects where you have to learn and adapt.• Projects where the technology is evolving

rapidly.

Page 4: eXtreme Programming (XP)

Extreme Programming Defined (Beck, 1998, Cunningham’s wiki)• http://c2.com/cgi/wiki • Is defined by the following:

– Values– Practices– Activities– Roles

• Intended to flatten the cost of change curve.• Just one of several agile methods.

Page 5: eXtreme Programming (XP)

Manifesto for Agile Software Development (Martin 2003)

• “We are uncovering better ways of developing software by doing it and by helping others to do it. Through this work we have come to value:– Individuals and interactions over processes and tools– Working software over comprehensive documentation– Customer collaboration over contract negotiation– Responding to change over following a plan

• That is, while there is value in the items on the right, we value the items on the left more.”

Page 6: eXtreme Programming (XP)

Principles behind the Agile Manifesto (from Martin 2003)

• “Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

• Welcome changing requirements, even late in development. Agile processes harness change for the customer’s competitive advantage.

• Deliver working software frequently, from a couple of weeks to a couple of months, with a preference for the shorter timescale.

• Business people and developers must work together daily throughout the project.

Page 7: eXtreme Programming (XP)

Principles (II)• “Build projects around motivated individuals. Give them

the environment and support they need, and trust them to get the job done.

• The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.

• Working software is the primary measure of progress.• Agile processes promote sustainable development. The

sponsors, developers, and users should be able to maintain a constant pace indefinitely.

Page 8: eXtreme Programming (XP)

Principles (III)

• “Continuous attention to technical excellence and good design enhances agility.

• Simplicity—the art of maximizing the amount of work not done—is essential.

• The best architectures, requirements, and designs emerge from self-organizing teams.

• At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.”

Page 9: eXtreme Programming (XP)

Problems Targeted by XP

• Lack of communication• Requirements volatility• Software development that isn’t used.• Out of date documentation• Obsolescence

Page 10: eXtreme Programming (XP)

XP Values

• Communication—verbal, with a collocated team.

• Simplicity—always do the simplest thing that can possibly work.

• Feedback—continuous from the customer.• Courage—willingness to change.

Page 11: eXtreme Programming (XP)

Communication—Verbal, with a Collocated Team.

• Reduces the chance of misunderstanding.• Creates risks, however:

– Details get lost if they’re not written down.– You’re vulnerable to loss of personnel.

• YMMV.

Page 12: eXtreme Programming (XP)

Simplicity—Always do the Simplest Thing that can Possibly

Work.• You Ain’t Gonna Need It (YAGNI).• Absolute simplicity isn’t always the best

solution, so be as simple as possible but not too simple.

• Nonfunctional requirements will affect simplicity.

Page 13: eXtreme Programming (XP)

Feedback—Continuous from the Customer.

• Go ask the customer—he’s sitting over there.

• Also used in design:– Build a first-order prototype– Test it– Adjust it until it’s right.

• A little bit of feedback can replace a lot of analytical work.

Page 14: eXtreme Programming (XP)

Courage—Willingness to Change.

• Be willing to make design changes when they are right.

• It helps a lot to have an automatic test suite to tell you that you’re still OK.

Page 15: eXtreme Programming (XP)

XP Activities

• Coding• Testing• Listening• Designing

Page 16: eXtreme Programming (XP)

XP Roles

• Programmer• Tester• Tracker• Coach• Consultant• Big boss

Page 17: eXtreme Programming (XP)

XP Practices

• Test-driven development

• User stories• The planning game• Whole team• Short cycles• Metaphor• Simple design

• Refactor mercilessly• Collective ownership• Pair programming• Continuous integration• Sustainable pace• Coding standards• Acceptance tests• (Emergent design)

Page 18: eXtreme Programming (XP)

Test-Driven Development

• ‘The test-driven development is the method of software development where tests specify interfaces of implementation and all code must have passed the tests.’ (Wikipedia)

• Martin (2003): ‘programmers work in very short cycles, adding a failing test, then making it work.’

Page 19: eXtreme Programming (XP)

User Stories

• One or two sentences summarizing what the user wants.

• Describes how the system is supposed to work

• Written on a card.• Sufficient detail to support estimation.

Page 20: eXtreme Programming (XP)

The Planning Game

• Martin (2003): “Planning is continuous and progressive. Every two weeks, for the next two weeks, developers estimate the cost of candidate features, and customers select those features to be implemented based upon cost and business value.”

Page 21: eXtreme Programming (XP)

The Planning Game

• Planning is an emotional minefield. Of course Development would like to program faster. Of course the project manager would like to be able to say exactly how fast Development can go. Of course Business would like to be able to say exactly what they want. Of course Business would rather not change its mind. When any of the participants in planning begin acting these wishes (or rather in accordance with the fears that lie behind each wish), then planning doesn't work well. (Wikipedia)

Page 22: eXtreme Programming (XP)

How to Plan

• Maintain velocity.• Merging and splitting stories: User stories

should be ‘right-sized’.• Prototyping sessions are called ‘spikes’.

These allow the team’s velocity to be estimated.

Page 23: eXtreme Programming (XP)

XP Life Cycle

• Evolutionary development– Coding is continuous– Iterations of 1-3 weeks

• Design -> Code -> Integrate -> Test – Repeated several times a day

• Based on ‘user stories’

Page 24: eXtreme Programming (XP)

Whole Team

• Martin (2003): “All the contributers to an XP project—developers, business analysts, testers, etc.—work together in an open space, members of one team. The walls of this space are littered with big visible charts and other evidences of their progress.”

Page 25: eXtreme Programming (XP)

Short Cycles

• 1-3 week cycles. Other processes suggest a month, with weekly tracking.

Page 26: eXtreme Programming (XP)

Metaphor

• Martin (2003): “The team develops a common vision of how the program works.”

Page 27: eXtreme Programming (XP)

Simple Design

• Martin (2003): “The team keeps the design exactly suited for the current functionality of the system. It passes all the tests, contains no duplication, expresses everything the authors want expressed, and contains as little code as possible.”

Page 28: eXtreme Programming (XP)

Simple Design

• The simplest design that can meet the current set of user stories.

• “You aren’t going to need it.”• Once and only once—no code duplication.

Page 29: eXtreme Programming (XP)

Refactor Mercilessly

• We’ve discussed this.• Don’t churn the code.• Keep it clean to support extension.

Page 30: eXtreme Programming (XP)

Refactoring

• Deals with code ‘rot’.• Refactoring is a technique to restructure

code in a disciplined way. For a long time it was a piece of programmer lore, done with varying degrees of discipline by experienced developers, but not passed on in a coherent way. (Fowler)

Page 31: eXtreme Programming (XP)

Collective Ownership

• Martin (2003): “Any pair of programmers can improve any code at any time.”

Page 32: eXtreme Programming (XP)

Pair Programming

• Martin (2003): “All production software is built by two programmers, sitting side by side, at the same machine.”

• Boehm (2004) indicates that pair programming is about 10% slower, but the software fault rate of the resulting code is about 60% less. This is a ‘silver bullet’.

Page 33: eXtreme Programming (XP)

Pair Programming

• Pair Programming (ExtremeProgrammingPractice) requires two engineers to participate in one development effort at one workstation. Each member performs the action the other is not currently doing: While one types in unit tests the other thinks about the class that will satisfy the test, for example. Studies have shown that, after training for the "PeopleSkills" involved two programmers are more than twice as productive as one for a given task. (Wikipedia)

Page 34: eXtreme Programming (XP)

Continuous Integration

• Martin (2003): “The team keeps the system fully integrated at all times.”

Page 35: eXtreme Programming (XP)

Sustainable Pace

• Martin (2003): “The team is in it for the long term. They work hard, at a pace that can be sustained indefinitely. They conserve their energy, treating the project as a marathon rather that a sprint.”

Page 36: eXtreme Programming (XP)

Coding Standards

• Martin (2003): “All the code in the system looks as if it was written by a single—very competent—individual.”

Page 37: eXtreme Programming (XP)

Acceptance Tests

• Martin (2003): “As part of selecting each desired feature, the customers define automated acceptance tests to show that the feature is working.”

Page 38: eXtreme Programming (XP)

Emergent Design

• The initial design and architecture will be wrong.

• If you can’t change it, you’ll have to live with it for 10-20 years.

• Let it emerge through refactoring so it is right.

Page 39: eXtreme Programming (XP)

Interaction Between Practices• XP is believed to work only when all practices are

followed. • Then the weaknesses of one practices are covered by

the strengths of others.• For example:

– Use of emergent design is well-known to be risky. Constant refactoring protects against that risk.

– Constant refactoring is a time sink and a source of bugs—extensive unit testing protects against that.

– Reliance on unit tests does not validate the design. Pair programming protects against design errors.

Page 40: eXtreme Programming (XP)

What Practices are Provably Good?

• The following practices should be followed independently of development model:– Test-driven development– Short cycles (early warning)– Metaphor (leadership)– Simple design (KISS)– Refactor mercilessly (isn’t eclipse wonderful?)– Pair programming* (more productive than alone)– Sustainable pace (ever been ‘fried’?)– Coding standards (for yourself if no one else)

*except on homework projects…

Page 41: eXtreme Programming (XP)

Conclusions

• If XP is the answer, what is the question?• Certain kinds of problems, especially those

where you don’t know where you’re going, are particularly suitable for XP, so be prepared for it, even if on other projects you have to use a heavy-weight process.


Recommended