Extreme Programming in Perl Robert Nagler phần 4

pdf
Số trang Extreme Programming in Perl Robert Nagler phần 4 16 Cỡ tệp Extreme Programming in Perl Robert Nagler phần 4 176 KB Lượt tải Extreme Programming in Perl Robert Nagler phần 4 0 Lượt đọc Extreme Programming in Perl Robert Nagler phần 4 0
Đánh giá Extreme Programming in Perl Robert Nagler phần 4
4.4 ( 7 lượt)
Nhấn vào bên dưới để tải tài liệu
Đang xem trước 10 trên tổng 16 trang, để tải xuống xem đầy đủ hãy nhấn vào bên trên
Chủ đề liên quan

Nội dung

6.7 Yea, Whatever Not everybody in my company can sustain pair programming all the time. We try to flex to each other’s styles when we can. Sometimes it just doesn’t work. One of my partners gets what I call the “yea whatevers” when he’s had enough pair programming. He ends up saying, “yea, whatever” whenever there’s some type of disagreement. The yea whatevers only happen after too many conflicts in one session. Our personalities would start hindering our efforts if we continued pair programming so we know it’s time to stop. XP promotes people over process first, and a set of best practices, second. If the people dynamics aren’t right, I don’t recommend forcing pair programming. It’s taken this programmer and me years to figure out what works best for us. We didn’t start out pair programming when we first started working together, and we don’t pair continuously all the time now. Most of the time, we pair when we run into a roadblock, and we know we need help. This also turns out to be a good way to introduce pairing, that is, waiting until you get a hard problem before you bring in a partner. It may be something you do already, possibly at a whiteboard. Next time, try sharing a keyboard instead. You will be surprised how much more effective it is to communicate through the code than in a conference room. A whiteboard solution is theoretical, and code is being there. It’s like the difference between planning to climb a mountain and hooting in unison when you both reach the top. Coding together means helping each other with the inevitable wrong turns and near falls. You gain mutual respect and learn to trust each other. You can’t pair program effectively without these qualities, and the best way to get there is by working side by side on a hard problem. 6.8 Gumption Traps Bad hair days are when nothing seems to go right. Robert Pirsig says this happens when you run into a gumption trap, something that saps your energy, discourages you, and causes you to make mistakes. Some examples Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 44 of gumption traps are:9 Intermittent Failure In this the thing that is wrong becomes right all of a sudden just as you start to fix it. Parts Setback It’s always a major gumption trap to get all the way home and discover that a new part won’t work. Value Rigidity The facts are there but you don’t see them. Ego Traps When the facts show that you’ve just goofed, you’re not as likely to admit it. When false information makes you look good, you’re likely to believe it. Pirsig defines these gumption traps in terms of motorcycle maintenance, but they apply equally well to software development. Whether you are a mechanic or programmer, gumption traps keep you from getting your job done. You can get out of gumption traps by yourself. Pirsig gives solutions for each of these traps. The biggest problem is recognizing that you have fallen into one. Even when you recognize you are in a trap, it can take you days to get out of one, if you are working alone. With a partner you’ll probably be out in a few hours or possibly even minutes. You and your partner think differently. You have different backgrounds and skills. When you are pair programming together, these differences balance each other out to help both of you avoid and recover from gumption traps. Each of you probably won’t fall into the same gumption traps. If you both fall into the same trap, one of you will come out first and help the other out. I’m sure you have had the experience of searching for a code defect with another person. It would be a rare event for both of you to find it at the exact same moment. It doesn’t matter who finds it first, because both of you can continue coding once it is found. 6.9 Reducing Risk Through Knowledge Transfer Programming pairs are not only better at finding defects, they produce better code and learn more than solitary programmers. Programming partners often come up with two different implementations for the same task. One 9 Zen and the Art of Motorcycle Maintenance, Robert M. Pirsig, Bantam Books, 1989, p. 277-283. Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 45 or both of the implementations might contain ideas new to the other person. You’ll discuss the differences, and possibly merge the solutions. In any event, one or both of you have learned something. One partner is likely to know more about the code or problem you both are working on than the other. While you add business value to the project, the more experienced partner transfers knowledge to the less experienced partner. When all production code is written in pairs, no one person has unique knowledge of the codebase. This reduces risk, and spreads experience. Everybody benefits from the continous learning that goes on in an XP project. In addition, the customer benefits from the reduced risk and from the increased quality that pair programming delivers. Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 46 Chapter 7 Tracking He achieves successes he accomplishes his tasks and the hundred clans all say: We are just being natural. – Lao-Tze1 XP’s focus is on the here and now. The team knows how it is doing by eliciting feedback through testing and frequent releases. Sometimes this feedback is not enough to keep a project on track. Everybody strays from the path now and then, and runs the risk of getting caught in a web made by a big, hairy spider. That’s why every XP project needs a tracker. Tracking in XP let’s us know if we’ve strayed off the path. Tracking introduces feedback about how we are doing with respect to iteration and release plans. The tracker is the team member who is responsible for asking the team how far along they are with their tasks for the iteration. If the iteration is behind schedule, the tracker asks the customer to drop tasks. Intra-release feedback is generated by tracking the velocity trend. When the velocity curve is unstable, it’s a sign of trouble. The role of tracker is typicially filled by a manager, but can be anybody who communicates well with the rest of the team. The tracker’s job is to help find root causes as well as gather data about the project’s status. To be effective, the tracker must be a perceptive listener to hear the subtle clues that lead to root causes. 1 The Tao of The Tao Te Ching, Lao-Tze, translated by Michael LaFargue, SUNY Press, 1992, p. 118. 47 This chapter explains how tracking works, what’s tracked, ways to keep everybody informed, and most importantly, how to get back on track if you’re lost battling big, hairy spiders. 7.1 Iteration Tracking Iteration tracking is a polling activity. The tracker asks team members how their work is going once or twice a week. These meetings are between the tracker and one team member at a time. This keeps everyone at ease, and allows the tracker to ask personal questions if need be. To simplify tracking, try to limit task length to one ideal day. With multi-day tasks, the tracker needs to ask how much time is left to get a precise reading of the project’s status. With single day tasks, the tracker need only ask whether the task is completed or not. This latter precision is enough to provide an accurate picture of the iteration’s progress. Iteration tracking is not micro-management. The tracker doesn’t try to control how people do things. The purpose of tracking is to find out what is happening using a simple, objective measure, such as, what tasks are done and what are their estimates. If the tracker has to ask how close a task is to being done, the measure is less objective, and the tracker may have to be more intrusive into how the team member came up with the estimate. The simple binary test (“is it done?”) avoids this extra level of detail, and keeps the meetings shorter and more straightforward. After the tracking meetings, the tracker sums the estimates of completed tasks, divides the sum by the current velocity, and multiplies by 100. The result is the percentage of planned work which has been completed for this iteration. If the number is 60% and you are at the end of day three of a one week iteration, the iteration is on track. If the number is lower, the tracker needs to ask the customer to cut scope. 7.2 Don’t Slip the Date Traditional project management tends towards adjusting the schedule to meet reality, that is, scope is fixed, and it’s the date that needs to slip. XP’s view is that scope is variable, and it’s more important to keep dates fixed. If you change the date, the entire team has to be involved. The team members who are on track will need new tasks (more communication). Their flow will be disrupted by an extra meeting to figure out what tasks need to be added. Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 48 The cheaper alternative to slipping the date is to cut tasks. This is less costly in terms of communication. The tracker already knows which tasks are in trouble, and he is already are talking with the people who are responsible for them. The tracker’s job is to make the customer aware of the problems. The programmers who are on track needn’t be bothered. The customer picks which stories to drop. The tracker gives the customer the raw data (list of problematic stories) as well as your own interpretation of the factors involved. Call in the programmers to help you explain the details if need be. The better informed the customer is, the more easily she can decide what to drop. 7.3 Adding Tasks Believe it or not, there are times when stories need to be added to an iteration. For example, the customer may see an important problem while using the prior iteration or a programmer may have finished all his tasks before the end of the iteration. The customer decides what to add. The tracker only involves those programmers who are available for the additional stories. Not that the cusomter must stay within budget, so tasks may need to be dropped to balance out the additions. The tracker gives the customer a list of tasks in progress to help prevent unnecessary task switching. 7.4 The Tracker The tracker must be someone who can speak directly to all team members. He needs to be a perceptive listener, because tracking is more than just numbers. It’s about finding root causes and resolving them. Most problems you run into are related to the people, not the technology. And, people are needed to solve them. The role of tracker is best played by the project manager, in my opinion. Alternatively, you may want to rotate the position of Tracker throughout your project, or rotate the trackers between projects. Tracking, like management in general, needs to be understood by the whole team.2 Rotating everybody through the position of tracker, gives the entire team the opporunity to see the forest for the trees. 2 If you want to know why management is important, pick up a copy of What Management Is: How it works and why it’s everyone’s business, Joan Magretta, Simon and Schuster, Inc., 2002. It’s an excellent, slim book on management. Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 49 7.5 Release Tracking The simplest way to track release progress is with a graph of velocity. The graph should quickly converge on a constant value, for example: Typical Velocity Graph Velocity converges when the task estimates align with actual capacity. Once this happens, velocity should remain relatively constant. Now let’s take a look at a graph from a troubled project:3 Troubled Project’s Velocity Graph 3 This data was taken from 10 week-long iterations from a project at my company. Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 50 The project started out normally with velocity starting to converge around the third and fourth iteration. By the fifth or sixth iteration velocity started to drop off. The project was in serious trouble by the ninth iteration. The next step is figuring out why. 7.6 What Goes Wrong? Finding the root cause for a velocity trend change can be difficult. In this project, we had a problem with quality which was indicated by an increase in the number of stories to fix defects. This was obvious when reviewing the story cards. When I went back to review the cards for this chapter, it struck me that the task estimates seem shorter as the project progressed. While I don’t recommend tracking average task length in general, the graph illuminates the problem in this case: Troubled Project’s Average Task Length Graph Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 51 The graph shows that the average task length started dropping around the fourth iteration. In conjunction with the drop in velocity, this indicates the tasks were shorter, and we were underestimating them. These symptoms are indicative that change was harder, and were probably caused by quality issues. The team was battling the big, hairy, low quality spider. Low quality is not a root cause, rather it’s a symptom of not using best practices. After reviewing the project, we attributed the poor quality to the following root causes: Customer Unavailable The customer didn’t start using the system until the fifth iteration. Too Few Acceptance Tests The team didn’t test end to end function. It was thought there wasn’t enough time, and was partially related to the team’s relative inexperience. Inexperience The domain, development environment, Perl, and XP were all new to the developers. The customer was new to XP. Doing too many new things at once is rarely a good idea, and in this case, was a significant weak point. In the next section, you’ll see how we fixed these problems. For now, let’s take a look at a few other problems you might encounter when developing with XP: Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 52 Failing to Finish The customer does not stop making changes, and won’t launch until all changes are done. This is a planning failure. With XP, you need to pick dates, and stick to them. The tracker should noticed that dates are slipping. In XP, we don’t slip dates, we cut scope instead. Too Little Refactoring Refactoring is put off until after launch. This reduces quality, which can be difficult to recover from, because the team falls into the bug-fixing trap soon after launch. Too little refactoring multiplies defects through copy-and-paste-itis: an inflammation of defects caused by over use of the copy-and-paste function in editors. The tracker should notice that the code base is growing too rapidly. If the number of lines of code is growing linearly with the number of ideal days, it means there’s not enough refactoring. It’s unlikely that every programmer thinks up the right code abstraction for every task. The programmers have to refactor to create the right abstractions, and that will shrink the code base. Too Much Refactoring The programmers are perfectionists, and they won’t stop trying to improve the code. This greatly reduces the amount of business value being added, and pushes off the launch date. This one may be a bit tricky to notice with a simple velocity graph, because the velocity may be constant. This is where the tracker needs to use his sixth sense that velocity is simply too low. Not Enough Unit Tests Finding the right balance on unit tests is not easy, but it’s fairly clear when there aren’t enough: the team is afraid to make changes. This happened on one of my first XP-like (or should I say, XP-lite) projects. The project was successful enough, but now we are living under the constant fear of change. We’re adding unit tests slowly, but it takes time, and it’s hard to justify writing tests when “everything is working fine”. Too Little Pair Programming The programmers go off into their corners to get work done. The problem is that they don’t know what everybody else is doing, and there’s probably a lot of duplicated effort. Solitary programming is visually obvious to the tracker. It may even be mandated by management to save money. Velocity may be constant. However, quality will soon suffer. Copyright c 2004 Robert Nagler All rights reserved nagler@extremeperl.org 53
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.