extreme programming alexander kanavin lappeenranta university of technology
TRANSCRIPT
![Page 1: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/1.jpg)
Extreme Programming
Alexander Kanavin
Lappeenranta University of Technology
![Page 2: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/2.jpg)
Some background
• Lightweight vs heavyweight methodologies
• Software Engineering Institute Capability Maturity Model (SEI CMM)
• Extreme Programming
![Page 3: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/3.jpg)
Basic ideas
• Was put together as a response to the increasing difficulty of practicing heavyweight methodologies, especially in medium and small projects
• Has very few rules and practices
![Page 4: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/4.jpg)
Rules
• Fall into four categories
• Planning
• Design
• Coding
• Testing
![Page 5: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/5.jpg)
Rules for planning
• User stories are written
• Release planning creates the schedule
• Make frequent small releases
• The project velocity is measured
• The project is divided into iterations
• Iteration planning starts each iteration
![Page 6: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/6.jpg)
Rules for planning 2
• Move people around
• A stand-up meeting starts each day
• Fix XP when it breaks
![Page 7: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/7.jpg)
Planning - user stories
• Like use cases
• Written by the customers as things that the system needs to do for them
• Used for time estimation and release planning
• Avoid specifics (GUI layouts and such
![Page 8: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/8.jpg)
Release planning meeting
• Creation of a release plan document
• Planning of individual iterations
• Estimation of user stories in terms of ideal programming weeks
![Page 9: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/9.jpg)
Release plan
• Specifies exactly which user stories are going to be implemented for each system release and dates for the releases
• Stories are translated into acceptance tests
![Page 10: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/10.jpg)
Make frequent small releases
• For valuable feedback
• Important features are introduced early - more time to fix them
![Page 11: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/11.jpg)
Project velocity
• How many user stories were finished during the iteration
• Allows estimation for future iterations
![Page 12: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/12.jpg)
Iterative development
• Don’t schedule tasks in advance
• Don’t look ahead and add anything that’s not scheduled for this iteration
![Page 13: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/13.jpg)
Iteration planning meeting
• Customer chooses user stories from the release plan, that are most valuable to him
• These are translated into the programming tasks (1 to 3 ideal programming days)
• Project velocity is used to estimate if the iteration is overbooked or not.
![Page 14: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/14.jpg)
Move people around
• Avoiding knowledge loss and coding bottlenecks
• Everyone knows enough about every part of the system
![Page 15: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/15.jpg)
Daily stand up meeting
• Everyone stands up in a circle
• Prevents it from dragging on for too long
• Communications of problems, solutions and promotion of team focus
![Page 16: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/16.jpg)
Design rules
• Simplicity
• Choose a system metaphor
• Use CRC cards for design sessions
• Create spike solutions to reduce risk
• No functionality is added early
• Refactor whenever possible
![Page 17: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/17.jpg)
Simplicity
• Needs no explanation
• Keeping a design simple is hard work, however
![Page 18: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/18.jpg)
Choose a system metaphor
• Allows consistent naming of classes and methods
• Being able to guess how something is named is important (time saver)
![Page 19: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/19.jpg)
CRC cards
• Class, Responsibilities and Collaboration
• Used to represent objects
• Class written on top
• Responsibilities on the left
• Collaborating classes to the right of each responsibility
![Page 20: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/20.jpg)
Spike solution
• A very simple program to explore potential solutions
• Throw-away program
![Page 21: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/21.jpg)
Never add functionality early
• Avoid the tempation
• Concentrate on what is scheduled for today only
![Page 22: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/22.jpg)
Refactoring
• Rewriting a piece of program so that it does the same thing, but does it better
• Removing redundancy, elimination of unused code, getting rid of obsolete designs
• Helps keep the design simple and keeping code clean and concise
![Page 23: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/23.jpg)
Coding rules
• The customer is always available
• Code must be written to agreed standards
• Code the unit test first
• All code is pair programmed
• Only one pair integrates code at a time
• Integrate often
![Page 24: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/24.jpg)
Coding rules 2
• Use collective code ownership
• Leave optimization till last
• No overtime work
![Page 25: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/25.jpg)
Customer is always available
• To write user stories
• To select user stories
• Developers need to talk with the customer to get enough detail to complete a programming task
• Functional testing
![Page 26: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/26.jpg)
Coding standards
• Self-explanatory
![Page 27: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/27.jpg)
Code the unit test first
• It’s easier to create code after creating tests
• Tests define the requirements
![Page 28: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/28.jpg)
Pair programming
• Sitting side by side in front of the monitor
• One person types and thinks tactically
• The other one thinks strategically
![Page 29: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/29.jpg)
Sequential integration
• Solves problems of parallel integration
• Using a physical token or a dedicated computer
![Page 30: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/30.jpg)
Integrate often
• Every few hours, not more than a day
• Helps detect compatibility problems early, promotes communication
![Page 31: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/31.jpg)
Collective code ownership
• Everyone contributes ideas to all parts of the project (or fixes bugs or refactors)
• No one becomes a bottleneck
• The architecture is distributed among the team
![Page 32: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/32.jpg)
Optimize last
• Don’t try to guess what the bottleneck is going to be
• Make it work right, then make it work fast
![Page 33: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/33.jpg)
No overtime
• If it requires overtime, it will be late no matter what
• Use a release planning meeting to change the timing
![Page 34: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/34.jpg)
Testing
• All code must have unit tests
• All code must pass unit tests before it can be released
• When a bug is found tests are created
• Acceptance tests are run often and the results are published
![Page 35: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/35.jpg)
Unit tests
• Enables collective code ownership
• Enables refactoring
• Enables frequent integration
![Page 36: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/36.jpg)
Unit testing framework
• A development tool, not a testing tool
• Helps formalize requirements, clarify architecture, debug, optimize and test
• Example: Junit - a unit testing framework for Java,
![Page 37: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/37.jpg)
When a bug is found
• Create an acceptance test and unit tests to guard against it coming back
![Page 38: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/38.jpg)
Acceptance tests
• Created from user stories
• Black box system tests
• Customer verifies the correctness of the tests
![Page 39: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/39.jpg)
Weaknesses of XP
• Outstanding abilities of the team
• Having customer on site
• Doesn’t work in a large environment, with no contracting customer, few experts or simultaneous hardware development
![Page 40: Extreme Programming Alexander Kanavin Lappeenranta University of Technology](https://reader036.vdocuments.us/reader036/viewer/2022062620/551b86ab550346d6338b5991/html5/thumbnails/40.jpg)
Going further
• http://www.extremeprogramming.org
• Books: Amazon, Books.ru