eXtreme Programming In Action Radoslav Nemchev Nemetschek OOD

29
Sofi a Bulga ria S ummer S ummer School School IST-2001-34488 eXPERT: Best Practice on e-Project Development http://www.esi.es/Expert 30 June - 2 Jul y 2003 30 June - 2 July 2003 eXtreme programming - principles & practices eXtreme Programming In Action Radoslav Nemchev Nemetschek OOD

description

eXtreme Programming In Action Radoslav Nemchev Nemetschek OOD. XP in action. Choose the project Involve the customer Involve the team Apply the practices Automate. Choose the project. Not too big Not too small Not too important Not too unimportant. Involve the Customer. - PowerPoint PPT Presentation

Transcript of eXtreme Programming In Action Radoslav Nemchev Nemetschek OOD

Page 1: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

eXtreme Programming In Action

Radoslav NemchevNemetschek OOD

Page 2: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

XP in action

• Choose the project

• Involve the customer

• Involve the team

• Apply the practices

• Automate

Page 3: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Choose the project

• Not too big

• Not too small

• Not too important

• Not too unimportant

Page 4: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Involve the Customer

Page 5: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Involve the team

• Guarantee them immunity• Give them time• Strictly control the practices application• Let them see the benefits by themselves• Provide communication – stand-up meetings,

open workspace,…• Shared understanding and responsibility for

the system – System Metaphor

Page 6: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Apply the practices

• Introducing all practices at once, or just one practice at a time?

Answer: Adopt one practice at a time.

• What the order should be?Answer: Follow the natural order – from CR

oriented through design to testing and coding.

Page 7: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Customer on-site

• Customer or Developer on-site?• Get the user stories• Make him determine priorities – high

business value first• Get him to give you immediate and

frequent feedback• Involve him into specification of

functional acceptance tests

Page 8: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Planning game

● How to plan?

– Create and prioritize user stories - customer

– Estimate difficulties - developers

– Select stories for next release - customer

– Split stories into tasks - developers

– Plan the tasks for the next iteration - customer/developers

Page 9: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Small Releases

• My program is all or nothing! Wrong! Inside every large program there are lots of little programs trying to get out. Make them into small releases.

• Make as many iterations as possible per release

• Keep good track of progress

• Deliver business value to the customer fast

• Gives sense of accomplishment to the team

• Keep the team focused

Page 10: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Test First

• Test-Driven development– Design a test that will fail– Compile it and check that it fails– Write just enough code to make the test run

• Design evolves from tests• The benefit must be higher than the cost• Testing slows you down?• Apply same quality standards for test and code• Tests ARE documentation• Automate

Page 11: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Isolation Testing

• Collaborators of the unit under test are:– Trustworthy

• Implicit usage• Object Mother Pattern

– Substituted in the test• Stubs• Self-shunt pattern• Mock objects

Page 12: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

NUnit

• Unit tests framework• Write tests• Execute tests• Assert results• Show tests failure/success• Keep the bar green• http://nunit.org/default.htm

Page 13: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

NUnit test example

Page 14: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Write test that will fail

Page 15: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Write just the code that makes the test pass

Page 16: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Refactoring

• Why refactor?– Nobody does it quite right the first time– To improve design– To simplify code– To ease future changes in the code

• When do we refactor? – Continuously– When code or test smells

• Automation

Page 17: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

C# Refactory

• Integrated tool for Visual Studio• Simplifies code refactoring• Performs automatic code metrics

collection• http://www.xtreme-simplicity.net/

Page 18: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Integration into MS Visual Studio

Page 19: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Code metrics collection

Page 20: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Refactoring with C# Refactory

Page 21: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Member reference finder

Page 22: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Simple design

• How to achieve this?– Evolutionary design – design evolves while coding

and refactoring

– If you don’t need it now, you won’t need it ever -develop only functionality that is required

– Satisfy tests in the simplest possible way

– Refactoring as soon as the tests run

• And again – keep it as simple as possible!

Page 23: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

System Metaphor

• What?• Everybody is involved, everybody is interested• Everybody understands and is responsible for:

– Base architecture– Whole system

• How?– Don’t separate the team into designers and coders– Change pairs often

Page 24: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Pair programming

• Why?– 2 > 1– Two programmers will understand the code– Keeps programmers focused

• When do it?– XP says always– Is it possible in real life? Is it really necessary all

the time?

Page 25: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Continuous Integration

• You can’t put it off forever. Better do it all the time

• Spare yourself the Big Bang disaster• Keep the tests working 100% during the

integration• Use a dedicated integrated machine• Keep the build time low• Automate through scripts, tools, etc…

Page 26: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Collective Code Ownership

• This is not my object! WRONG!• Use version control system – CVS, VSS, …• You brake it, you fix it

Page 27: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

MS Visual Source Safe

• Automates Continuous Integration and Collective Code Ownership

• Provides version tracking• Integrates with MS Visual Studio

Page 28: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

Coding Standards

• I can always read my own code. Wait, it’s all my code!

• Let the team setup coding standards prior to coding and agree on them

• Force coding standards application, no exceptions

• Keep it simple

Page 29: eXtreme Programming  In Action Radoslav Nemchev Nemetschek OOD

SofiaBulgaria

Summer School

Summer School IST-2001-34488 eXPERT:

Best Practice on e-Project Development http://www.esi.es/Expert

30 June - 2 July 2003

30 June - 2 July 2003

eXtreme programming - principles & practices

40 hour week

• Tired people make mistakes• Tired people tend to overlook things like

testing, refactoring, etc.• Work at maximum concentration 8 hours per

day• 6 PM – you are tired, go home• Don’t work more than 1 consecutive week of

overtime