bts530: major project planning and design iterative development references: agile & iterative...
TRANSCRIPT
BTS530: Major BTS530: Major Project Planning Project Planning
and Designand DesignIterative Iterative
DevelopmentDevelopment
References:References: Agile & Iterative Development, by Craig Agile & Iterative Development, by Craig Larman, 2004, Addison Wesley.Larman, 2004, Addison Wesley.Applying UML and Patterns, 3Applying UML and Patterns, 3rdrd Edition, Edition, Chapter 21, Craig LarmanChapter 21, Craig LarmanWeb sites as listedWeb sites as listed
AgendaAgenda
Iterative developmentIterative development Agile modelingAgile modeling SCRUM SCRUM Extreme ProgrammingExtreme Programming RefactoringRefactoring
Iterative DevelopmentIterative Development
Product development lifecycle is Product development lifecycle is composed of several iterations in composed of several iterations in sequence, each delivering a “chunk” of sequence, each delivering a “chunk” of functionalityfunctionality
Each iteration is a self-contained mini Each iteration is a self-contained mini project:project: PlanningPlanning Development (including testing)Development (including testing) ImplementationImplementation Review/RefactoringReview/Refactoring
Iterative DevelopmentIterative Development
Iteration1
+ Feedback/Input from Iterations
Production System(grows with each iteration)
Initial Requirements, Vision
Iteration2
Iteration3
…
(Typically between 3 and 30 iterations in a system development project)
Iterative DevelopmentIterative Development
Each IterationEach Iteration PlanPlan
tasks, time estimates, milestonestasks, time estimates, milestones Track/Control progressTrack/Control progress
adjust scope if requiredadjust scope if required DevelopDevelop ImplementImplement Review/RefactorReview/Refactor
Iterative DevelopmentIterative Development
Planning Each IterationPlanning Each Iteration Risk driven Risk driven
choose riskiest, most difficult elementschoose riskiest, most difficult elements Client drivenClient driven
choose highest business valuechoose highest business value Ideally—a mixture of bothIdeally—a mixture of both
Iterative DevelopmentIterative Development
Tracking/ControllingTracking/Controlling Timeframes for iterations are typically Timeframes for iterations are typically
shorter than for traditionally run shorter than for traditionally run projects, necessitating more controlprojects, necessitating more control
““Timeboxing” Approach is common in Timeboxing” Approach is common in iterative development methodologies iterative development methodologies using agile methodsusing agile methods Iterations typically 1 to 6 weeksIterations typically 1 to 6 weeks Scope adjusted if necessary; not time, Scope adjusted if necessary; not time, not not
qualityquality
Iterative DevelopmentIterative Development
Benefits over “Big Bang” approachesBenefits over “Big Bang” approaches ““Depth” vs “breadth” – issues through to Depth” vs “breadth” – issues through to
implementation uncovered and implementation uncovered and addressed more quicklyaddressed more quickly
Early results reveal and enable required Early results reveal and enable required changes—end product is more suitablechanges—end product is more suitable
Early results enable more accurate Early results enable more accurate estimates for the rest of the systemestimates for the rest of the system
Momentum sustained…constant visible Momentum sustained…constant visible progressprogress
Other?Other?
Agile MethodsAgile Methods
Iterative methods typically (but not Iterative methods typically (but not always) employ agile methodsalways) employ agile methods
Agile methods defined and Agile methods defined and supported by supported by http://www.agilealliance.org/
Agile methods start with the Agile methods start with the “Manifesto for Agile Software “Manifesto for Agile Software Development” Development” http://www.agilemanifesto.org
Agile MethodsAgile Methods
Iterative development methodologies Iterative development methodologies employing agile methods include:employing agile methods include: ScrumScrum Extreme Programming (XP)Extreme Programming (XP)
SCRUM: IntroSCRUM: Intro
An agile method for software An agile method for software development. development.
Projects progress via a series of Projects progress via a series of iterations called sprints.iterations called sprints.
Each sprint iteration is approx. 2-4 Each sprint iteration is approx. 2-4 weeks long. weeks long.
Ideally suited to projects with rapidly Ideally suited to projects with rapidly changing or “sudden” requirements.changing or “sudden” requirements.
Mountain Goat Software http://www.mountaingoatsoftware.com/scrum
SCRUM: the playersSCRUM: the players
Mountain Goat Software http://www.mountaingoatsoftware.com/scrum
Product OwnerScrum Master
Scrum Team
--5-9 people--no traditional roles--All working together
Key Stakeholder or user
Ensures team productivity by removing roadblocks and protecting the team from the “outside”
SCRUMSCRUMProduct 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
SCRUMSCRUM
Mountain Goat Software http://www.mountaingoatsoftware.com/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 theSprint Backlog a list of tasks to complete all work in the current sprint.
SCRUMSCRUM
Mountain Goat Software http://www.mountaingoatsoftware.com/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?”
SCRUMSCRUM
Mountain Goat Software http://www.mountaingoatsoftware.com/scrum
ProductIncrement
(working, high-quality
software)
2-4 Week Sprint
Scrum
SprintBacklog
ProductBacklog
At the end of a sprint the team has a Sprint Review Meeting to demonstrate the result of the sprint: a Product Increment.
XP: IntroXP: Intro
A form of agile software A form of agile software development.development.
Promotes simplicity and agilityPromotes simplicity and agility Managers, customers, developers Managers, customers, developers
are equal partners in the are equal partners in the development teamdevelopment team
http://www.extremeprogramming.org
XP: SpecificationsXP: Specifications
User Stories User Stories are at the heart of XPare at the heart of XP They are written by the customers, They are written by the customers,
are each about 2-3 sentences long are each about 2-3 sentences long and are similar to scenarios.and are similar to scenarios.
User stories drive acceptance testsUser stories drive acceptance tests User stories are the “specs”User stories are the “specs”
http://www.extremeprogramming.org
XP: IterationsXP: Iterations
A A Release Planning Meeting Release Planning Meeting creates a creates a release plan which details which user release plan which details which user stories will go into a release (80 + or – stories will go into a release (80 + or – 20 is the “norm”)20 is the “norm”)
An An Iteration Planning Meeting Iteration Planning Meeting is held at is held at the start of each the start of each IterationIteration in the release in the release to decide what will go into that iterationto decide what will go into that iteration
Each “time boxed” iteration is usually a Each “time boxed” iteration is usually a constant length; typically 1-3 weeks.constant length; typically 1-3 weeks.
http://www.extremeprogramming.org
XP: MeetingsXP: Meetings
Daily Standup Meeting Daily Standup Meeting is used to is used to communicate problems, solutions, communicate problems, solutions, and promote team focus and promote team focus
Everyone stands up in a circle to Everyone stands up in a circle to avoid long discussions avoid long discussions
http://www.extremeprogramming.org
XP: CodingXP: Coding
Coding done in pairs: Coding done in pairs: Pair ProgrammingPair Programming The customer is ALWAYS availableThe customer is ALWAYS available Coding Standards must be followedCoding Standards must be followed Test Driven Development: The Test Driven Development: The Unit Test Unit Test
is written firstis written first Code is integrated at frequent (hours) Code is integrated at frequent (hours)
intervalsintervals No overtimeNo overtime Code is Code is RefactoredRefactored frequently frequently
http://www.extremeprogramming.org
Refactoring: IntroRefactoring: Intro
Part of each iteration – review and Part of each iteration – review and refactor what is “smelly”refactor what is “smelly”
Simplify!Simplify!
RefactoringRefactoring
Structured, disciplined Structured, disciplined Rewrite/restructure existing code Rewrite/restructure existing code
withoutwithout changing its external changing its external behaviourbehaviour
Apply small transformation steps Apply small transformation steps combined with re-executing test combined with re-executing test stepssteps
RefactoringRefactoring
Why?Why? remove duplicate coderemove duplicate code improve clarityimprove clarity shorten long methodsshorten long methods remove “hard coded” constraintsremove “hard coded” constraints ““smelly code” –consider refactoringsmelly code” –consider refactoring ““code stench” – MUST refactorcode stench” – MUST refactor
RefactoringRefactoring
Code StenchCode Stench duplicated codeduplicated code BIG GIANT METHODBIG GIANT METHOD BIG GIANT CLASS (lots of code)BIG GIANT CLASS (lots of code) Class with MANY instance variablesClass with MANY instance variables strikingly similar subclassesstrikingly similar subclasses little or no use of interfaces in the designlittle or no use of interfaces in the design high coupling between many objectshigh coupling between many objects and so on…and so on…
Sample RefactoringsSample Refactorings
RefactoringRefactoring DescriptionDescriptionExtract MethodExtract Method transform long method into transform long method into
shorter one by farming out a shorter one by farming out a portion to a helper methodportion to a helper method
Extract ConstantExtract Constant replace literal constant with replace literal constant with constant variableconstant variable
Introduce Explaining Introduce Explaining VariableVariable
put the result of the expression put the result of the expression into a temporary variable with a into a temporary variable with a name that explains the purposename that explains the purpose
Replace Constructor Replace Constructor Call With Factory Call With Factory MethodMethod
For example—in Java, replace For example—in Java, replace using the new operator and using the new operator and constructor call with invoking a constructor call with invoking a helper method that creates the helper method that creates the object (hiding the details)object (hiding the details)