XP Extreme Programming XP EXTREME PROGRAMMING Joint Advanced

  • Slides: 25
Download presentation
XP Extreme Programming XP EXTREME PROGRAMMING Joint Advanced Student School (JASS) JASS 2006, Sergey

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

XP ■ ■ ■ ■ Outline What is XP? Motivation XP values XP features

XP ■ ■ ■ ■ Outline What is XP? Motivation XP values XP features Rules and practices of XP Example: Pair Programming Conclusion Experiment: Pair Drawing JASS 2006, Sergey Konovalov, Stefan Misslinger 2

XP What is XP? A system of practices that a community of software developers

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. JASS 2006, Sergey Konovalov, Stefan Misslinger 3

XP JASS 2006, Sergey Konovalov, Stefan Misslinger Extreme? 4

XP JASS 2006, Sergey Konovalov, Stefan Misslinger Extreme? 4

XP Motivation Why do we need XP? Common problems of software development: XP solutions:

XP Motivation Why do we need XP? Common problems of software development: XP solutions: Schedule slips Short iterations, fast delivery Business misunderstood Whole team Defect rate Test driven development Management Shared understanding Motivation of developers Humanity and productivity JASS 2006, Sergey Konovalov, Stefan Misslinger 5

XP Motivation Economics of Software Development Classic approach XP approach Cost of change Production

XP Motivation Economics of Software Development Classic approach XP approach Cost of change Production Testing Implementation Design Analysis Requirements Time JASS 2006, Sergey Konovalov, Stefan Misslinger Time Iterations 6

XP XP values Communication Courage Simplicity Feedback JASS 2006, Sergey Konovalov, Stefan Misslinger 7

XP XP values Communication Courage Simplicity Feedback JASS 2006, Sergey Konovalov, Stefan Misslinger 7

XP XP features XP is the most suitable for: Small and medium size projects

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 JASS 2006, Sergey Konovalov, Stefan Misslinger 8

XP Rules and practices Planning Designing Extreme Programming Coding Testing http: //www. extremeprogramming. org

XP Rules and practices Planning Designing Extreme Programming Coding Testing http: //www. extremeprogramming. org JASS 2006, Sergey Konovalov, Stefan Misslinger 9

XP The planning game Desired features User stories Determine Project Velocity Development Estimate stories

XP The planning game Desired features User stories Determine Project Velocity Development Estimate stories Prioritize Plan overall release Plan next iteration JASS 2006, Sergey Konovalov, Stefan Misslinger Business Development 10

XP Designing The metaphor is The. Simple metaphor is aa simple program to Always

XP Designing The metaphor is The. Simple metaphor is aa simple program to Always use the simplest meaningful description of explore potential possible design how the program works. solutions. Address only Ongoing redesign of that gets the job done. one problem at a time. software to improve responsiveness to K. I. S. S. change ■ Simplicity ■ System metaphor ■ Spike solution ■ Refactoring - Keep It Short and Simple JASS 2006, Sergey Konovalov, Stefan Misslinger 11

XP The customer is always available. Code must be written to Any developer can

XP The customer is always available. Code must be written to Any developer can agreed standards. change any line of code 40 -Hour Work Week Javafunctionality, Naming Conventions to add fix Programmers go home bugs, or refactor. Classes: Node, Reader, Assignable. Variable on time. Coding ■ On-site customer ■ Collective ownership ■ Pair programming ■ Coding standards ■ No overtime Variables: node, reader, variable Member variables: m_image. Source, m_reader; Methods: append(), get. Source(), delete. If. Empty() Mutator Methods: set. Toy. Owner(String owner. Name) JASS 2006, Sergey Konovalov, Stefan Misslinger 12

XP Testing ■ Extreme testing? ■ Code test first ■ Unit tests ■ Acceptance

XP Testing ■ Extreme testing? ■ Code test first ■ Unit tests ■ Acceptance tests Testcase is the specification JASS 2006, Sergey Konovalov, Stefan Misslinger 13

XP Pair Programming Example JASS 2006, Sergey Konovalov, Stefan Misslinger 14

XP Pair Programming Example JASS 2006, Sergey Konovalov, Stefan Misslinger 14

XP Example Let me see. . . Our cards says, do And weiscreating calculate

XP Example Let me see. . . Our cards says, do And weiscreating calculate our how? task? that? The price depends on the number of days Nice, so lets. How start. What with aregular 'customer' We have to calculate Letmovies usclass. write theare fee a 2 EUR testcase for thefor rented for 2 it. . . DVDs. that. Wait! days. that you rent a DVD. After the third day it's 1. 5 EUR per day. JASS 2006, Sergey Konovalov, Stefan Misslinger 15

XP Example public class Customer. Test extends junit. framework. Test. Case { public Customer.

XP Example public class Customer. Test extends junit. framework. Test. Case { public Customer. Test(String name) { super(name); } } JASS 2006, Sergey Konovalov, Stefan Misslinger 16

XP Example The best thing is, that we write a testcase-method Good, let'stest. Renting.

XP Example The best thing is, that we write a testcase-method Good, let'stest. Renting. One. Movie, write down what we have which checks the renting-fee so far. First we need a customer. And then we act the movie. The framework looks for allday methods And What's wherefor That's do And the we first how? easy put testcase? the : )every testcode? For Right. The We method simplest rent awe DVD thing write for to asserts one start isto assure and that like we have all the methods begin the withrenting 'test' and runs fee that should it is one working. be movie. 2 them. EUR. that we'd like to have. JASS 2006, Sergey Konovalov, Stefan Misslinger 17

XP Example public class Customer. Test. . . public void test. Renting. One. Movie()

XP Example public class Customer. Test. . . public void test. Renting. One. Movie() { Customer customer = new Customer(); customer. rent. Movie(1); assert. True(customer. get. Total. Charge() == 2); } } JASS 2006, Sergey Konovalov, Stefan Misslinger 18

XP Example Ok. You want me to make this test running That's also easy.

XP Example Ok. You want me to make this test running That's also easy. Exactly. : ) What would you do, if you and forget everything else for the moment. only had to implement this single test? JASS 2006, Sergey Konovalov, Stefan Misslinger 19

XP Example public class Customer { public void rent. Movie(int days. Rented) { }

XP Example public class Customer { public void rent. Movie(int days. Rented) { } public int get. Total. Charge() { return 2; } } How extreme. . . But good : ) Test a bit, code a bit, test a bit more JASS 2006, Sergey Konovalov, Stefan Misslinger 20

XP Example public class Customer. Test. . . public void test. Renting. Two. Movies()

XP Example public class Customer. Test. . . public void test. Renting. Two. Movies() { Customer customer = new Customer(); customer. rent. Movie(1); customer. rent. Movie(2); assert. Equals(4, customer. get. Total. Charge()); } } How extreme. . . But good : ) Test a bit, code a bit, test a bit more JASS 2006, Sergey Konovalov, Stefan Misslinger 21

XP Example public class Customer { private int total. Charge = 0; public void

XP Example public class Customer { private int total. Charge = 0; public void rent. Movie(int days. Rented) { total. Charge += 2; } public int get. Total. Charge() { return total. Charge; } } JASS 2006, Sergey Konovalov, Stefan Misslinger 22

XP Conclusion What you should take with you now ■ Communicate intensively ■ Test

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 JASS 2006, Sergey Konovalov, Stefan Misslinger 23

XP Have fun and thank you! JASS 2006, Sergey Konovalov, Stefan Misslinger 24

XP Have fun and thank you! JASS 2006, Sergey Konovalov, Stefan Misslinger 24

XP ■ ■ ■ Experiment: Pair Drawing How did you feel when you were

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 JASS 2006, Sergey Konovalov, Stefan Misslinger 25