XP: Planning, coding and testing. Practice Planning game. Release Planning. User stories. Annika Silvervarg

Similar documents
XP: Planning, coding and testing. Planning. Release planning. Release Planning. User stories. Release planning Step 1.

Introduction to Extreme Programming

Agile Manifesto & XP. Topics. Rapid software development. Agile methods. Chapter ) What is Agile trying to do?

Software Development Methodologies

Introduction to Extreme Programming. Extreme Programming is... Benefits. References: William Wake, Capital One Steve Metsker, Capital One Kent Beck

defined. defined. defined. defined. defined. defined. defined. defined. defined.

Extreme programming XP 6

XP Evolution Rachel Davies

E xtr B e y CS R m oy 6704, e T a P n a Spring r n o d J g ia n 2002 r g a S m hu m ing

Development Processes Agile Adaptive Planning. Stefan Sobek

User Stories Applied, Mike Cohn

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

User Stories Applied, Mike Cohn

Introduction to User Stories. CSCI 5828: Foundations of Software Engineering Lecture 05 09/09/2014

Software Engineering I (02161)

Bridge Course On Software Testing

Improved Database Development using SQL Compare

Software Development Process Models

Categorizing Migrations

Analysis of the Test Driven Development by Example

CaseComplete Roadmap

Systems Analysis and Design in a Changing World, Fourth Edition

Testing Agile Projects Stuart Reid

Test Driven Development. René Barto SES Agile Development - Test Driven Development

Sample Exam. Advanced Test Automation - Engineer

Acceptance Testing. Copyright 2012 Gary Mohan.

Testing in Agile Software Development

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015

Answers NOT TO BE PRINTED

Sample Exam Syllabus

Black-box Testing Techniques

How Can a Tester Cope With the Fast Paced Iterative/Incremental Process?

Business Analysis for Practitioners - Requirements Elicitation and Analysis (Domain 3)

Story Writing Basics

Agile Development

Higher-order Testing. Stuart Anderson. Stuart Anderson Higher-order Testing c 2011

ASTQB Advance Test Analyst Sample Exam Answer Key and Rationale

Hands-On Lab. Agile Planning and Portfolio Management with Team Foundation Server Lab version: Last updated: 11/25/2013

Optimize tomorrow today.

Test Automation. Fundamentals. Mikó Szilárd

Testing in the Agile World

BEHAVIOR DRIVEN DEVELOPMENT BDD GUIDE TO AGILE PRACTICES. Director, Strategic Solutions

Story Refinement How to write and refine your stories so that your team can reach DONE by the end of your sprint!

Processes, Methodologies and Tools. Fall 2005

Using Storyotypes to Split Bloated XP Stories

FDD Process #1: Develop an Overall Model

Up and Running Software The Development Process

Architecture and Design Evolution

CS 307: Software Engineering. Lecture 10: Software Design and Architecture

Evolutionary Architecture and Design

Announcements. Presentations on Wednesday. Testing Practice. CS169 Lecture 8 (with slides from Alex Aiken, George Necula,Tom Ball) Reality

GETTING STARTED. Introduction to Backlog Grooming

Integration With the Business Modeler

Agile Test Automation ICAgile

9 th CA 2E/CA Plex Worldwide Developer Conference 1

A learning initiative for all What is it? - What does it cost? Usability Mapping. By CAT - i

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

2014 Intelliware Development Inc.

Inside JIRA scheme, everything can be configured, and it consists of. This section will guide you through JIRA Issue and it's types.

כללי Extreme Programming

Linköpings universitet 2. Practical agrement. Setting up the room. Definition of Done. Start on product backlog. User story template

Practical Objects: Test Driven Software Development using JUnit

Managing Superfund Field Data

Business Requirements Document (BRD) Template

1. Introduction and overview

02291: System Integration

Content Development Reference. Including resources for publishing content on the Help Server

Adopting Agile Practices

A few more things about Agile and SE. Could help in interviews, but don t try to bluff your way through

The Need for Agile Project Management

15-498: Distributed Systems Project #1: Design and Implementation of a RMI Facility for Java

Unit 6 - Software Design and Development LESSON 8 QUALITY ASSURANCE

Automated Testing of Tableau Dashboards

Technology Background Development environment, Skeleton and Libraries

Agile Testing Course: 15 16/11

5 Object Oriented Analysis

Software Design COSC 4353/6353 D R. R A J S I N G H

Lecture 23: Domain-Driven Design (Part 1)

Get more out of technology starting day one. ProDeploy Enterprise Suite

Entrance exam - Informatics

Automate Transform Analyze

Enterprise Architect Training Courses

Git Branching for Agile Teams

User Stories for Agile Requirements. Mike Cohn - background. Copyright Mountain Goat Software, LLC

Standards for Test Automation

The Integration Phase Canard. Integration and Testing. Incremental Integration. Incremental Integration Models. Unit Testing. Integration Sequencing

Software Engineering I (02161)

Topics in Software Testing

McCa!"s Triangle of Quality

Based on the slides available at book.com. Graphical Design

Sample Exam. Advanced Test Automation Engineer

WHY AN APP? Communicate, Educate, Train, & Sell

The Path Not Taken: Maximizing the ROI of Increased Decision Coverage

Improve Under Performing Web Content with a Content Audit DAVID STURTZ DIRECTOR OF PRODUCT STRATEGY

18-642: Software Development Processes

Creating an Intranet using Lotus Web Content Management. Part 2 Project Planning

LEVELS OF TESTING AND SPECIAL TESTS

Collaborative Events and Shared Artefacts

Process of Interaction Design and Design Languages

HPE ALM Standardization as a Precursor for Data Warehousing March 7, 2017

Transcription:

XP: Planning, coding and testing Annika Silvervarg Practice Planning game Goal: schedule the most important tasks Which features to implement in what order Supports: simple design, acceptance testing, regular releases Requires: active customer, mutual respect Release planning Release Planning Customer presents the desired features to the programmers Programmers estimate their difficulty Customer lays out a plan for the project Initial release plans are necessarily imprecise. However, even the first release plan is accurate enough for decision making and XP teams revise the release plan regularly Release planning Step 1 User stories Customers write user stories Each story represents a desired feature and all stories represent the specification of the system About three sentences of text in the customers terminology Provide enough detail to make a reasonably estimate of how long the story will take to implement Stories should be assigned business value: essential, highly valuable or good idea Developers can suggest stories but the customer has always final say Stories can be added, changed or deleted during the project 1

Writing user stories User story template The customer get a stack of cards Scribble on one card, then tear it up! Customer writes a story Developers ask questions for clarification (not implementation) Tear up cards and write new ones when needed Title (one line describing the story) Narrative: As a [role] I want/can [feature] (So that/because [benefit]) For backbone development, try to relate it to customer need and break it down in stories User story examples Release planning Step 2 Initial: The user can search for a book After clarification: The user can search for a book by Title, and display the result as a list Developers estimate how long the stories might take to implement Each story will get a 1, 2 or 3 days estimate in ideal development time Longer than 3 days means that the customer need to break the story down further and less than 1 day that it is at too detailed a level, combine some stories Stories should be assigned technical risk: low, medium, high Estimating user stories Release planning Step 3 Intuitive time estimates how long it would take if you programmed all days without interruptions, compare the different stories for difficulty Spike solution experiment to get an idea of how a problem can be solved Estimate by comparison compare a story with the previously implemented stories Together developers and customers move the cards around on a large table to create a set of stories to be implemented as the first/next release A useable, testable system that makes good business sense delivered early is desired You may plan by time or by scope either how many stories can be implemented before a given date (time), or how long a set of stories will take to finish (scope) 2

Iteration planning Iteration planning Step 1 Project velocity is based on previous iteration Number of completed stories/tasks/ideal hours divided by actual hours Customer choose stories from release plan Failed acceptance tests to be fixed are also selected Project velocity Iteration planning Step 2 With six programmers and two-week iterations, a total of 60 programmer-days (6 programmers x10 days) are available With an initial velocity set to 1/3, a good start would be to plan 20 ideal days worth of work in the iteration We recomend initial velocity at 0.5 and the time unit is hours, this gives: 0.5 x 30 hours x Num of devs = total time for iteration The user stories and failed tests are broken down into the programming tasks that will support them by the developers Tasks are written down on index cards like user stories While user stories are in the customer's language, tasks are in the developer's language Duplicate tasks can be removed Each story has a corresponding task card for writing an acceptance test together with the customer Iteration planning Step 3 Planning poker Developers sign up to do the tasks and then estimate how long their own tasks will take to complete* Each task should be estimated as 1, 2, or 3 ideal programming hours in duration Tasks which are shorter than 1 hour can be grouped together and tasks which are longer than 3 hours should be broken down farther * or estimates are made by the team and tasks divided at the end of the session, or put in a stack where developers choose one at a time 3

Planning poker Iteration planning Step 4 A task is presented and briefly discussed (max 2 min) Each participant chooses from his own deck the numbered card that represents his estimate All estimates are kept private until each participant has chosen a card All estimates are revealed If estimates differ, the high and low estimators explain their estimates The process is repeated until estimates are similar Total up the time estimates in ideal programming hours of the tasks, this must not exceed the project velocity from the previous iteration If the iteration has too much then the customer must choose user stories to be put off until a later iteration (snow ploughing) If estimates are shown to be wrong during development work, ask the customer to adjust the scope of the iteration The first iteration Choose several small tasks to lay a basic architecture Do as much of the end-to-end application as possible Helps gather data for future iterations Choose velocity 0 and ask the customer to choose new stories during the process, or Choose an arbitrary velocity, e.g.. 0.5 Start with the most important/highest risk task first Write down how your estimates were Planning game workflow A picture says more than a thousand words?! Development Coding Choose task (Planning game) Pair up (Pair programming) Write unit test (Test-driven development) Code (Code and Design Simply, Coding Standards) Ask user for clarification (On-site customer) Clean up (Refactor Mercilessly, Collective code ownership) Check in test and code (Continuous integration, Collective code ownership) Go home after 8 hours (Sustainable pace) 4

Practice Pair Programming Pair programming Goal: spread knowledge, experience and ideas Pairs work together on (small) tasks Driver focus on details of the task, Navigator focus on project as whole Supports: collective code ownership, comprehensive testing, simple design, refactoring, good development practices, teamwork Requires: facilities designed for pairs, developers willing to try pair programming, managers willing to try pair programming, coding standards Practice Test-driven Development Testing Goal: prove that the code works as it should Acceptance test, write a test together with the customer for each requirement Unit tests, write a test that fails, write code, check that the test is passed, refactor, automate test Supports: refactoring, regular releases, collective code ownership Requires: positive peer pressure, good communication between developers and customers Defects are expensive, but eliminating defects are also expensive The sooner a defect is found the cheaper to fix it Acceptance tests test the functionality of the whole system (customer) Unit tests test the components (developers) Once the test runs, the team keeps it running correctly thereafter. This means that the system only improves, always notching forward, never backsliding Acceptance test Acceptance test template Acceptance tests are created from user stories During an iteration the user stories selected will be translated into acceptance tests by the customer A story can have one or many acceptance tests, each acceptance test represents some expected result from the system Customers are responsible for verifying the correctness of the acceptance tests and decide which failed tests are of highest priority to fix in the next iteration Scenario 1: Title Narrative: Given [context] (And [some more context]...) When [event] Then [outcome] (And [another outcome]...) 5

Acceptance test examples Acceptance test examples cont User story Search for book by Title The user can search for a book by Title, and display the result as a list Acceptance test Given a book title and a database where books with this title exist, When the user searches Then the books with the title are displayed in a list Acceptance test Given a book title and a database where books with this title are missing, When the user searches Then the message No books that match the query is displayed Acceptance test examples cont Acceptance test example cont User story Payment The customer can pay by credit card Acceptance test Payment everything ok Given a VISA card with correct card id number, expiration date and purchase amount under card limit, When the user pays Then payment goes through and user receives confirmation on purchase Acceptance test Over card limit Given a VISA card with correct card id number, expiration date and purchase amount over card limit When the user pays Then payment fails and user receives error message Automating acceptance tests Unit tests Define input and expected output Write functional test as programs Have a scripting language simulate GUI commands Have an input recorder and ask the customer use it to define a test Automate tests incrementally as needed Can be tricky for highly interactive GUI systems First you should create or download a unit test framework to be able to create automated unit tests suites (http://www.xprogramming.com/software.htm) Second you should test all classes in the system (Trivial getter and setter methods are usually omitted) And last you should try to create your tests first, before the code Unit tests are released into the code repository along with the code they test 6

Bug tests Practice Code and Design Simply When a bug is found tests are created to guard against it coming back A bug in production requires an acceptance test be written to guard against it Given a failed acceptance test, developers can create unit tests to show the defect from a more source code specific point of view When the unit tests run at 100% then the failing acceptance test can be run again to validate the bug is fixed Goal: code that is easy to change Do the Simplest Thing That Could Possibly Work You Aren t Gonna Need It Once and Only Once Supports: collective code ownership, refactoring, testing Requires: good communication between developers and customers, confidence, ability to recognize simplicity Do the Simplest Thing That Could Possibly Work Balance functionality with simplicity Process: Solve the current problem Implement it simply Code should pass all tests and nothing more Clean up Discovering the simplest solution can be hard, avoid what if? You Aren t Gonna Need It Do today s work today and tomorrow's work tomorrow, do not guess ahead Do not add flexibility if not needed, makes the code more complex The customer/user identifies what needed Practice Coding Standards Practice On-site customer Goal: communicate ideas clearly through code Conventions that evolves with the project Start with existing style guides and naming conventions Supports: refactoring, pair programming, collective code ownership Requires: developer teamwork, occasional review, pair programming Goal: handle business concerns accurately and directly Customer set project s goal and schedule If impossible to have on-site a proxy may be used Supports: planning game, acceptance testing, regular releases Requires: initial investment, common vocabulary Try once or twice! 7

Practice Refactor Mercilessly Once and Only Once Goal: optimal code design Improve the design without changing the behaviour Do it regularly Supports: simple design, disciplined coding Requires: discipline, comprehensive tests, collective code ownership, coding standards Eliminate repetition, simplify code by removing complexity Refactor! Process Write code to solve problem When you write similar code refactor to remove duplication Next time you write similar code generalise to cover all cases you will encounter Practice Collective Code Ownership Goal: spread responsibility to whole team Any developer can change any code if needed to complete a task Supports: refactoring, pair programming Requires: coding standards, comprehensive testing, frequent integration, shared vocabulary Practice Integrate Continually Goal: reduce impact of adding new features Merge tasks and tests to whole as soon as they are completed Supports: refactoring, releasing regularly Requires: collective source repository, comprehensive testing, quick test suite, planning game, work at a sustainable pace SVN is probably a good idea! Practice Sustainable Pace The XP project Goal: go home tired, but not exhausted Time is fixed, adjust the scope if necessary Facilitated by: planning game, onsite customer, integrate continually, regular releases 8

Acceptance test Other types of testing Acceptance tests are created from user stories During an iteration the user stories selected will be translated into acceptance tests by the customer A story can have one or many acceptance tests, each acceptance test represents some expected result from the system Customers are responsible for verifying the correctness of the acceptance tests and decide which failed tests are of highest priority to fix in the next iteration User interface testing ensure all components behave as expected Usability testing ensure the application and functions can be easily used Performance testing test performance during various workloads Release Practice Release Regularly Goal: return customer s investment often Frequent opportunities for evaluation and feed-back Supports: planning game Requires: simple design, comprehensive testing, continual integration, planning game 9