Modelling in an Agile World

John Daniels Fastnloose Limited

www.fastnloose.com

© 2003 fastnloose ltd

John Daniels Co-founder of Fastnloose Ltd – development by dispersed teams Co-author of “UML Components” & “Designing Object Systems” Co-creator of the Syntropy method – Highly influential on UML (esp. OCL) Software designer and developer for 20 years

© 2003 fastnloose ltd

1 Agenda About agile Is UML the spawn of Satan? Where modelling can help

© 2003 fastnloose ltd

About agile “Agility is the ability to both create and respond to change in order to profit in a turbulent business environment” Jim Highsmith, Agile Software Development Ecosystems “Agile” is the new “Object” – “agile” is hip – even Microsoft are in on the act

© 2003 fastnloose ltd

2 The Agile Manifesto “We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value:

Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan That is, while there is value in the items on the right, we value the items on the left more.”

Kent Beck, Mike Beedle, Arie van Bennekum, Alistair Cockburn, Ward Cunningham, Martin Fowler, James Grenning, Jim Highsmith, Andrew Hunt, Ron Jeffries, Jon Kern, Brian Marick – February 2001

© 2003 fastnloose ltd

Agility in practice What does it mean to follow those values? – Acceptance and explicit incorporation of the things we all know, deep down: • A skilled, motivated, enabled team can be extremely productive • Every project is different • The Devil’s in the details • It’s hard to keep documentation up to date • The customer often doesn’t know what they want • Detailed project plans going out more than a few weeks aren’t usually worth the paper they are written on

© 2003 fastnloose ltd

3 Agile methods XP – “No big design up front”, “You ain’t gonna need it” SCRUM DSDM Crystal etc….

© 2003 fastnloose ltd

Example practices (from XP) The planning game – define stories, estimate, prioritise, schedule Continuous automated testing – test-driven development Continuous integration Refactoring Collective ownership Pair programming

© 2003 fastnloose ltd

4 Is UML the spawn of Satan?

Individuals and interactions over processes and tools

Working software over comprehensive documentation

Customer collaboration over contract negotiation

Responding to change over following a plan

© 2003 fastnloose ltd

Is UML the spawn of Satan?

IndividualsIndividuals and and interactions interactions over over processes processes and tools

Working software over comprehensive documentation

Customer collaboration over contract negotiation

Responding to change over following a plan

UML and its supporting tools are the cornerstone of my detailed and rigorous development process

© 2003 fastnloose ltd

5 Is UML the spawn of Satan?

IndividualsIndividuals and and interactions interactions over over processes processes and tools

WorkingWorking software software over over comprehensive comprehensive documentation

Customer collaboration over contract negotiation

Responding to change over following a plan

UML and its supporting tools are the cornerstone of my detailed and rigorous development process

With UML I can spend years documenting my software

© 2003 fastnloose ltd

Is UML the spawn of Satan?

IndividualsIndividuals and and interactions interactions over over processes processes and tools

WorkingWorking software software over over comprehensive comprehensive documentation

CustomerCustomer collaboration collaboration over over contract contract negotiation

Responding to change over following a plan

UML and its supporting tools are the cornerstone of my detailed and rigorous development process

With UML I can spend years documenting my software

UML lets me freeze the requirements early

© 2003 fastnloose ltd

6 Is UML the spawn of Satan?

IndividualsIndividuals and and interactions interactions over over processes processes and tools

WorkingWorking software software over over comprehensive comprehensive documentation

CustomerCustomer collaboration collaboration over over contract contract negotiation

Responding to change overover followingfollowing aa plan

UML and its supporting tools are the cornerstone of my detailed and rigorous development process

With UML I can spend years documenting my software

UML lets me freeze the requirements early

Argh! I’ll have to redraw all those nice UML diagrams

© 2003 fastnloose ltd

UML – it’s just a language! UML is a language which can be used for many different purposes We all use UML profiles all the time, even if we don’t realise it Different UML tools assume different purposes

© 2003 fastnloose ltd

7 Model perspectives

The The World Specification The Software

Built to specify Built to explain Built to understand Interpreted as Interpreted as Interpreted as constraints on descriptions of statements of fact behaviour behaviour

Model of the world Abstract model of Model of software software systematic correspondence

Conceptual model Specification model Implementation model

© 2003 fastnloose ltd

So where can modelling help? Aiding customer collaboration Aiding interactions between developers Aiding the creation of working software

© 2003 fastnloose ltd

8 Aiding customer collaboration How do you get the stories straight? – Models of the business, not the software • Use of models to understand what the business does / should do • Nothing to do (directly) with the software systems that support the business – Models that specify the software scope – Models that can expose conflicts or omissions How do you manage hundreds of separate stories? (esp. if they are written on index cards!) Need tools that can support abstract models

© 2003 fastnloose ltd

Direct customer interaction

Fast Software Ltd

Small-ish projects stories Developer acts as analyst-designer Any models are private Developer to developer

“Pure XP” Software Customer

queries

demonstrations of working software

© 2003 fastnloose ltd

9 Explicit requirements model Large-ish Brilliant Software Ltd projects Analyst and stories requirements designer roles separated Analyst Requirements Designer model is explicit Requirements Model communication Software tool Customer

queries, animations, scenarios queries

demonstrations of working software

© 2003 fastnloose ltd

TheThe Analysts’Analysts’ LoopLoop providesprovides valuevalue onlyonlyifif itit cleanscleans upup thethe requirementsrequirements byby raisingraising questionsquestions aboutabout inconsistenciesinconsistencies andand gapsgaps

Brilliant Software Ltd

stories requirements

Requirements Model

Designer Analyst Software

Customer queries

questions

demonstrations of working software

© 2003 fastnloose ltd

10 Finding more use-cases: CRUD Inspect class diagrams; ask: – what changes this association or attribute? – what creates/deletes this object or association?

Customer Supplier pocket: Money

close possessions stock Thing refund 0..* 0..* open

restock sale theft

© 2003 fastnloose ltd

Finding more usecases: states

Room

check in Occupied

check out

clean build Unoccupied Dirty

withdraw reinstate

withdraw Maintenance

© 2003 fastnloose ltd

11 Use-cases and objects – consistency what else what happens? do they do/ --tasks, jobs, use-cases happens to them ? -- CRUD; statecharts

Book Member * Objects, Use cases onLoanTo 0..1 attributes borrow & associations Member Book Library

who/what what objects are there? is affected? --things, concepts, relationships -- write postconditions, look at terms used use case borrow(member, library, book) post © 2003 fastnloose ltd book is on loan to member

ideas understanding

Design Aiding Design ModelDesign Model developer Model Developer Developer interactions abstractions

Software

Use of models to allow developers to visualise, share and discuss code design ideas, solutions Use of models to allow newcomers to see the big picture quickly Need tools that can move quickly and easily between code and diagrams

© 2003 fastnloose ltd

12 Aiding working software Generation of test cases from requirements (ie specification) models Understanding the good test cases Need tools that can generate tests

© 2003 fastnloose ltd

From requirements to tests

Running a test The structural constraints in a requirements model define the Set-up test interesting edge and normal scenario conditions, and hence informs the choice of test data Execute test

A requirements model provides a Check catalogue of test points when invariants and testing is at the external event level post- conditions

A requirements model will define the structural invariants and the required results of stimuli

© 2003 fastnloose ltd

13 Tests as specification Traditional textual – broad, covering all aspects of the problem – lacking depth, precision – big picture is often all you get Tests-as-specification – precise where you have them – but nothing where you don’t – hard to see the big picture Models can bridge this gap

© 2003 fastnloose ltd

Agility and the MDA Model Driven Architecture – “A complete MDA specification consists of a definitive platform- independent base UML model (PIM), plus one or more platform- specific models (PSM) and interface definition sets, each describing how the base model is implemented on a different middleware platform.” OMG web site! Assuming MDA can be made to work, it is compatible with a high level of agility The modelling language becomes the “programming” language, but the same principles apply

© 2003 fastnloose ltd

14 Summary Modelling is compatible with agile methods Models can help: – manage complex requirements – improve communication between developers – with the creation of good tests

© 2003 fastnloose ltd

15