Extreme Programming

25
1 JASS 2006, Sergey Konovalov, Stefan Misslinger XP Extreme Programming Joint Advanced Student School (JASS) XP EXTREME PROGRAMMING

description

Extreme Programming. XP. EXTREME PROGRAMMING. Joint Advanced Student School (JASS). Outline. What is XP? Motivation XP values XP features Rules and practices of XP Example: Pair Programming Conclusion Experiment: Pair Drawing. What is XP?. - PowerPoint PPT Presentation

Transcript of Extreme Programming

Page 1: Extreme Programming

1JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Extreme Programming

Joint Advanced Student School (JASS)

XPEXTREME PROGRAMMING

Page 2: Extreme Programming

2JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Outline

■ What is XP?■ Motivation■ XP values■ XP features■ Rules and practices of XP■ Example: Pair Programming■ Conclusion■ Experiment: Pair Drawing

Page 3: Extreme Programming

3JASS 2006, Sergey Konovalov, Stefan Misslinger

XP What is XP?

A system of practices that a community of software developers is evolving to address the

problems of quickly delivering quality software, and then evolving it to meet

changing business needs.

Page 4: Extreme Programming

4JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Extreme?

Page 5: Extreme Programming

5JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Motivation

XP solutions:

Short iterations, fast delivery Whole team Test driven development Shared understanding Humanity and productivity

Common problems of software development:

Schedule slips Business misunderstood Defect rate Management Motivation of developers

Why do we need XP?

Page 6: Extreme Programming

6JASS 2006, Sergey Konovalov, Stefan Misslinger

XP

Cost of change Cost of change

Time

MotivationR

equi

rem

ents

Ana

lysi

s

Des

ign

Impl

emen

tatio

n

Tes

ting

Pro

duct

ion

Time

Economics of Software Development

Classic approach XP approach

Iterations

Page 7: Extreme Programming

7JASS 2006, Sergey Konovalov, Stefan Misslinger

XP XP values

Courage

Communication

Simplicity

Feedback

Page 8: Extreme Programming

8JASS 2006, Sergey Konovalov, Stefan Misslinger

XP XP features

XP is the most suitable for: Small and medium size projects New technologies Projects with unclear requirements Risky projects

XP improves skills by cross training

No more than 20 developers in a team

Using of XP in life-critical projects is questionable

Page 9: Extreme Programming

9JASS 2006, Sergey Konovalov, Stefan Misslinger

XP

Extreme Programming

Rules and practices

Designing

TestingCoding

Planning

http://www.extremeprogramming.org

Page 10: Extreme Programming

10JASS 2006, Sergey Konovalov, Stefan Misslinger

XP

Development

Business

Development

Business

Business

Business

The planning game

Desired features

User stories

Estimate stories

Prioritize

Plan overall releasePlan next iteration

Determine Project Velocity

Development

Page 11: Extreme Programming

11JASS 2006, Sergey Konovalov, Stefan Misslinger

XP

Simple program to explore potential

solutions. Address only one problem at a time.

Always use the simplest possible design

that gets the job done.

K.I.S.S. - Keep It Short and Simple

Ongoing redesign of software to improve responsiveness to

change

The metaphor is a simplemeaningful description of how the program works.

Designing

■ Simplicity

■ System metaphor

■ Spike solution

■ Refactoring

The metaphor is a simplemeaningful description of how the program works.

Page 12: Extreme Programming

12JASS 2006, Sergey Konovalov, Stefan Misslinger

XP

Code must be written to agreed standards.

Java Naming Conventions

Classes: Node, Reader, AssignableVariable

Variables: node, reader, variable

Member variables: m_imageSource, m_reader;

Methods: append(), getSource(), deleteIfEmpty()

Mutator Methods: setToyOwner(String ownerName)

Any developer can change any line of code to add functionality, fix

bugs, or refactor.

40-Hour Work Week Programmers go home

on time.

Coding

■ On-site customer

■ Collective ownership

■ Pair programming

■ Coding standards

■ No overtime

The customer is always available.

Page 13: Extreme Programming

13JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Testing

■ Extreme testing?

■ Code test first

■ Unit tests

■ Acceptance tests

Testcase is the specification

Page 14: Extreme Programming

14JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Pair Programming

Example

Page 15: Extreme Programming

15JASS 2006, Sergey Konovalov, Stefan Misslinger

XP

What is our task?How do we calculate that?And how?Nice, so lets start with creating a 'customer' class.

Example

We have to calculate the fee for the rented DVDs.The price depends on the number of days

that you rent a DVD.

Let me see... Our cards says,that regular movies are 2EUR for 2 days. After the third day it's 1.5EUR per day.

Wait! Let us write a testcase for it...

Page 16: Extreme Programming

16JASS 2006, Sergey Konovalov, Stefan Misslinger

XPpublic class CustomerTest extendsjunit.framework.TestCase { public CustomerTest(String name) { super(name); } }

Example

Page 17: Extreme Programming

17JASS 2006, Sergey Konovalov, Stefan Misslinger

XP

What's the first testcase?The simplest thing to start is renting one movie.

Example

And how?For every method we write asserts to assurethat it is working.

And where do we put the testcode?

The best thing is, that we write a testcase-methodtestRentingOneMovie, which checks the renting-feefor the movie. The framework looks for all methods that

begin with 'test' and runs them.

Good, let's write down what we haveso far. First we need a customer. And then we act

like we have all the methodsthat we'd like to have.

Right. We rent a DVD for one day andthe fee should be 2 EUR.

That's easy :)

Page 18: Extreme Programming

18JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Example

public class CustomerTest...

public void testRentingOneMovie() {

Customer customer = new Customer();

customer.rentMovie(1);

assertTrue(customer.getTotalCharge() == 2);

}

}

Page 19: Extreme Programming

19JASS 2006, Sergey Konovalov, Stefan Misslinger

XPOk. You want me to make this test runningand forget everything else for the moment.Exactly. What would you do, if you

only had to implement this single test?

Example

That's also easy :)

Page 20: Extreme Programming

20JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Example

public class Customer {

public void rentMovie(int daysRented) {

}

public int getTotalCharge() {

return 2;

}

}

How extreme... But good :)Test a bit, code a bit, test a bit more

Page 21: Extreme Programming

21JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Example

public class CustomerTest...

public void testRentingTwoMovies() {

Customer customer = new Customer();

customer.rentMovie(1);

customer.rentMovie(2);

assertEquals(4, customer.getTotalCharge());

}

}

How extreme... But good :)Test a bit, code a bit, test a bit more

Page 22: Extreme Programming

22JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Example

public class Customer {

private int totalCharge = 0;

public void rentMovie(int daysRented) {

totalCharge += 2;

}

public int getTotalCharge() {

return totalCharge;

}

}

Page 23: Extreme Programming

23JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Conclusion

What you should take with you now

■ Communicate intensively

■ Test a bit, code a bit, test a bit more

■ Keep the design simple

■ Refactor

■ Enjoy having a safety net when refactoring

Page 24: Extreme Programming

24JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Have fun and thank you!

Page 25: Extreme Programming

25JASS 2006, Sergey Konovalov, Stefan Misslinger

XP Experiment: Pair Drawing

■ How did you feel when you were drawing solo vs. in a pair?

■ Which of the drawings are more artistic / original?■ Did you find yourself concentrating more or less

during pairing?■ Was it more fun to draw alone or in a pair?■ What did you like and what didn’t you like about

drawing alone or in a pair?

http://industriallogic.com/games/pairdraw.html