BTS530: Major Project Planning and Design Iterative Development References: Agile & Iterative Development, by Craig Larman, 2004, Addison Wesley. Applying UML and Patterns, 3rd Edition, Chapter 21, Craig Larman Web sites as listed Agenda Iterative development Agile modeling SCRUM Extreme Programming Refactoring Iterative Development Product development lifecycle is composed of several iterations in sequence, each delivering a “chunk” of functionality Each iteration is a self-contained mini project: Planning Development (including testing) Implementation Review/Refactoring Iterative Development Initial Requirements, Vision + Feedback/Input from Iterations Iteration 1 Iteration 2 Iteration 3 Production System (grows with each iteration) … (Typically between 3 and 30 iterations in a system development project) Iterative Development Each Iteration Plan tasks, time estimates, milestones Track/Control progress adjust scope if required Develop Implement Review/Refactor Iterative Development Planning Each Iteration Risk driven Client driven choose riskiest, most difficult elements choose highest business value Ideally—a mixture of both Iterative Development Tracking/Controlling Timeframes for iterations are typically shorter than for traditionally run projects, necessitating more control “Timeboxing” Approach is common in iterative development methodologies using agile methods Iterations typically 1 to 6 weeks Scope adjusted if necessary; not time, not quality Iterative Development Benefits over “Big Bang” approaches “Depth” vs “breadth” – issues through to implementation uncovered and addressed more quickly Early results reveal and enable required changes— end product is more suitable Early results enable more accurate estimates for the rest of the system Momentum sustained…constant visible progress Other? Agile Methods Iterative methods typically (but not always) employ agile methods Agile methods defined and supported by http://www.agilealliance.org/ Agile methods start with the “Manifesto for Agile Software Development” http://www.agilemanifesto.org Agile Methods Principles http://www.agilemanifesto.org/principles.html Agile Methods Iterative development methodologies employing agile methods include: Scrum Extreme Programming (XP) SCRUM: Intro An agile method for software development. Projects progress via a series of iterations called sprints. Each sprint iteration is approx. 2-4 weeks long. Ideally suited to projects with rapidly changing or “sudden” requirements. Mountain Goat Software http://www.mountaingoatsoftware.com/scrum SCRUM: the players Product Owner Key Stakeholder or user Scrum Master Ensures team productivity by removing roadblocks and protecting the team from the “outside” Scrum Team --5-9 people --no traditional roles --All working together Mountain Goat Software http://www.mountaingoatsoftware.com/scrum SCRUM Product Backlog: a prioritized list of features containing every desired feature or change to the product. Prioritized by the product owner. Mountain Goat Software http://www.mountaingoatsoftware.com/scrum SCRUM A Sprint Planning Meeting is held at the start of each sprint. The product owner reprioritizes the product backlog and the scrum team decides what it can complete in the coming Sprint. The result is the Sprint Backlog a list of tasks to complete all work in the current sprint. Mountain Goat Software http://www.mountaingoatsoftware.com/scrum SCRUM The Scrum: a daily meeting for entire Scrum team: Scrum Master asks “What did you do yesterday?”; “What will you do today?”; “Are there any roadblocks?” Mountain Goat Software http://www.mountaingoatsoftware.com/scrum SCRUM At the end of a sprint the team has a Sprint Review Meeting to demonstrate the result of the sprint: a Product Increment. Scrum Product Backlog Sprint Backlog 2-4 Week Sprint Product Increment (working, highquality software) Mountain Goat Software http://www.mountaingoatsoftware.com/scrum XP: Intro A form of agile software development. Promotes simplicity and agility Managers, customers, developers are equal partners in the development team http://www.extremeprogramming.org XP: Specifications User Stories are at the heart of XP They are written by the customers, are each about 2-3 sentences long and are similar to scenarios. User stories drive acceptance tests User stories are the “specs” http://www.extremeprogramming.org XP: Iterations A Release Planning Meeting creates a release plan which details which user stories will go into a release (80 + or – 20 is the “norm”) An Iteration Planning Meeting is held at the start of each Iteration in the release to decide what will go into that iteration Each “time boxed” iteration is usually a constant length; typically 1-3 weeks. http://www.extremeprogramming.org XP: Meetings Daily Standup Meeting is used to communicate problems, solutions, and promote team focus Everyone stands up in a circle to avoid long discussions http://www.extremeprogramming.org XP: Coding Coding done in pairs: Pair Programming The customer is ALWAYS available Coding Standards must be followed Test Driven Development: The Unit Test is written first Code is integrated at frequent (hours) intervals No overtime Code is Refactored frequently http://www.extremeprogramming.org Refactoring: Intro Part of each iteration – review and refactor what is “smelly” Simplify! Refactoring Structured, disciplined Rewrite/restructure existing code without changing its external behaviour Apply small transformation steps combined with re-executing test steps Refactoring Why? remove duplicate code improve clarity shorten long methods remove “hard coded” constraints “smelly code” –consider refactoring “code stench” – MUST refactor Refactoring Code Stench duplicated code BIG GIANT METHOD BIG GIANT CLASS (lots of code) Class with MANY instance variables strikingly similar subclasses little or no use of interfaces in the design high coupling between many objects and so on… Sample Refactorings Refactoring Description Extract Method transform long method into shorter one by farming out a portion to a helper method Extract Constant replace literal constant with constant variable Introduce Explaining Variable put the result of the expression into a temporary variable with a name that explains the purpose Replace Constructor Call With Factory Method For example—in Java, replace using the new operator and constructor call with invoking a helper method that creates the object (hiding the details) Refactoring Examples: pg 391-393, chapter 21, Larman text Resources www.refactoring.com