Download presentation
Presentation is loading. Please wait.
Published byAntonia Floyd Modified over 9 years ago
1
Extreme programming for programmers Kirill Kalishev SPb Java Users Group 13 Oct 2001 Title
2
Key concepts Planning Design Programming Contents Intent: to try to show programming in the eyes of the extreme programmer
3
Deliver value for the customer Flatten the change curve Have fun doing programming The goals
4
Customer value Start Planned result Desired result Conformance to a big up-front plan Conformance to actual customer value
5
Change curve We have to make it true! Cost of change Requirements Analysis Design Implementation Test Development lifecycle Provided the change is cheap
6
Key concepts (XP values) Communication A project would fail if somebody doesn’t communicate something important Simplicity Do the simplest thing that could possibly work (win in changing it when it needs change) Feedback Optimism is hazard, feedback is treatment Courage Don’t let your fears stop you from making great software Values is what distinguishes bunch of individuals vs. team
7
Const Manageable Key concepts (four variables) Time Cost Scope Quality
8
The circle of life On-site customer Planning game Acceptance testing Short releases Pair programming Unit testing Simple design Refactoring Communication Feedback Simplicity Courage
9
Practices On-site customer Planning game Sustainable pace MetaphorSimple design Refactoring Test first Pair programming Short releases Coding standardsCollective ownership Continuos integration Weakness of one is supported by strength of others
10
The customer + programmers = a team The customer is in the same room to give answers prevents programmers from putting their suppositions to code The customer is logically the one all stakeholders speak to programmers with one voice Can’t find a customer? does the project make sense? On-site customer Talking to the customer everyday is a key to success!
11
Customer Planning game - bill of rights Programmers The right to an overall plan (what/when/how much) The right to know what is needed (clear declaration of priority) The right to change mind anytime (functionality/priorities) The right to make & update estimates The right to see the progress & be informed on any schedule changes The right to produce quality work at all times The right to get the most possible value out of each programming week The right to accept responsibilities vs. having them assigned
12
Customer Planning game - the moves Programmers Table Defines stories (on index cards) Say who much it costs (put estimates to cards), go spike if needed Defines what to do & what to defer (sorts by value) Sort cards by risk The plan Defines the plan (by time or by scope) Commit to meet the plan
13
The team believes that the next iteration they will do the same amount of work as in the previous one Project velocity in terms of ideal engineering time (days/weeks/tomato hours) is calculated All stories are estimated in the same metric Each next iteration is filled with the stories whose summary estimates fills the current velocity Planning game - yesterday’s weather The worst problem is not being behind the schedule as such, but not knowing about that
14
Release vs. Iteration planning CustomerProgrammers Planning game Release planning by scope/by time Iteration planning by time (1, 2, 3 week iterations) each iteration the project velocity is updated task breakdown is done 1 2 n Release Iteration 1 2 n Release Iteration...
15
The whole team (customer + programmers) learns about the system Releases are done often The customer has a working system at all times Short releases
16
Acceptance testing Customer Programmers Defines acceptance criteria for each story Make it automatic, make it pass
17
XP believes that the best strategy is to solve the most pressing problem while keeping most options In design, it reflects in the following: No up-front design, instead, Do The Simplest Thing That Could Possibly Work rely on your ability to change it later, when you learn new things or new features will be really needed Do design all the time, as you go along Design for the iteration works Design strategy Simplicity keeps most options!
18
Like drawing cool diagrams? Great! We like it too. However, Minimize the time between making design solution and turning it into code Computer does’t understand diagrams, but does it for code You should consider yourself just guessing until code is written Start with a test, to know when you are done On diagrams
19
Metaphor The story both the customer and programmers share about how the system works Metaphor covers most of what we call “architecture” System of names Actors Interactions On architecture - Oops, it sounds like plumbing, right? - Yes, something like that. In this case water going through pipes is like a transaction. When at least one valve is closed -- no way to proceed - Cool, why don’t we call it pipes, water & valves - Okay, sounds like fun
20
A rule: Each line of code is written by at least two people Pair programming is a dialog of two people The driver - controls the keyboard, the mouse and actively works on implementation of the program The observer - thinks more strategically, looks for errors, misprints & etc. Partners change roles No dialog - no pair programming Pair programming Pair-programmed code is better written & structured plus it is done quicker!
21
Acceptance tests Owned by the customer Proves that the story is done in terms of the customer’s perspective Unit tests Owned by programmers Test everything that could possible break Written before production code Always pass 100% in the integrated code Acceptance vs. unit testing
22
You won’t win if you write a test that doesn’t communicate any new things about how production code should work is not gonna break You will win if you write a test that communicates what is needed from the production code will ever show that something has broken down (which is inevitable) - Test Everything That Could Possibly Break independent of others as much as possible Unit testing - a bet If you had to choose what to throw away, it should be production code, not tests
23
When to test? It is a normal way to program: If you add a new feature, write a test before production code If you fix a defect, write a test that would expose the defect, then fix it Every time, before you integrate code, unit tests must pass 100% Unit testing - XP style Don’t let the fear that testing can’t catch all bugs stop you from writing tests that will catch most bugs
24
Excuses for not testing I don’t have time This can’t be tested I don’t know how It tests itself! I already tested it once and I have not changed it. I am smart enough to know this works perfectly XP is not about writing production code. It is about writing tests and making them pass.
25
Quality code Runs all tests Expresses every idea we need to express Says everything once and only once Have the minimum number of classes and methods consistent with the above No production production code is considered existing without tests for that Code quality
26
No code is owned by an individual person The team owns that (read - everyone in the team) If you see the chance to put changes - just do it, but all unit tests must pass 100% integrate asap, otherwise you will lose Why is it better than personally owned code? You don’t have to wait unit a responsible person will be available You know better what you want Collective code ownership Conflicts are not a problem as such. You have tests, you integrate often so you are not afraid of conflicts
27
No code sits nonintegrated for more than two hours integration is not painful anymore, we do it several times an hour! There is only one integration thread a time to make sure you’re integrating only your changes (integration computer works) All unit tests must pass 100% every time you integrate Continuos integration
28
An activity of changing structure without modifying behavior, aimed at: making the program easier to understand & cheaper to modify A core activity to do a good program start with a simple thing & refactor it later. You are not afraid of being wrong. Refactoring essential? No, if you are omniscient perfect and so everyone else on the team Refactoring Refactoring is everyday disciplined activity. If you do more and more refactoring - it means you don’t do enough refactoring
29
If you add a feature first look for chance to improve existing code, to make the adding easier refactor make sure unit tests pass 100% & integrate write a test, put in new feature and make the tests pass again integrate If you see the chance to improve something - do it. Otherwise, you risk to run into debts. Essentials of refactoring If you don’t want to do refactoring for yourself, do it for your team!
30
Looking at the code, you should not see who wrote that Different coding styles should not be an obstacle to better understanding. Develop that, agree on that and follow that! Coding standards Any fool can write a program the computer can understand. Good programmers write programs other people can understand.
31
We do appreciate good comments. However, while development, we don’t write comments because: they often lie they don’t provide feedback (computer doesn’t understand them!) there are a lot of more reliable ways to reveal the intent On comments If you feel you should put a comment, refactor you program first. Then, take a look again. You are likely to lose you will to put comments.
32
Productivity does not increase with hours worked so we work 40-hour week to be fresh and eager If we have to work overtime, we don’t do it more than a week Sustainable pace
33
Simplicity is the art of maximizing the amount of work not done simplicity to do simplicity to understand simplicity to change Complexity is like debts. The more we keep it complicated, the more money we pay for that On simplicity What may look simple for you, may not be the case for the team. The way is to learn, agree and follow. The whole team together.
34
Design is a kind of recognition of patterns - we call it “experience” Design patterns (like ones from GoF) give us system of names, what promotes better: communication understanding Since patterns are goals for refactoring, learning refactoring techniques is essential as well On design patterns Thinking in patterns is not an evil. Narrow thinking is.
35
To realize if XP is for you or not Practices are simple. Their interactions are not obvious. The most value on XP is in the mutual support of the practices To ship software & have from it Why is it worth trying?
36
The inventors of XP Kent Beck Ward Cunningham http://c2.comhttp://c2.com Martin Fowler http://www.martinfowler.comhttp://www.martinfowler.com Famous speakers & writers on XP Bob Martin http://www.objectmentor.comhttp://www.objectmentor.com Ron Jeffries Don Wells http://www.extremeprogramming.orghttp://www.extremeprogramming.org William Wake http://users.vnet.net/wwakehttp://users.vnet.net/wwake Pair programming & collaborative development Laurie Williams http://collaboration.csc.ncsu.edu/laurie/http://collaboration.csc.ncsu.edu/laurie/ Who is who in the XP world
37
Within SPb XP users group http://groups.yahoo.com/group/spbxp Come share experience! You can reach me by phone: +7 (812) 322-9526 web: http://www.kirillkalishev.com http://www.kirillkalishev.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.