Computer Science and Software Engineering University of Wisconsin - Platteville Note 6. Extreme Programing and Test- Driven Development Yan Shi Lecture.

Slides:



Advertisements
Similar presentations
© University of Glamorgan1 Extreme Programming and its effect on project management Second Computing Project Management Workshop 13 September 02, University.
Advertisements

Extreme Programming Alexander Kanavin Lappeenranta University of Technology.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Rapid software development.
Alternate Software Development Methodologies
NAUG NAUG Knowledge Evening – th February 2007.
Agile
Agile Requirements Methods CSSE 371 Software Requirements and Specification Mark Ardis, Rose-Hulman Institute October 26, 2004.
Agile Methods and Extreme Programming CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 23, 2007.
EXtreme Programming Quick Introduction Daniel Arraes Pereira Eduardo Lourenço Apolinário Ricardo de Oliveira Cavalcanti.
Computer Engineering 203 R Smith Agile Development 1/ Agile Methods What are Agile Methods? – Extreme Programming is the best known example – SCRUM.
Extreme Programming--a “New” Process Model Extreme Programming-- a “New” Process Model.
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Chapter 3 – Agile Software Development Lecture 2 1Chapter 3 Agile software development.
Chapter 3 – Agile Software Development 1Chapter 3 Agile software development.
Sofia Bulgaria Summer School IST eXPERT: Best Practice on e-Project Development 30 June - 2 July 2003 eXtreme programming.
Extreme Programming(XP)
Agile and XP Development Dan Fleck 2008 Dan Fleck 2008.
Unified Process versus Extreme Programming. Outline Compare and contrast UP and XP  Processes / Disciplines  Management  Artefacts Risk management.
1 e X treme P rogramming D. Dranidis September 2000 CITY College.
Coming up: What is Agile? XP Development Dan Fleck 2010 Dan Fleck 2010.
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
1 Software Process Models-ii Presented By; Mehwish Shafiq.
Chapter 3 – Agile Software Development Lecture 2 1Chapter 3 Agile software development.
Rapid software development 1. Topics covered Agile methods Extreme programming Rapid application development Software prototyping 2.
Extreme Programming (XP). Agile Software Development Paradigm Values individuals and interactions over processes and tools. Values working software over.
XP – Extreme Programming
Agile
1 김 수 동 Dept. of Computer Science Soongsil University Tel Fax
Sofia Bulgaria Summer School IST eXPERT: Best Practice on e-Project Development 30 June - 2 July 2003 eXtreme programming.
CS 5150 Software Engineering Lecture 3 Software Processes 2.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 other methodologies 1 Method/Process = step-by-step description of the steps involved.
Chapter 7 The Practices: dX. 2 Outline Iterative Development Iterative Development Planning Planning Organizing the Iterations into Management Phases.
Extreme Programming (XP) XP is an agile methodology: –aims to be responsive to change Theme running through XP is the importance of communication –amongst.
AP-1 4. Agile Processes. AP-2 Agile Processes Focus on creating a working system Different attitude on measuring progress XP Scrum.
Goals for Presentation Explain the basics of software development methodologies Explain basic XP elements Show the structure of an XP project Give a few.
CS5103 Software Engineering Lecture 02 More on Software Process Models.
Lecture 4 – XP and Agile 17/9/15. Plan-driven and agile development Plan-driven development A plan-driven approach to software engineering is based around.
Requirements Engineering Requirements Engineering in Agile Methods Lecture-28.
Extreme programming (XP) Variant of agile Takes commonsense practices to extreme levels © 2012 by Václav Rajlich1.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix B Agile Methodologies B.1.
Extreme Programming. Extreme Programming (XP) Formulated in 1999 by Kent Beck, Ward Cunningham and Ron Jeffries Agile software development methodology.
Agile. Processes Waterfall Traditional With prototyping Sprial Agile Dynamic Systems Development Method (DSDM) Scrum Crystal eXtreme Programming (XP)
Agenda: Overview of Agile testing Difference between Agile and traditional Methodology Agile Development Methodologies Extreme Programming Test Driven.
CS223: Software Engineering Lecture 18: The XP. Recap Introduction to Agile Methodology Customer centric approach Issues of Agile methodology Where to.
Introduction to Software Engineering Muhammad Nasir Agile Software Development(2)
Software Engineering 2004 Jyrki Nummenmaa 1 Why new software methodologies The classic waterfall-model based techniques are strongly based on the.
1 Introduction to eXtreme Programming Remko Popma Azzurri Ltd.
Extreme Software Engineering A Hands-On Approach From Extreme Software Engineering: A Hands-On Approach Daniel H. Steinberg Daniel W. Palmer.
Extreme programming (XP) Advanced Software Engineering Dr Nuha El-Khalili.
By Manish Shrotriya CSE MS 4 Point Agile Manifesto 1.Individuals and interactions over processes and tools 2.Working software over comprehensive.
Software Development. The Software Life Cycle Encompasses all activities from initial analysis until obsolescence Analysis of problem or request Analysis.
Coming up: What is Agile? XP Development Dan Fleck 2010 Dan Fleck 2010.
Project Management Software development models & methodologies
Chapter 3 Agile software development 1 Chapter 3 – Agile Software Development.
AGILE METHODS Curtis Cook CS 569 Spring 2003.
CS223: Software Engineering
Software Development.
Appendix B Agile Methodologies
Extreme Programming.
Johanna Rothman Create Technical Excellence Chapter 9
Teaching slides Chapter 1.
Agile and XP Development
Agile and XP Development
Chapter 3 – Agile Software Development
Agile and XP Development
Coming up: What is Agile?
Agile Development – a new way of software development?
Extreme Programming.
Extreme Programming (and Pair Programming)
Presentation transcript:

Computer Science and Software Engineering University of Wisconsin - Platteville Note 6. Extreme Programing and Test- Driven Development Yan Shi Lecture Notes for SE 3730 / CS 5730

Outline  What is extreme programming?  12 key practices of XP.  Test-driven development

Extreme Programming (XP)  One of several popular Agile Processes.

Extreme Programming (XP)  Zoom into each iteration:

12 Key Practices of XP Team Whole teamCollective ownershipMetaphor Process Planning gameSmall releaseContinuous integrationCustomer testsSustainable pace Programming Simple designRefactoringPair programmingCoding standards

12 KEY PRACTICES OF XP

The Whole team  Put the whole team in one room.  The team must include a customer advocate who can provide requirements and set priorities.  The customer advocate must possess end user domain knowledge.  Other roles that must be filled are: —Testers – who help the customer construct acceptance tests. —Analysts – who help the customer define/refine specifications. XP uses short descriptions called stories. Generally no more than fits on a note card. —Manager – who provides resources, handles external communications, and coordinates activities. —Designer/Programmers – design, implement, test, and optimize the code.

Collective Ownership  All team members are allowed access to all code! —No need to wait for the “owner of the code”! —If a problem is found, it can be fixed by the finder immediately. —If an enhancement is necessary, get it done.  Benefit: speed up the development!  People may not work on code they are familiar with. Is it a problem? —spread of knowledge because of team rotation —pair programming —automated unit test to run against TDD!

Metaphor  Metaphor: a simple shared story of how the program works (developed by the team). —unify an architecture —share common sets of names and terms  Car or vehicle?  Client or customer?  Benefit: make sure all communication is accurate.

Planning Game  Create a little emotional distance from planning by treating it as a game.  Release planning —The customer defines stories and programmers provide rough cost estimates. —The customer decides the priorities. —Break stories into small groups  releases.  Iteration planning —Average iteration shoots for ~2 weeks —The customer does fine tuning of what will be delivered. —The team break stories into tasks and estimate costs. —Together they decide what will be in the next iteration/release.  The release plan is dynamic and updated at each iteration plan.

Small Release  Each release is very short and you only provide the code for a very small set of functionalities (a few stories).  Releases are delivered to end users for evaluation and feedback. —visible progress: Customer would rather see a product than a status report! —instant feedback.

Continuous Integration  The system is fully integrated at all time. —Systems are built, integrated and tested at least once a day. (nightly build) —Share each refactor/addition with all team members immediately.  Small increments  fast integration: system is never far from last successful integration.

Customer Tests  Customers define automated acceptance tests for each feature.  XP team builds the tests.  Objective: review and validate requirements.  Automation of tests is important: —regression test: unit, integration, acceptance

Sustainable Pace  Originally “40-hour week”.  Work when you are fresh; stop when you are tired! —Minimize overtime to keep people working efficiently and keep spirits up. —Working longer hours may become counter- productive: higher error rate, less LOC/hour, worse health, more stress, … —Jobs that require complex mental functions can sustain 60 hour weeks for very short duration!

Simple Design  Design on the go! —Start simple and keep it simple. —At release planning, have a sketch of the overall picture. —At iteration planning, have a quick design session. —Refine your design: look for simpler alternatives. —Refactor previous design to adjust to new features or to optimize.  XP does no spend less time on analysis and design; it only spreads it out more evenly!

Refactoring  Design and code continuous improvement! —e.g. a = y*y+2*y*x+x*x;  After finishing each feature, refactor to —decrease complexity; —achieve high cohesion and low coupling;  Code Smells – ways to identify things to improve Code Smells —Classes/Methods are too long —Switch statement (instead of inheritance) —“Struct” class ( lots of getter and setters but few functions) —Duplicate code —Over-dependence on primitive types —many more…  a=x+y; a=a*a;

Pair Programming  “My mind to your mind. My thoughts to your thoughts...”  Two roles: —driver: write the code —copilot/navigator: watch, correct, suggest  Pair with multiple partners —spread the ideas and techniques within the group  Benefit of Pair Programming: —Real-time code reviews  typos, cognitive dropouts, and invalid assumptions —Avoid distractions —Managing of two —Knowledge and information migration

Coding Standards  People on a team often have different preferences and might need to agree on something.  Adherence to a strong coding standard makes the code easy for anyone on the team to follow. —naming convention: BumpyCase or underscore? —where to put the braces? —indentation —tabs —…

TEST DRIVEN DEVELOPMENT

Test Driven Development  In each release, before coding, develop a unit test for each story!  Make the test work by adding code.  The tests become part of the product and are executed every time the code is released/refactored.  Key: don’t do more than needed!  Why TDD? —The developer is better focusing on what MUST be implemented to pass the unit test. —The code is unit tested when completed. —Provide documentation for different team members.

Wake’s Traffic Light Metaphor Yellow Red Green The test doesn’t compile! The test compiles, but the code fails. The test passes!  classes and methods need to be implemented.  work on the code.  check in the code and continue to the next story.

Normal Cycle 1.Start. (Green light!) 2.Write a test. 3.Try to run the test.  It fails to compile, because the code is not written yet. (Yellow light!) 4.Write a stub for the new routine. 5.Recompile the test and the stub  It now compiles 6.Try to run the test. It fails, because the stub doesn't do anything yet. (Red light!) 7.Write the body of the stubbed routine. 8.Recompile the test 9.Try to run the test. It passes. (Green light again!) Or it still needs work (Red light!) and the production code needs more work.  Eventually it will work and go to (Green light) 10.Start the cycle again for the next routine.

Abnormal Conditions  From Green to Green:  From Green to Red:  From Yellow to Yellow:  From Yellow to Green:  From Red to Yellow:  From Red to Red:

Abnormal Conditions  From Green to Green: The test passed right away. —Either the test is bad, or you've already implemented the feature being tested. —You might consider modifying the implementation just to see the test fail.  From Green to Red: The test failed right away. —This is OK if it's a new test for an existing routine.  rework the routine!  From Yellow to Yellow: syntax error creating the stub.  From Yellow to Green: The test didn't compile without the stub, but adding the stub let the test pass. —Suspicious: if a do-nothing stub makes the test work, is the test valid?  From Red to Yellow: syntax error implementing the routine. This happens a lot!  From Red to Red: New code didn't work. —This happens to everyone - just fix the code. But - if it happens a lot, it's telling you to move to smaller tests (so you'll add smaller bits of new code as well).

Summary  12 key practices of XP +  TDD —traffic light metaphor