Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional]...

24
Software Development Methodologies Lecturer: Raman Ramsin Lecture 10 Agile Methodologies: XP Department of Computer Engineering 1 Sharif University of Technology

Transcript of Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional]...

Page 1: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies

Lecturer: Raman Ramsin

Lecture 10

Agile Methodologies: XP

Department of Computer Engineering1

Sharif University of Technology

Page 2: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

eXtreme Programming (XP)eXtreme Programming (XP)

Developed by Beck in 1996Developed by Beck in 1996.

The first authentic XP book appeared in 1999 with aThe first authentic XP book appeared in 1999, with a revised and refined version appearing in 2004.

Although some of the methodologies that are nowadays dubbed as agile are older than XP, it was the advent of XP that sparked the agile movementXP that sparked the agile movement.

XP considers itself a software engineering disciplineXP considers itself a software engineering disciplinerather than a methodology, yet it does incorporate a process.

Department of Computer Engineering2

Sharif University of Technology

Page 3: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP: Process1. Exploration:

1. developing an initial list of high-level requirements 2 d t i i th ll d i f th t th h t t i2. determining the overall design of the system through prototyping

2. Planning (Release Planning): 1. estimating the time needed for the implementation of each requirement2 h2. prioritizing the requirements3. determining a schedule and a minimal, select set of requirements for the first release of

the system

3 Iterations to First Release: iterative development of the first release of the system3. Iterations to First Release: iterative development of the first release of the system using the specific rules and practices prescribed by XP; iterations are typically between 1 to 3 weeks in duration.

4 Productionizing: system wide verification and validation of the first release and its4. Productionizing: system-wide verification and validation of the first release, and its deployment into the user production environment

5. Maintenance: implementing the remaining requirements (including any resulting from post deployment maintenance needs) into the running system by iterating phases 2post-deployment maintenance needs) into the running system by iterating phases 2, 3 and 4.

6. Death: closing the project and conducting post-mortem review and documentation

Department of Computer Engineering3

Sharif University of Technology

Page 4: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP: Process

Department of Computer Engineering4

Sharif University of Technology

[Abrahamsson et al. 2002]

Page 5: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP: Process – Development Enginep g

The activities performed in the second, third and fourth phases of the process constitute the development “engine” of the XP methodology.methodology.

Each execution (run) of these phases produces a new release.

A first release of the system is initially produced and deployed, which is then incrementally improved and complementedwhich is then incrementally improved and complemented during the maintenance phase through further iterations (runs) of the development engine.

Department of Computer Engineering5

Sharif University of Technology

Page 6: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP: Process

Department of Computer Engineering6

Sharif University of Technology

[Ambler 2002]

Page 7: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Explorationp1. Formation of the development team: the team typically consists of

A coach acting as monitor and facilitator, a number of programmers, and a business representative (customer) participating in project activities and supplying the teamrepresentative (customer) participating in project activities and supplying the team with information and feedback[Optional] A number of analysts to help elicit the requirements, a number of testershelping define acceptance tests, and a resource manager

2. Development of the initial set of User Stories: A User Story defines a system feature as seen from the customer’s point of view. is written by the customer in his own terminology on index cards.y gyIs nothing but a short description (around three sentences) of a certain chunk of functionality needed to be delivered by the system.

3. Creation of the system Metaphor:y pA prototype (called Spike or Spike Solution) is developed, exploring potential architectures for the system. The prototype helps the team define the system Metaphor, which is typically a very simple high-level description of how the system workssimple, high level description of how the system works. It usually takes the form of a description-by-analogy in order to be easily understandable to all the team members. Though informal, the metaphor gives an extremely useful idea of the overall

hit t f th t ith t tti t t i t

Department of Computer Engineering7

Sharif University of Technology

architecture of the system without setting too many constraints.

Page 8: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Development Engine – Top-Level Activitiesp g p

Department of Computer Engineering8

Sharif University of Technology

[Wells 2003]

Page 9: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Planning (Release Planning)g ( g)1. Estimation of development time:

1. Developers estimate the time needed to develop each of the user stories as p pconforming to the system metaphor, and write the estimates down on the user-story index cards.

2. User stories that need more than 3 weeks to develop are broken down into ll d t i t ki l th 1 k dsmaller ones, and user stories taking less than 1 week are merged.

3. In cases where estimates are not reliable enough, spike solutions are developed in order to improve the estimates.

2. Prioritization of user stories: the customer prioritizes the user stories according to their business value.

3 Pl i th fi t l3. Planning the first release:1. the team selects a minimal, most valuable set of user stories for

implementation in the first release, and agrees on the release date. 2 Th t l d id th it ti d ti (b t 1 t 3 k )2. The team also decides on the iteration duration (between 1 to 3 weeks),

which once determined, will be the same for all iterations.

Department of Computer Engineering9

Sharif University of Technology

Page 10: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Iterations to First Release

1. Iteration planning: at the start of each iteration, a planning meeting is held, performing:

1. Selection of user stories to implement, and failed acceptance tests to rectifyp , p y2. Identification of programming tasks3. Task sign-up and estimation

2. Development: the development activity in each iteration is itself an iterative process with daily cycles consisting of the following activities:

1. Holding daily stand up meetings 2 l d d d C ll C d O h2. Analysis, design, coding, testing and integration in a Collective-Code-Ownership

environment

Department of Computer Engineering10

Sharif University of Technology

Page 11: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Development Engine – Iteration Activitiesp g

Department of Computer Engineering11

Sharif University of Technology

[Wells 2003]

Page 12: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Iterations to First Release – Iteration Planningg

1. Selection of user stories to implement and failed acceptance tests to rectify:based on the release plan, the customer selects user stories (according to theirbased on the release plan, the customer selects user stories (according to their business value) for development in the coming iteration. Failed acceptance tests encountered during previous iterations are also considered for inclusion in the list of jobs to be attended to. S i l tt ti i i t th i i d d i i it tiSpecial attention is given to the experience gained during previous iterations as to the team's development speed (Project Velocity), to ensure that the selected jobs can be completed in the iteration.

2 Identification of programming tasks:2. Identification of programming tasks: the developers on the team break down the selected user stories and debugging jobs into programming tasks. Tasks are then written down on the user-story index cards.Tasks are then written down on the user story index cards.

3. Task sign-up and estimation: programmers sign-up to do the tasks. Each developer estimates the time needed for completion of each of the tasksEach developer estimates the time needed for completion of each of the tasks undertaken, making sure that all of them can be developed in the time available. Each task should take between 1 to 3 days to complete.

Department of Computer Engineering12

Sharif University of Technology

Page 13: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Iterations to First Release - Developmentp

1. Holding daily stand up meetings: A short stand up meeting is held every morning in order to communicateA short stand up meeting is held every morning in order to communicate problems and solutions, and help the team keep on track.

2. Analysis, design, coding, testing and integration in a Collective-Code-Ownership environment:Ownership environment:

Collective Code Ownership means that all the code developed is put in a shared code repository, and any developer can change his or others’ code in order to add functionality, fix bugs, or refactor. y, g ,test-driven development to make collective code ownership possible:

the developers have to create unit tests for their code as they develop it. All the code in the code repository includes unit tests, forming a suite of tests that is automatically applied by test tools whenever code is added or changedautomatically applied by test tools whenever code is added or changed. The test suite safeguards the repository from malignant change: for code to be allowed integration into the repository, it must pass the entire test suite. Black-box acceptance tests based on the user stories are defined by the customer and developed by the team during the iteration and are frequently applied (byand developed by the team during the iteration, and are frequently applied (by automated tools) to the code.

Department of Computer Engineering13

Sharif University of Technology

Page 14: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Development Engine – Iteration Development Activities

Department of Computer Engineering14

Sharif University of Technology

[Wells 2003]

Page 15: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Development Engine – Iteration Development Activities

Activities in the Collective-Code-Ownership Environment

Programmers work in pairs, each pair on one machine (a practice called Pair Programming). Programmers use CRC cards in order to come up with the simplest design g p p gpossible for the programming task in hand. Refactoring is constantly done in order to simplify the code and eliminate redundancy. A common coding standard is enforced in order to promote code legibility, which in turn enhances communication among developers. Developers are moved around so that they acquire knowledge about all

t f th t thi ill d th t f h d t th tparts of the system; this will reduce the cost of changes made to the team structure and will help relieve overloading and coding bottlenecks.Builds are frequent in XP, and continuous integration is encouraged. D l t k t t i bl ith f t h kDevelopers are to work at a sustainable pace, with forty hours a week as the norm; nobody is allowed to work overtime for two weeks in a row.

Department of Computer Engineering15

Sharif University of Technology

Page 16: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Development Engine – Iteration Development Activities

Activities in the Collective-Code-Ownership Environment

Department of Computer Engineering16

Sharif University of Technology

[Wells 2003]

Page 17: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Productionizingg

1. System-wide verification and validation: The release is tested to make sure of the user’s approval and the system’s readiness for deployment.

Acceptance tests mostly developed during the iterations-to-first-release phaseAcceptance tests, mostly developed during the iterations to first release phase, are used here as regression tests. Defects found are resolved through iterations of the main development cycle.

2. Deployment into the production environment: the release is introduced into the user environment.

Involves the usual integration conversion tuning training and documentationInvolves the usual integration, conversion, tuning, training, and documentation activities typical of deployment efforts. Any tuning and stabilization action on the release itself is regarded as a development activity and is conducted through short iterations (typically weekly) of the development cycleof the development cycle.

Department of Computer Engineering17

Sharif University of Technology

Page 18: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Maintenance

The maintenance phase is when the remaining user stories are implemented into the system and the system is maintained as suchthe system and the system is maintained as such.

Encompasses the same activities as those in the phases of the development engine; i.e. Planning, Iterations to Release, and Productionizing. g, , g

Still dependent on the evolving set of user stories and the system metaphor.

The small releases produced during maintenance are integrated into an already running and operational system.

Req i ements a ising as a es lt of maintenance a e t eated as o dinaRequirements arising as a result of maintenance are treated as ordinary requirements (expressed as user stories) and implemented through the same iterative development process.

The maintenance phase continues until either there are no more user-stories to develop and none are anticipated in the future, or the system in no way lends itself to necessary evolution any more.

Department of Computer Engineering18

Sharif University of Technology

Page 19: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP Process: Death

The project is declared dead when evolution is either unnecessary or impossible.

The main activities performed in this phase of the XP process are:1. Declaring the project as closed: this involves wrapping up the usual legal,

fi i l d i l l dfinancial and social loose ends.2. Post-mortem documentation and review: preparing a short document (no longer

than ten pages) providing a brief tour of the system, and writing a review i i h l l d f h jreport summarizing the lessons learned from the project.

Department of Computer Engineering19

Sharif University of Technology

Page 20: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP: Strengths and Weaknesses

Strengths

Iterative-incremental processBased on system functionality captured in User StoriesBased on system functionality captured in User StoriesThe process is tuned according to feedback during its executionexecutionTraceability to requirements through the use of user storiesthroughout the process as the basis for tasks and testsBased on system architecture (Metaphor) identified through prototypingA ti i l tActive user involvementTest-based development

Department of Computer Engineering20

Sharif University of Technology

Page 21: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP: Strengths and Weaknesses

Strengths (Contd.)

Stringent standards enforced on codingEarly and frequent releasesEarly and frequent releasesRequirements are allowed to evolve over timeIterative development engine governed by careful planning and p g g y p greviewingExplicit coverage of maintenance and project retirement (Death) phases; maintenance in fact comprises the bulk of the(Death) phases; maintenance in fact comprises the bulk of the development effortContinuous validationContinuous integrationRefactoring exercised in order to acquire the simplest code possible

Department of Computer Engineering21

Sharif University of Technology

possible

Page 22: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP: Strengths and Weaknesses

Weaknesses

Process is rather vague: the process commonly introduced as the “XP Process” is just a typical examplethe XP Process is just a typical example.More intended as a set of principles and practices rather than a methodologygyLimited evidence of scalabilitySeamlessness is not addressed: development is more or less a jump from user stories to code, and the little design that is done (if at all) does not have to conform to any standard.

Department of Computer Engineering22

Sharif University of Technology

Page 23: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

XP: Strengths and Weaknesses

Weaknesses (Contd.)

Requires the use of automated tools and enforcement of discipline for “Collective-Code-Ownership” to be practicable.p p pNo clear-cut design effortModel-phobicExcept for CRC cards models are not prescribed leaving it toExcept for CRC cards, models are not prescribed, leaving it to the individual developer to decide what model is useful to him.Lack of formalism

Department of Computer Engineering23

Sharif University of Technology

Page 24: Software Development Methodologiesce.sharif.edu/courses/88-89/1/ce724-1/resources/... · [Optional] A number of analyststo help elicit the requirements, a number of testers helping

Software Development Methodologies – Lecture 10

References

Abrahamsson P Salo O Ronkainen J Warsta J Agile SoftwareAbrahamsson, P., Salo, O., Ronkainen, J., Warsta, J., Agile Software Development Methods: Review and Analysis. VTT Publications, 2002.

Wells D Extreme programming: A gentle introduction Published on theWells, D., Extreme programming: A gentle introduction. Published on the Web at: http://www.extremeprogramming.org, 2003, visited in April 2006.

Beck K and Andres C Extreme Programming Explained: EmbraceBeck, K., and Andres, C., Extreme Programming Explained: Embrace Change, 2nd ed. Addison-Wesley, 2004.

Ambler S W AM Throughout the XP Lifecycle Published on the Web at:Ambler, S. W., AM Throughout the XP Lifecycle, Published on the Web at: http://www.agilemodeling.com/essays/agileModelingXPLifecycle.htm, 2002, visited in April 2006.

Department of Computer Engineering24

Sharif University of Technology