JETZT ONLINE BESTELLEN
Add to Cart
The Art of Agile Development

First Edition Dezember 2007
ISBN 978-0-596-52767-9
438 Seiten
EUR32.00

Weitere Informationen zu diesem Buch

Inhaltsverzeichnis | Rezensionen |
Index |


Inhaltsverzeichnis

	
Chapter 1: Why Agile?
Inhaltsvorschau
Agile development is popular. All the cool kids are doing it: Google, Yahoo, Symantec, Microsoft, and the list goes on. I know of one company that has already changed its name to Agili-something in order to ride the bandwagon. (They called me in to pitch their “agile process,” which, upon further inspection, was nothing more than outsourced offshore development, done in a different country than usual.) I fully expect the big consulting companies to start offering Certified Agile Processes and Certified Agile Consultants—for astronomical fees, of course—any day now.
Please don’t get sucked into that mess.
In 1986, famously predicted that there were no silver bullets: that by 1996, no single technology or management technique would offer a tenfold increase in productivity, reliability, or simplicity. None did.
Agile development isn’t a silver bullet, either.
In fact, I don’t recommend adopting agile development solely to increase productivity. Its benefits—even the ability to release software more frequently—come from working differently, not from working faster. Although anecdotal evidence indicates that agile teams have above-average productivity, that shouldn’t be your primary motivation. Your team will need time to learn agile development. While they learn—and it will take a quarter or two—they’ll go slower, not faster. In addition, emphasizing productivity might encourage your team to take shortcuts and to be less rigorous in their work, which could actually harm productivity.
Agile development may be the cool thing to do right now, but that’s no reason to use it. When you consider using agile development, only one question matters.
Will agile development help us be more successful?
When you can answer that question, you’ll know whether agile development is right for you.
The traditional idea of success is delivery on time, on budget, and according to specification. provides some classic definitions:
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Understanding Success
Inhaltsvorschau
The traditional idea of success is delivery on time, on budget, and according to specification. provides some classic definitions:

Important

Despite their popularity, there’s something wrong with these definitions.
Successful
“Completed on time, on budget, with all features and functions as originally specified.”
Challenged
“Completed and operational but over budget, over the time estimate, [with] fewer features and functions than originally specified.”
Impaired
“Cancelled at some point during the development cycle.”
Despite their popularity, there’s something wrong with these definitions. A project can be successful even if it never makes a dime. It can be challenged even if it delivers millions of dollars in revenue.
CIO Magazine commented on this oddity:
Projects that were found to meet all of the traditional criteria for success—time, budget and specifications—may still be failures in the end because they fail to appeal to the intended users or because they ultimately fail to add much value to the business.
... Similarly, projects considered failures according to traditional IT metrics may wind up being successes because despite cost, time or specification problems, the system is loved by its target audience or provides unexpected value. For example, at a financial services company, a new system... was six months late and cost more than twice the original estimate (final cost was $5.7 million). But the project ultimately created a more adaptive organization (after 13 months) and was judged to be a great success—the company had a $33 million reduction in write-off accounts, and the reduced time-to-value and increased capacity resulted in a 50 percent increase in the number of concurrent collection strategy tests in production.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Beyond Deadlines
Inhaltsvorschau
There has to be more to success than meeting deadlines... but what?
When I was a kid, I was happy just to play around. I loved the challenge of programming. When I got a program to work, it was a major victory. Back then, even a program that didn’t work was a success of some sort, as long as I had fun writing it. My definition of success centered on personal rewards.
As I gained experience, my software became more complicated and I often lost track of how it worked. I had to abandon some programs before they were finished. I began to believe that maintainability was the key to success—an idea that was confirmed as I entered the workforce and began working with teams of other programmers. I prided myself on producing elegant, maintainable code. Success meant technical excellence.
Despite good code, some projects flopped. Even impeccably executed projects could elicit yawns from users. I came to realize that my project teams were part of a larger ecosystem involving dozens, hundreds, or even thousands of people. My projects needed to satisfy those people ... particularly the ones signing my paycheck. In fact, for the people funding the work, the value of the software had to exceed its cost. Success meant delivering value to the organization.
These definitions aren’t incompatible. All three types of success are important (see ). Without personal success, you’ll have trouble motivating yourself and employees. Without technical success, your source code will eventually collapse under its own weight. Without organizational success, your team may find that they’re no longer wanted in the company.
Figure : Types of success
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
The Importance of Organizational Success
Inhaltsvorschau
Organizational success is often neglected by software teams in favor of the more easily achieved technical and personal successes. Rest assured, however, that even if you’re not taking responsibility for organizational success, the broader organization is judging your team at this level. Senior management and executives aren’t likely to care if your software is elegant, maintainable, or even beloved by its users; they care about results. That’s their return on investment in your project. If you don’t achieve this sort of success, they’ll take steps to ensure that you do.
Unfortunately, senior managers don’t usually have the time or perspective to apply a nuanced solution to each project. They wield swords, not scalpels. They rightly expect their project teams to take care of fine details.
When managers are unhappy with your team’s results, the swords come out. Costs are the most obvious target. There are two easy ways to cut them: set aggressive deadlines to reduce development time, or ship the work to a country with a lower cost of labor. Or both.
These are clumsy techniques. Aggressive deadlines end up increasing schedules rather than reducing them (p. 220), and offshoring has hidden costs .
Do aggressive deadlines and the threat of offshoring sound familiar? If so, it’s time for your team to take back responsibility for its success: not just for personal or technical success, but for organizational success as well.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Enter Agility
Inhaltsvorschau
Will agile development help you be more successful? It might. Agile development focuses on achieving personal, technical, and organizational successes. If you’re having trouble with any of these areas, agile development might help.
Agile methods achieve organizational successes by focusing on delivering value and decreasing costs. This directly translates to increased return on investment. Agile methods also set expectations early in the project, so if your project won’t be an organizational success, you’ll find out early enough to cancel it before your organization has spent much money.
Specifically, agile teams increase value by including business experts and by focusing development efforts on the core value that the project provides for the organization. Agile projects release their most valuable features first and release new versions frequently, which dramatically increases value. When business needs change or when new information is discovered, agile teams change direction to match. In fact, an experienced agile team will actually seek out unexpected opportunities to improve its plans.
Agile teams decrease costs as well. They do this partly by technical excellence; the best agile projects generate only a few bugs per month. They also eliminate waste by cancelling bad projects early and replacing expensive development practices with simpler ones. Agile teams communicate quickly and accurately, and they make progress even when key individuals are unavailable. They regularly review their process and continually improve their code, making the software easier to maintain and enhance over time.
Extreme Programming, the agile method I focus on in this book, is particularly adept at achieving technical successes. XP programmers work together, which helps them keep track of the nitpicky details necessary for great work and ensures that at least two people review every piece of code. Programmers continuously integrate their code, which enables the team to release the software whenever it makes business sense. The whole team focuses on finishing each feature completely before starting the next, which prevents unexpected delays before release and allows the team to change direction at will.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 2: How to Be Agile
Inhaltsvorschau
What does it mean to “be agile”?
The answer is more complicated than you might think. Agile development isn’t a specific process you can follow. No team practices the Agile method. There’s no such thing.
Agile development is a philosophy. It’s a way of thinking about software development. The canonical description of this way of thinking is the Agile Manifesto, a collection of 4 values () and 12 principles ().
To “be agile,” you need to put the agile values and principles into practice.
Figure : Agile values
A method, or process, is a way of working. Whenever you do something, you’re following a process. Some processes are written, as when assembling a piece of furniture; others are ad hoc and informal, as when I clean my house.
Agile methods are processes that support the agile philosophy. Examples include Extreme Programming and Scrum.
Agile methods consist of individual elements called practices. Practices include using version control, setting coding standards, and giving weekly demos to your stakeholders. Most of these practices have been around for years. Agile methods combine them in unique ways, accentuating those parts that support the agile philosophy, discarding the rest, and mixing in a few new ideas. The result is a lean, powerful, self-reinforcing package.
Just as established agile methods combine existing practices, you might want to create your own agile method by mixing together practices from various agile methods. At first glance, this doesn’t seem too hard. There are scores of good agile practices to choose from.
However, creating a brand-new agile method is a bad idea if you’ve never used agile development before. Just as there’s more to programming than writing code, there’s more to agile development than the practices. The practices are an expression of underlying agile principles. (For more on agile principles, see .) Unless you understand those principles intimately—that is, unless you’ve already mastered the art of agile development—you’re probably not going to choose the right practices. Agile practices often perform double- and triple-duty, solving multiple software development problems simultaneously and supporting each other in clever and surprising ways.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Agile Methods
Inhaltsvorschau
A method, or process, is a way of working. Whenever you do something, you’re following a process. Some processes are written, as when assembling a piece of furniture; others are ad hoc and informal, as when I clean my house.
Agile methods are processes that support the agile philosophy. Examples include Extreme Programming and Scrum.
Agile methods consist of individual elements called practices. Practices include using version control, setting coding standards, and giving weekly demos to your stakeholders. Most of these practices have been around for years. Agile methods combine them in unique ways, accentuating those parts that support the agile philosophy, discarding the rest, and mixing in a few new ideas. The result is a lean, powerful, self-reinforcing package.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Don’t Make Your Own Method
Inhaltsvorschau
Just as established agile methods combine existing practices, you might want to create your own agile method by mixing together practices from various agile methods. At first glance, this doesn’t seem too hard. There are scores of good agile practices to choose from.
However, creating a brand-new agile method is a bad idea if you’ve never used agile development before. Just as there’s more to programming than writing code, there’s more to agile development than the practices. The practices are an expression of underlying agile principles. (For more on agile principles, see .) Unless you understand those principles intimately—that is, unless you’ve already mastered the art of agile development—you’re probably not going to choose the right practices. Agile practices often perform double- and triple-duty, solving multiple software development problems simultaneously and supporting each other in clever and surprising ways.
Figure : Agile principles
Every project and situation is unique, of course, so it’s a good idea to have an agile method that’s customized to your situation. Rather than making an agile method from scratch, start with an existing, proven method and iteratively refine it. Apply it to your situation, note where it works and doesn’t, make an educated guess about how to improve, and repeat. That’s what experts do.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
The Road to Mastery
Inhaltsvorschau
The core thesis of this book is that mastering the art of agile development requires real-world experience using a specific, well-defined agile method. I’ve chosen Extreme Programming for this purpose. It has several advantages:
  • Of all the agile methods I know, XP is the most complete. It places a strong emphasis on technical practices in addition to the more common teamwork and structural practices.
  • XP has undergone intense scrutiny. There are thousands of pages of explanations, experience reports, and critiques out there. Its capabilities and limitations are very well understood.
  • I have a lot of experience with XP, which allows me to share insights and practical tips that will help you apply XP more easily.
To master the art of agile development—or simply to use XP to be more successful—follow these steps:

Important

Teams new to XP often underapply its practices.
  1. Decide why you want to use agile development. Will it make your team and organization more successful? How? (For ideas, see ” in Chapter 1.)
  2. Determine whether this book’s approach will work for your team. (See ” in Chapter 4.)
  3. Adopt as many of XP’s practices as you can. (See .) XP’s practices are self-reinforcing, so it works best when you use all of them together.
  4. Follow the XP practices rigorously and consistently. (See .) If a practice doesn’t work, try following the book approach more closely. Teams new to XP often underapply its practices. Expect to take two or three months to start feeling comfortable with the practices and another two to six months for them to become second nature.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Find a Mentor
Inhaltsvorschau
As you adapt XP to your situation, you’re likely to run into problems and challenges. I provide solutions for a wide variety of common problems, but you’re still likely to encounter situations that I don’t cover. For these situations, you need a mentor: an outside expert who has mastered the art of agile development.
If you can get an expert to coach your team directly, that’s even better. However, even master coaches benefit from an outside perspective when they encounter problems.
The hardest part of finding a mentor is finding someone with enough experience in agile development. Sources to try include:
  • Other groups practicing XP in your organization
  • Other companies practicing XP in your area
  • A local XP/Agile user group
  • XP/Agile consultants
  • The XP mailing list: extremeprogramming@yahoogroups.com
I can’t predict every problem you’ll encounter, but I can help you see when things are going wrong. Throughout this book, I’ve scattered advice such as: “If you can’t demonstrate progress weekly, it’s a clear sign that your project is in trouble. Slow down for a week and figure out what’s going wrong. Ask your mentor for help.”
When I tell you to ask your mentor for help, I mean that the correct solution depends on the details of your situation. Your mentor can help you troubleshoot the problem and offer situation-specific advice.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 3: Understanding XP
Inhaltsvorschau
“Welcome to the team, Pat,” said Kim, smiling at the recent graduate. “Let me show you around. As I said during the interview, we’re an XP shop. You may find that things are a little different here than you learned in school.”
“I’m eager to get started,” said Pat. “I took a software engineering course in school, and they taught us about the software development lifecycle. That made a lot of sense. There was a bit about XP, but it sounded like it was mostly about working in pairs and writing tests first. Is that right?”
“Not exactly,” said Kim. “We do use pair programming, and we do write tests first, but there’s much more to XP than that. Why don’t you ask me some questions? I’ll explain how XP is different than what you learned.”
Pat thought for a moment. “Well, one thing I know from my course is that all development methods use the software development lifecycle: analysis, design, coding, and testing [see ]. Which phase are you in right now? Analysis? Design? Or is it coding or testing?”
“Yes!” Kim grinned. She couldn’t help a bit of showmanship.
“I don’t understand. Which is it?”
“All of them. We’re working on analysis, design, coding, and testing. Simultaneously. Oh, and we deploy the software every week, too.”
Pat looked confused. Was she pulling his leg?
Kim laughed. “You’ll see! Let me show you around.
“This is our team room. As you can see, we all sit together in one big workspace. This helps us collaborate more effectively.”
Kim led Pat over to a big whiteboard where a man stood frowning at dozens of index cards. “Brian, I’d like you to meet Pat, our new programmer. Brian is our product manager. What are you working on right now?”
Figure : Traditional lifecycles
“I’m trying to figure out how we should modify our release plan based on the feedback from the user meeting last week. Our users love what we’ve done so far, but they also have some really good suggestions. I’m trying to decide if their suggestions are worth postponing the feature we were planning to start next week. Our success has made us visible throughout the company, so requests are starting to flood in. I need to figure out how to keep us on track without alienating too many people.”
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
The XP Lifecycle
Inhaltsvorschau
One of the most astonishing premises of XP is that you can eliminate requirements, design, and testing phases as well as the formal documents that go with them.
This premise is so far off from the way we typically learn to develop software that many people dismiss it as a delusional fantasy. “These XP folks obviously don’t know what they’re talking about,” they say. “Just last month I was on a project that failed due to inadequate requirements and design. We need more requirements, design, and testing, not less!”
That’s true. Software projects do need more requirements, design, and testing—which is why XP teams work on these activities every day. Yes, every day.
You see, XP emphasizes face-to-face collaboration. This is so effective in eliminating communication delays and misunderstandings that the team no longer needs distinct phases. This allows them to work on all activities every day—with simultaneous phases—as shown in .
Figure : XP lifecycle
Using simultanous phases, an XP team produces deployable software every week. In each iteration, the team analyzes, designs, codes, tests, and deploys a subset of features.
Although this approach doesn’t necessarily mean that the team is more productive, it does mean that the team gets feedback much more frequently. As a result, the team can easily connect successes and failures to their underlying causes. The amount of unproven work is very small, which allows the team to correct some mistakes on the fly, as when coding reveals a design flaw, or when a customer review reveals that a user interface layout is confusing or ugly.
The tight feedback loop also allows XP teams to refine their plans quickly. It’s much easier for a customer to refine a feature idea if she can request it and start to explore a working prototype within a few days. The same principle applies for tests, design, and team policy. Any information you learn in one phase can change the way you think about the rest of the software. If you find a design defect during coding or testing, you can use that knowledge as you continue to analyze requirements and design the system in subsequent iterations.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
The XP Team
Inhaltsvorschau
Working solo on your own project—“scratching your own itch”—can be a lot of fun. There are no questions about which features to work on, how things ought to work, if the software works correctly, or whether stakeholders are happy. All the answers are right there in one brain.
Team software development is different. The same information is spread out among many members of the team. Different people know:
  • How to design and program the software (programmers, designers, and architects)
  • Why the software is important (product manager)
  • The rules the software should follow (domain experts)
  • How the software should behave (interaction designers)
  • How the user interface should look (graphic designers)
  • Where defects are likely to hide (testers)
  • How to interact with the rest of the company (project manager)
  • Where to improve work habits (coach)
All of this knowledge is necessary for success. XP acknowledges this reality by creating cross-functional teams composed of diverse people who can fulfill all the team’s roles.
XP teams sit together in an open workspace. At the beginning of each iteration, the team meets for a series of activities: an iteration demo, a retrospective, and iteration planning. These typically take two to four hours in total. The team also meets for daily stand-up meetings, which usually take five to ten minutes each.
Other than these scheduled activities, everyone on the team plans his own work. That doesn’t mean everybody works independently; they just aren’t on an explicit schedule. Team members work out the details of each meeting when they need to. Sometimes it’s as informal as somebody standing up and announcing across the shared workspace that he would like to discuss an issue. This
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
XP Concepts
Inhaltsvorschau
As with any specialized field, XP has its own vocabulary. This vocabulary distills several important concepts into snappy descriptions. Any serious discussion of XP (and of agile in general) uses this vocabulary. Some of the most common ideas follow.

Important

There are multiple ways of expressing the same concept in source code. Some are better than others. Refactoring is the process of changing the structure of code—rephrasing without changing its meaning or behavior. It’s used to improve code quality, to fight off software’s unavoidable entropy, and to ease adding new features.
Imagine a customer rushing down the hallway to your desk. “It’s a bug!” she cries, out of breath. “We have to fix it now.” You can think of two solutions: the right way and the fast way. You just know she’ll watch over your shoulder until you fix it. So you choose the fast way, ignoring the little itchy feeling that you’re making the code a bit messier.
Technical debt is the total amount of less-than-perfect design and implementation decisions in your project. This includes quick and dirty hacks intended just to get something working right now! and design decisions that may no longer apply due to business changes. Technical debt can even come from development practices such as an unwieldy build process or incomplete test coverage. It lurks in gigantic methods filled with commented-out code and “TODO: not sure why this works” comments. These dark corners of poor formatting, unintelligible control flow, and insufficient testing breed bugs like mad.
The bill for this debt often comes in the form of higher maintenance costs. There may not be a single lump sum to pay, but simple tasks that ought to take minutes may stretch into hours or afternoons. You might not even notice it except for a looming sense of dread when you read a new bug report and suspect it’s in
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 4: Adopting XP
Inhaltsvorschau
“I can see how XP would work for IT projects, but product development is different.” —a product development team
“I can see how XP would work for product development, but IT projects are different.” —an in-house IT development team
Before adopting XP, you need to decide whether it’s appropriate for your situation. Often, people’s default reaction to hearing about XP is to say, “Well, of course that works for other teams, but it couldn’t possibly work for us.”

Important

XP’s applicability is based on organizations and people, not types of projects.
Question that assumption. I’ve helped a wide variety of teams adopt XP: 20-person teams and 1-person teams; huge corporations and small startups; shrinkwrap, in-house, and outsourced software vendors; proprietary and open source developers. Through these experiences, I’ve learned that software teams are more similar than they are different. XP’s applicability has far more to do with your organization and the people involved than with the type of project you’re working on.
You can adopt XP in many different conditions, although the practices you use will vary depending on your situation. The practices in this book were chosen to give you the greatest chance of success. That leads to some prerequisites and recommendations about your team’s environment. You don’t have meet these criteria exactly, but it’s worth trying to change your environment so that you do. This will give you the best chance of succeeding.
As Martin Fowler said:
In this sense I see a startling parallel between DHH [David Heinemeier Hansson, creator of Ruby on Rails] and Kent Beck. For either of them, if you present them with a constrained world, they’ll look at constraints we take for granted, consider them to be unessential, and create a world without them. I don’t have that quality, I tend to try to work within the constraints gradually pushing at them, while they just stick some intellectual dynamite under them and move on. That’s why they can create things like Extreme Programming and Rails which really give the industry a jolt.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Is XP Right for Us?
Inhaltsvorschau
You can adopt XP in many different conditions, although the practices you use will vary depending on your situation. The practices in this book were chosen to give you the greatest chance of success. That leads to some prerequisites and recommendations about your team’s environment. You don’t have meet these criteria exactly, but it’s worth trying to change your environment so that you do. This will give you the best chance of succeeding.
As Martin Fowler said:
In this sense I see a startling parallel between DHH [David Heinemeier Hansson, creator of Ruby on Rails] and Kent Beck. For either of them, if you present them with a constrained world, they’ll look at constraints we take for granted, consider them to be unessential, and create a world without them. I don’t have that quality, I tend to try to work within the constraints gradually pushing at them, while they just stick some intellectual dynamite under them and move on. That’s why they can create things like Extreme Programming and Rails which really give the industry a jolt.
In other words, if your organization puts a barrier between your work and success, don’t just put up with it—find a way to remove it. It’s your best path to success.
Similarly, if you want to practice XP, do everything you can to meet the following prerequisites and recommendations. This is a lot more effective than working around limitations.
It’s very difficult to use XP in the face of opposition from management. Active support is best. To practice XP as described in this book, you will need the following:
  • A common workspace with pairing stations (see ” in )
  • Team members solely allocated to the XP project (see ” in )
  • A product manager, on-site customers, and integrated testers (also discussed in ” in )
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Go!
Inhaltsvorschau
Are you ready to adopt XP? Great! Your first step is to arrange for your open workspace (see ” in ). Start solving this problem now. It will probably take longer than you expect.
Next, find an appropriate project for the team to work on. Look for a project that’s valuable, but be wary of projects that will be under intense scrutiny. You need room to make mistakes as you learn.
Avoid taking a project with low value as a “learning opportunity.” You’ll have trouble involving customers and achieving an organizational success. Your organization could view the project as a failure even if it’s a technical success.
At the same time, figure out who will be on your team. ” in provides some suggestions for team structure. Talk with your project’s executive sponsor and other stakeholders about who to include as your on-site customers. (See ” in for ideas.) Be sure your team members want to try XP.
As you’re forming your team, consider hiring an experienced XP coach to work with the team full-time. Although a coach isn’t necessary—I learned XP by reading about it and trying it—a good coach will make things go more smoothly.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Assess Your Agility
Inhaltsvorschau
Suppose you’ve been using XP for a few months. How can you tell if you’re doing it properly? The ultimate measure is the success of your project, but you may wish to review and assess your approach to XP as well.
To help you do this, I’ve created a quiz that focuses on five important aspects of agile development. It explores results rather than specific practices, so you can score well even after customizing XP to your situation. If you aren’t using XP at all, you can also use this quiz to assess your current approach.
This quiz assesses typical sources of risk. Your goal should be to achieve the maximum score in each category—which is well within the grasp of experienced XP teams. Any score less than the maximum indicates risk, and an opportunity for improvement.
To take the quiz, answer the following questions and enter your scores on a photocopy of the blank radar diagram (). Don’t give partial credit for any question, and if you aren’t sure of the answer, give yourself zero points. The result should look something like . The score of the lowest spoke identifies your risk, as follows:
  • 75 points or less: immediate improvement required (red)
  • 75 to 96 points: improvement necessary (yellow)
  • 97, 98, or 99: improvement possible (green)
  • 100: no further improvement needed
Figure : Example assessment
The point values for each answer come from an algorithm that ensures correct risk assessment of the total score. This leads to some odd variations in scores. Don’t read too much into the disparities between the values of individual questions.
To see the XP solution for each of these questions, cross-reference the sections listed under “XP Practices” in Tables through .
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 5: Thinking
Inhaltsvorschau
What’s wrong with this sentence?
What we really need is more keyboards cranking out code.
That’s a quote from a manager I once worked with. In a way, he was right: you will never give your customer what she wants without typing on a keyboard.
But that wasn’t our problem. I later realized our progress had a single bottleneck: the availability of our staging environment. More keyboards wouldn’t have helped, even if we had more programmers sitting at them. If we had realized this sooner, we would have been much more productive.
Sometimes the biggest gains in productivity come from stopping to think about what you’re doing, why you’re doing it, and whether it’s a good idea. The best developers don’t just find something that works and use it; they also question why it works, try to understand it, and then improve it.
XP doesn’t require experts. It does require a habit of mindfulness. This chapter contains five practices to help mindful developers excel:
  • Pair programming doubles the brainpower available during coding, and gives one person in each pair the opportunity to think about strategic, long-term issues.
  • Energized work acknowledges that developers do their best, most productive work when they’re energized and motivated.
  • An informative workspace gives the whole team more opportunities to notice what’s working well and what isn’t.
  • Root-cause analysis is a useful tool for identifying the underlying causes of your problems.
  • Retrospectives provide a way to analyze and improve the entire development process.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Pair Programming
Inhaltsvorschau
Programmers, Whole Team
We help each other succeed.
Do you want somebody to watch over your shoulder all day? Do you want to waste half your time sitting in sullen silence watching somebody else code?
Of course not. Nobody does—especially not people who pair program.
Pair programming is one of the first things people notice about XP. Two people working at the same keyboard? It’s weird. It’s also extremely powerful and, once you get used to it, tons of fun. Most programmers I know who tried pairing for a month find that they prefer it to programming alone.
This chapter is called Thinking, yet I included pair programming as the first practice. That’s because pair programming is all about increasing your brainpower.
When you pair, one person codes—the driver. The other person is the navigator, whose job is to think. As navigator, sometimes you think about what the driver is typing. (Don’t rush to point out missing semicolons, though. That’s annoying.) Sometimes you think about what tasks to work on next and sometimes you think about how your work best fits into the overall design.
This arrangement leaves the driver free to work on the tactical challenges of creating rigorous, syntactically correct code without worrying about the big picture, and it gives the navigator the opportunity to consider strategic issues without being distracted by the details of coding. Together, the driver and navigator create higher-quality work more quickly than either could produce on their own.
Pairing also reinforces good programming habits. XP’s reliance on continuous testing and design refinement takes a lot of self-discipline. When pairing, you’ll have positive peer pressure to perform these difficult but crucial tasks. You’ll spread coding knowledge and tips throughout the team.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Energized Work
Inhaltsvorschau
Coaches, Whole Team
We work at a pace that allows us to do our best, most productive work indefinitely.
I enjoy programming. I enjoy solving problems, writing good code, watching tests pass, and especially removing code while refactoring. I program in my spare time and sometimes even think about work in the shower.
In other words, I love my work. Yet put me on a team with unclear goals, little collective responsibility, and infighting, and I’ll wake up dreading going into work. I’ll put in my hours at the office, but I’ll be tempted to spend my mornings reading email and my afternoons picking at code while surfing through marginally related technical web sites.
We’ve all been in this situation. Because we’re professionals, we strive to produce quality work even when we feel demoralized. Still, consider the times of greatest productivity in your career. Do you notice a big difference when you wake up and feel blessed to go into work? Isn’t it much more satisfying to leave on time at the end of the day, knowing that you accomplished something solid and useful?
XP’s practice of energized work recognizes that, although professionals can do good work under difficult circumstances, they do their best, most productive work when they’re energized and motivated.

Important

Go home on time.
One of the simplest ways to be energized is to take care of yourself. Go home on time every day. Spend time with family and friends and engage in activities that take your mind off of work. Eat healthy foods, exercise, and get plenty of sleep. While you’re busy with these other things, your brain will turn over the events of the day. You’ll often have new insights in the morning.
If quality time off is the yin of energized work, focused work is the yang. While at work, give it your full attention. Turn off interruptions such as email and instant messaging. Silence your phones. Ask your project manager to shield you from unnecessary meetings and organizational politics.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Informative Workspace
Inhaltsvorschau
Whole Team
We are tuned in to the status of our project.
Your workspace is the cockpit of your development effort. Just as a pilot surrounds himself with information necessary to fly a plane, arrange your workspace with information necessary to steer your project: create an informative workspace.
An informative workspace broadcasts information into the room. When people take a break, they will sometimes wander over and stare at the information surrounding them. Sometimes, that brief zone-out will result in an aha moment of discovery.
An informative workspace also allows people to sense the state of the project just by walking into the room. It conveys status information without interrupting team members and helps improve stakeholder trust.

Important

Simply poking your head into a project room should give you information about the project.
The essence of an informative workspace is information. One simple source of information is the feel of the room. A healthy project is energized. There’s a buzz in the air—not tension, but activity. People converse, work together, and make the occasional joke. It’s not rushed or hurried, but it’s clearly productive. When a pair needs help, other pairs notice, lend their assistance, then return to their tasks. When a pair completes something well, everyone celebrates for a moment.
An unhealthy project is quiet and tense. Team members don’t talk much, if at all. It feels drab and bleak. People live by the clock, punching in and punching out—or worse, watching to see who is the first one to dare to leave.
Besides the feel of the room, other cues communicate useful information quickly and subconsciously. If the build token is away from the integration machine, it’s not safe to check out the code right now. By mid-iteration, unless about half the cards on the iteration plan are done, the team is going faster or slower than anticipated.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Root-Cause Analysis
Inhaltsvorschau
Whole Team
We prevent mistakes by fixing our process.
When I hear about a serious mistake on my project, my natural reaction is to get angry or frustrated. I want to blame someone for screwing up.
Unfortunately, this response ignores the reality of Murphy’s Law. If something can go wrong, it will. People are, well, people. Everybody makes mistakes. I certainly do. Aggressively laying blame might cause people to hide their mistakes, or to try to pin them on others, but this dysfunctional behavior won’t actually prevent mistakes.
Instead of getting angry, I try to remember Norm Kerth’s Prime Directive: everybody is doing the best job they can given their abilities and knowledge (see ” later in this chapter for the full text of the Prime Directive). Rather than blaming people, I blame the process. What is it about the way we work that allowed this mistake to happen? How can we change the way we work so that it’s harder for something to go wrong?
This is root-cause analysis.
A classic approach to root-cause analysis is to ask “why” five times. Here’s a real-world example.
Problem: When we start working on a new task, we spend a lot of time getting the code into a working state.
Why? Because the build is often broken in source control.
Why? Because people check in code without running their tests.
It’s easy to stop here and say, “Aha! We found the problem. People need to run their tests before checking in.” That is a correct answer, as running tests before check-in is part of continuous integration. But it’s also already part of the process. People know they should run the tests, they just aren’t doing it. Dig deeper.
Why don’t they run tests before checking in? Because sometimes the tests take longer to run than people have available.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Retrospectives
Inhaltsvorschau
Whole Team
We continually improve our work habits.
No process is perfect. Your team is unique, as are the situations you encounter, and they change all the time. You must continually update your process to match your changing situations. Retrospectives are a great tool for doing so.
The most common retrospective, the iteration retrospective, occurs at the end of every iteration.
In addition to iteration retrospectives, you can also conduct longer, more intensive retrospectives at crucial milestones. These release retrospectives, project retrospectives, and surprise retrospectives (conducted when an unexpected event changes your situation) give you a chance to reflect more deeply on your experiences and condense key lessons to share with the rest of the organization.
These other retrospectives are out of the scope of this book. They work best when conducted by neutral third parties, so consider bringing in an experienced retrospective facilitator. Larger organizations may have such facilitators on staff (start by asking the HR department), or you can bring in an outside consultant. If you’d like to conduct them yourself, and are great resources.
Anybody can facilitate an iteration retrospective if the team gets along well. An experienced, neutral facilitator is best to start with. When the retrospectives run smoothly, give other people a chance to try.
Everyone on the team should participate in each retrospective. In order to give participants a chance to speak their minds openly, non-team members should not attend.
I timebox my retrospectives to exactly one hour. Your first few retrospectives will probably run long. Give it an extra half-hour, but don’t be shy about politely wrapping up and moving to the next step. The whole team will get better with practice, and the next retrospective is only a week away.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 6: Collaborating
Inhaltsvorschau
Sometimes I like to imagine software development as a pulsing web of light, with blips of information flowing along lines from far-flung points. The information races toward the development team, which is a brilliant, complex tangle of lines, then funnels into a glowing core of software too bright to look at.
I’m a little weird that way.
There’s truth to the idea, though. Software development is all about information. The more effectively your programmers can access and understand the information they need, the more effective they will be at creating software. The better information customers and managers have, the better they can manage the schedule and provide feedback to the programmers.
Communication in the real world is a lot messier than it is in my image. There are no glowing lines to sterilely transport information from one brain to another. Instead, people have to work together. They have to ask questions, discuss ideas, and even disagree.
This chapter contains eight practices to help your team and its stakeholders collaborate efficiently and effectively:
  • Trust is essential for the team to thrive.
  • Sitting together leads to fast, accurate communication.
  • Real customer involvement helps the team understand what to build.
  • A ubiquitous language helps team members understand each other.
  • Stand-up meetings keep team members informed.
  • Coding standards provide a template for seamlessly joining the team’s work together.
  • Iteration demos keep the team’s efforts aligned with stakeholder goals.
  • Reporting helps reassure the organization that the team is working well.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Trust
Inhaltsvorschau
Whole Team, Coaches
We work together effectively and without fear.
When a group of people comes together to work as a team, they go through a series of group dynamics known as “Forming, Storming, Norming, and Performing” . It takes the team some time to get through each of these stages. They make progress, fall back, bicker, and get along. Over time—often months—and with adequate support and a bit of luck, they get to know each other and work well together. The team jells. Productivity shoots up. They do really amazing work.
What does it take to achieve this level of productivity? The team must take joint responsibility for their work. Team members need to think of the rest of the team as “us,” not “them.” If a team member notices something that needs doing, she takes responsibility for it, even if it’s not her specialty: she does it, finds someone to help her do it, or recruits someone else to take care of it.
Conversely, team members must rely on each other for help. When one member of a team encounters a question that she cannot answer, she doesn’t hesitate to ask someone who does know the answer. Sometimes these quick questions turn into longer pairing sessions.
Trust is essential for the team to perform this well. You need to trust that taking time to help others won’t make you look unproductive. You need to trust that you’ll be treated with respect when you ask for help or disagree with someone.
The organization needs to trust the team, too. XP is strange and different at first. It doesn’t provide the normal indicators of progress that managers are accustomed to seeing. It takes trust to believe that the team will deliver a success.
Trust doesn’t magically appear—you have to work at it. Here are some strategies for generating trust in your XP team.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Sit Together
Inhaltsvorschau
Whole Team, Coaches
We communicate rapidly and accurately.
If you’ve tried to conduct a team meeting via speakerphone, you know how much of a difference face-to-face conversations make. Compared to an in-person discussion, teleconferences are slow and stutter-filled, with uncomfortable gaps in the conversation and people talking over each other.
What you may not have realized is how much this affects your work.
Imagine you’re a programmer on a nonagile team and you need to clarify something in your requirements document in order to finish an algorithm. You fire off an email to your domain expert, Mary, then take a break to stretch your legs and get some coffee.
When you get back, Mary still hasn’t responded, so you check out a few technical blogs you’ve been meaning to read. Half an hour later, your inbox chimes. Mary has responded.
Uh-oh... it looks like Mary misunderstood your message and answered the wrong question. You send another query, but you really can’t afford to wait any longer. You take your best guess at the answer—after all, you’ve been working at this company for a long time, and you know most of the answers—and get back to work.
A day later, after exchanging a few more emails, you’ve hashed out the correct answer with Mary. It wasn’t exactly what you thought, but you were pretty close. You go back and fix your code. While you’re in there, you realize there’s an edge case nobody’s handled yet.
You could bug Mary for the answer, but this is a very obscure case. It’s probably never going to happen in the field. Besides, Mary’s very busy, and you promised you’d have this feature done yesterday. (In fact, you were done yesterday, except for all these nitpicky little details.) You put in the most likely answer and move on.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Real Customer Involvement
Inhaltsvorschau
Coaches, Customers
We understand the goals and frustrations of our customers and end-users.
An XP team I worked with included a chemist whose previous job involved the software that the team was working to replace. She was an invaluable resource, full of insight about what did and didn’t work with the old product. We were lucky to have her as one of our on-site customers—thanks to her, we created a more valuable product.
In an XP team, on-site customers are responsible for choosing and prioritizing features. The value of the project is in their hands. This is a big responsibility—as an on-site customer, how do you know which features to choose?
Some of that knowledge comes from your expertise in the problem domain and with previous versions of the software. You can’t think of everything, though. Your daily involvement with the project, although crucial, includes the risk of tunnel vision—you can get so caught up in the daily details of the project that you lose track of your real customers’ interests.
To widen your perspective, you need to involve real customers. The best approach to doing so depends on who you’re building your software for.
In personal development, the development team is its own customer. They’re developing the software for their own use. As a result, there’s no need to involve external customers—the team is the real customer.
I include this type of development primarily for completeness. Most personal development is for small, throwaway applications that don’t involve a full-blown XP team.
In-house custom development occurs when your organization asks your team to build something for the organization’s own use. This is classic IT development. It may include writing software to streamline operations, automation for the company’s factories, or producing reports for accounting.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Ubiquitous Language
Inhaltsvorschau
Programmers
We understand each other.
Try describing the business logic in your current system to a nonprogrammer domain expert. Are you able to explain how the system works in terms the domain expert understands? Can you avoid programmer jargon, such as the names of design patterns or coding styles? Is your domain expert able to identify potential problems in your business logic?
If not, you need a ubiquitous language.
One of the challenges of professional software development is that programmers aren’t necessarily experts in the areas for which they write software. For example, I’ve helped write software that controls factory robots, directs complex financial transactions, and analyzes data from scientific instruments. When I started on these projects, I knew nothing about those things.
It’s a conundrum. The people who are experts in the problem domain—the domain experts—are rarely qualified to write software. The people who are qualified to write software—the programmers—don’t always understand the problem domain.
Hiring programmers with expertise in a particular domain will reduce this problem, but it won’t eliminate it. In addition, given the choice between a great programmer with no domain experience and a poor programmer with lots of domain experience, I would choose the better programmer.
Overcoming this challenge is, fundamentally, an issue of communication. Domain experts communicate their expertise to programmers, who in turn encode that knowledge in software. The challenge is communicating that information clearly and accurately.
Imagine for a moment that you’re driving to a job interview. You forgot your map, so you’re getting directions from a friend on your cell phone (hands free, of course!):
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Stand-Up Meetings
Inhaltsvorschau
Whole Team
We know what our teammates are doing.
I have a special antipathy for status meetings. You know—a manager reads a list of tasks and asks about each one in turn. They seem to go on forever, although my part in them is typically only five minutes. I learn something new in perhaps 10 of the other minutes. The remaining 45 minutes are pure waste.

Important

There’s a good reason that organizations hold status meetings: people need to know what’s going on. XP projects have a more effective mechanism: informative workspaces and the daily stand-up meeting.
A stand-up meeting is very simple. At a pre-set time every day, the whole team stands in a circle. One at a time, each person briefly describes new information that the team should know.
I prefer to stand in an empty area of the team room rather than around a table—it feels a little more friendly that way. If you have room near the planning boards, that’s a particularly good spot for the stand-up.
Some teams use a formal variant of the stand-up called the Daily Scrum . It comes from an agile process also called Scrum. In the Daily Scrum, participants specifically answer three questions:
  1. What did I do yesterday?
  2. What will I do today?
  3. What problems are preventing me from making progress?
I prefer a more informal approach, but both styles are valid. Try both and use whichever approach works best for you.

Important

Don’t wait for the stand-up to start your day.
One problem with stand-up meetings is that they interrupt the day. This is a particular problem for morning stand-ups; because team members know the meeting will interrupt their work, they sometimes wait for the stand-up to end before starting to work. If people arrive at different times, early arrivals sometimes just waste time until the stand-up starts. You can reduce this problem by moving the stand-up to later in the day, such as just before lunch.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Coding Standards
Inhaltsvorschau
Programmers
We embrace a joint aesthetic.
Back in the days of the telegraph, as the story goes, telegraph operators could recognize each other on the basis of how they keyed their dots and dashes. Each operator had a unique style, or fist, that experts could recognize easily. Programmers have style, too. We each have our own way of producing code. We refine our style over years until we think it’s the most readable, the most compact, or the most informative it can be.
Individual style is great when you’re working alone. In team software development, however, the goal is to create a collective work that is greater than any individual could create on his own. Arguing about whose style is best gets in the way; it’s easier to work together in a single style.
XP suggests creating a coding standard: guidelines to which all developers agree to adhere when programming.
I once led a team of four programmers who had widely differing approaches to formatting. When we discussed coding standards, I catalogued three different approaches to braces and tabs. Each approach had its own vigorous defender. I didn’t want us to get bogged down in arguments, so I said that people could use whatever brace style they wanted.
The result was predictable: we had three different approaches to formatting in our code. I even saw two different ways of indenting within a single, short method.
You know what surprised me? It wasn’t that bad. Sure, the layout was ugly, and I would have preferred consistency, but the code was still readable. In the end, the rest of our coding standard mattered much more than formatting.
We all agreed that clearly named variables and short methods were important. We agreed to use assertions to make our code fail fast, not to optimize without measurements, and never to pass null references between objects. We agreed on how we should and shouldn’t handle exceptions, what to do about debugging code, and when and where to log events. These standards helped us far more than a consistent formatting style would have because each one had a concrete benefit. Perhaps that’s why we were able to agree on them when we couldn’t agree on formatting styles.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Iteration Demo
Inhaltsvorschau
Product Manager, Whole Team
We keep it real.
An XP team produces working software every week, starting with the very first week.
Sound impossible? It’s not. It’s merely difficult. It takes a lot of discipline to keep that pace. Programmers need discipline to keep the code clean so they can continue to make progress. Customers need discipline to fully understand and communicate one set of features before starting another. Testers need discipline to work on software that changes daily.
The rewards for this hard work are significantly reduced risk, a lot of energy and fun, and the satisfaction of doing great work and seeing progress. The biggest challenge is keeping your momentum.
The iteration demo is a powerful way to do so. First, it’s a concrete demonstration of the team’s progress. The team is proud to show off its work, and stakeholders are happy to see progress.

Important

Iteration demos help keep the team honest.
Second, the demos help the team be honest about its progress. Iteration demos are open to all stakeholders, and some companies even invite external customers to attend. It’s harder to succumb to the temptation to push an iteration deadline “just one day” when stakeholders expect a demo.
Finally, the demo is an opportunity to solicit regular feedback from the customers. Nothing speaks more clearly to stakeholders than working, usable software. Demonstrating your project makes it and your progress immediately visible and concrete. It gives stakeholders an opportunity to understand what they’re getting and to change direction if they need to.
Regular delivery is central to successful XP. The iteration demo is a concrete indication of that progress. When schedule problems occur (they always do), an iteration demo makes it harder to avoid reality—and facing reality gives you the opportunity to
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Reporting
Inhaltsvorschau
Coaches, Upper Management
We inspire trust in the team’s decisions.
You’re part of a whole team. Everybody sits together. An informative workspace clearly tracks your progress. All the information you need is at your fingertips. Why do you need reports?
Actually, you don’t need them. The people who aren’t on your team, particularly upper management and stakeholders, do. They have a big investment in you and the project, and they want to know how well it’s working.
Progress reports are exactly that: reports on the progress of the team, such as an iteration demo or a release plan. Although progress reports seem to exist so that stakeholders can monitor and correct the team’s direction, that’s not their purpose. Instead, good progress reports allow stakeholders to trust the team’s decisions.
Management reports are for upper management. They provide high-level information that allows management to analyze trends and set goals. It’s not information you can pick up by casually lingering in an open workspace for an hour or two every month; it includes trends in throughput or defect rates.
What kinds of reports do you need to build trust and satisfy strategic needs? It depends on the stakeholders. Some stakeholders are hands-off and just want to see progress toward a goal; others want to know more details so they can build broader knowledge. You may need to produce a variety of reports for different audiences.
Be careful, though—reports take time and energy away from development, so don’t produce every report you can imagine. Provide just enough reporting to satisfy key stakeholders. The project manager and product manager should combine their knowledge of stakeholders to gauge the proper level of reporting. The best way to know, of course, is to ask.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 7: Releasing
Inhaltsvorschau
What is the value of code? Agile developers value “working software over comprehensive documentation.” Does that mean a requirements document has no value? Does it mean unfinished code has no value?
Like a rock at the top of a hill, code has potential—potential energy for the rock and potential value for the code. It takes a push to realize that potential. The rock has to be pushed onto a slope in order to gain kinetic energy; the software has to be pushed into production in order to gain value.
It’s easy to tell how much you need to push a rock. Big rock? Big push. Little rock? Little push. Software isn’t so simple—it often looks ready to ship long before it’s actually done. It’s my experience that teams underestimate how hard it will be to push their software into production.
To make things more difficult, software’s potential value changes. If nothing ever pushes that rock, it will sit on top of its hill forever; its potential energy won’t change. Software, alas, sits on a hill that undulates. You can usually tell when your hill is becoming a valley, but if you need weeks or months to get your software rolling, it might be sitting in a ditch by the time you’re ready to push.
In order to meet commitments and take advantage of opportunities, you must be able to push your software into production within minutes. This chapter contains 6 practices that give you leverage to turn your big release push into a 10-minute tap:
  • "done done" ensures that completed work is ready to release.
  • No bugs allows you to release your software without a separate testing phase.
  • Version control allows team members to work together without stepping on each other’s toes.
  • A ten-minute build builds a tested release package in under 10 minutes.
  • Continuous integration
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
“Done Done”
Inhaltsvorschau
Whole Team
We’re done when we’re production-ready.
“Hey, Liz!” Rebecca sticks her head into Liz’s office. “Did you finish that new feature yet?”
Liz nods. “Hold on a sec,” she says, without pausing in her typing. A flurry of keystrokes crescendos and then ends with a flourish. “Done!” She swivels around to look at Rebecca. “It only took me half a day, too.”
“Wow, that’s impressive,” says Rebecca. “We figured it would take at least a day, probably two. Can I look at it now?”
“Well, not quite,” says Liz. “I haven’t integrated the new code yet.”
“OK,” Rebecca says. “But once you do that, I can look at it, right? I’m eager to show it to our new clients. They picked us precisely because of this feature. I’m going to install the new build on their test bed so they can play with it.”
Liz frowns. “Well, I wouldn’t show it to anybody. I haven’t tested it yet. And you can’t install it I haven’t updated the installer or the database schema generator.”
“I don’t understand,” Rebecca grumbles. “I thought you said you were done!”
“I am,” insists Liz. “I finished coding just as you walked in. Here, I’ll show you.”
“No, no, I don’t need to see the code,” Rebecca says. “I need to be able to show this to our customers. I need it to be finished. Really finished.”
“Well, why didn’t you say so?” says Liz. “This feature is done—it’s all coded up. It’s just not done done. Give me a few more days.”

Important

You should able to deploy the software at the end of any iteration.
Wouldn’t it be nice if, once you finished a story, you never had to come back to it? That’s the idea behind “done done.” A completed story isn’t a lump of unintegrated, untested code. It’s ready to deploy.
Partially finished stories result in hidden costs to your project. When it’s time to release, you have to complete an unpredictable amount of work. This destabilizes your release planning efforts and prevents you from meeting your commitments.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
No Bugs
Inhaltsvorschau
Whole Team
We confidently release without a dedicated testing phase.
Let’s cook up a bug pie. First, start with a nice, challenging language. How about C? We’ll season it with a dash of assembly.
Next, add extra bugs by mixing in concurrent programming. Our old friends Safety and Liveness are happy to fight each other over who provides the most bugs. They supplied the Java multithreading library with bugs for years!
Now we need a really difficult problem domain. How about real-time embedded systems?
To top off this disaster recipe, we need the right kind of programmers. Let’s see... experts... no... senior developers... no... aha! Novices! Just what we need.
Take your ingredients—C, real-time embedded systems, multitasking, and don’t forget the novices—add a little assembly for seasoning, shake well, and bake for three years. (I do love me a bug pie.)
Here’s how it turns out:
The GMS team delivered this product after three years of development [60,638 lines of code], having encountered a total of 51 defects during that time. The open bug list never had more than two items at a time. Productivity was measured at almost three times the level for comparable embedded software teams. The first field test units were delivered after approximately six months into development. After that point, the software team supported the other engineering disciplines while continuing to do software enhancements.
These folks had everything stacked against them—except their coach and her approach to software development. If they can do it, so can you.
If you’re on a team with a bug count in the hundreds, the idea of “no bugs” probably sounds ridiculous. I’ll admit: “no bugs” is an ideal to strive for, not something your team will necessarily achieve.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Version Control
Inhaltsvorschau
Programmers
We keep all our project artifacts in a single, authoritative place.
To work as a team, you need some way to coordinate your source code, tests, and other important project artifacts. A version control system provides a central repository that helps coordinate changes to files and also provides a history of changes.
A project without version control may have snippets of code scattered among developer machines, networked drives, and even removable media. The build process may involve one or more people scrambling to find the latest versions of several files, trying to put them in the right places, and only succeeding through the application of copious caffeine, pizza, and stress.

Important

A project with version control uses the version control system to mediate changes. It’s an orderly process in which developers get the latest code from the server, do their work, run all the tests to confirm their code works, then check in their changes. This process, called continuous integration, occurs several times a day for each pair.
If you aren’t familiar with the basics of version control, start learning now. Learning to use a version control system effectively may take a few days, but the benefits are so great that it is well worth the effort.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Ten-Minute Build
Inhaltsvorschau
Programmers
We eliminate build and configuration hassles.
Here’s an ideal to strive for. Imagine you’ve just hired a new programmer. On the programmer’s first day, you walk him over to the shiny new computer you just added to your open workspace.
“We’ve found that keeping everything in version control and having a really great automated build makes us a lot faster,” you say. “Here, I’ll show you. This computer is new, so it doesn’t have any of our stuff on it yet.”
You sit down together. “OK, go ahead and check out the source tree.” You walk him through the process and the source tree starts downloading. “This will take a while because we have all our build tools and libraries in version control, too. Don’t worry—like any good version control system, it brings down changes, so it’s only slow the first time. We keep tools and libraries in version control because it allows us to update them easily. Come on, let me show you around the office while it downloads.”
After giving him the tour, you come back. “Good, it’s finished,” you say. “Now watch this—this is my favorite part. Go to the root of the source tree and type build.”
The new programmer complies, then watches as build information flies by. “It’s not just building the source code,” you explain. “We have a complex application that requires a web server, multiple web services, and several databases. In the past, when we hired a new programmer, he would spend his first couple of weeks just configuring his workstation. Test environments were even worse. We used to idle the whole team for days while we wrestled with problems in the test environment. Even when the environment worked, we all had to share one environment and we couldn’t run tests at the same time.
“All that has changed. We’ve automated all of our setup. Anybody can build and run all the tests on their own machine, any time they want. I could even disconnect from the network right now and it would keep building. The build script is doing everything: it’s configuring a local web server, initializing a local database... everything.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Continuous Integration
Inhaltsvorschau
Programmers
We keep our code ready to ship.
Most software development efforts have a hidden delay between when the team says “we’re done” and when the software is actually ready to ship. Sometimes that delay can stretch on for months. It’s the little things: merging everyone’s pieces together, creating an installer, prepopulating the database, building the manual, and so forth. Meanwhile, the team gets stressed out because they forgot how long these things take. They rush, leave out helpful build automation, and introduce more bugs and delays.

Important

The ultimate goal is to be able to deploy at any time.
Continuous integration is a better approach. It keeps everybody’s code integrated and builds release infrastructure along with the rest of the application. The ultimate goal of continuous integration is to be able to deploy all but the last few hours of work at any time.
Practically speaking, you won’t actually release software in the middle of an iteration. Stories will be half-done and features will be incomplete. The point is to be technologically ready to release even if you’re not functionally ready to release.
If you’ve ever experienced a painful multiday (or multiweek) integration, integrating every few hours probably seems foolish. Why go through that hell so often?
Actually, short cycles make integration less painful. Shorter cycles lead to smaller changes, which means there are fewer chances for your changes to overlap with someone else’s.
That’s not to say collisions don’t happen. They do. They’re just not very frequent because everybody’s changes are so small.
Collisions are most likely when you’re making wide-ranging changes. When you do, let the rest of the team know beforehand so they can integrate their changes and be ready to deal with yours.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Collective Code Ownership
Inhaltsvorschau
Programmers
We are all responsible for high-quality code.
There’s a metric for the risk imposed by concentrating knowledge in just a few people’s heads—it’s called the truck number. How many people can get hit by a truck before the project suffers irreparable harm?
It’s a grim thought, but it addresses a real risk. What happens when a critical person goes on holiday, stays home with a sick child, takes a new job, or suddenly retires? How much time will you spend training a replacement?
Collective code ownership spreads responsibility for maintaining the code to all the programmers. Collective code ownership is exactly what it sounds like: everyone shares reponsibility for the quality of the code. No single person claims ownership over any part of the system, and anyone can make any necessary changes anywhere.

Important

Fix problems no matter where you find them.
In fact, improved code quality may be the most important part of collective code ownership. Collective ownership allows—no, expects—everyone to fix problems they find. If you encounter duplication, unclear names, or even poorly designed code, it doesn’t matter who wrote it. It’s your code. Fix it!
Collective code ownership requires letting go of a little bit of ego. Rather than taking pride in your code, take pride in your team’s code. Rather than complaining when someone edits your code, enjoy how the code improves when you’re not working on it. Rather than pushing your personal design vision, discuss design possibilities with the other programmers and agree on a shared solution.

Important

Always leave the code a little better than you found it.
Collective ownership requires a joint commitment from team members to produce good code. When you see a problem, fix it. When writing new code, don’t do a half-hearted job and assume somebody else will fix your mistakes. Write the best code you can.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Documentation
Inhaltsvorschau
Whole Team
We communicate necessary information effectively.
The word documentation is full of meaning. It can mean written instructions for end-users, or detailed specifications, or an explanation of APIs and their use. Still, these are all forms of communication—that’s the commonality.
Communication happens all the time in a project. Sometimes it helps you get your work done; you ask a specific question, get a specific answer, and use that to solve a specific problem. This is the purpose of work-in-progress documentation, such as requirements documents and design documents.
Other communication provides business value, as with product documentation, such as user manuals and API documentation. A third type—handoff documentation—supports the long-term viability of the project by ensuring that important information is communicated to future workers.
In XP, the whole team sits together to promote the first type of communication. Close contact with domain experts and the use of ubiquitous language create a powerful oral tradition that transmits information when necessary. There’s no substitute for face-to-face communication. Even a phone call loses important nuances in conversation.
XP teams also use test-driven development to create a comprehensive test suite. When done well, this captures and communicates details about implementation decisions as unambiguous, executable design specifications that are readable, runnable, and modifiable by other developers. Similarly, the team uses customer testing to communicate information about hard-to-understand domain details. A ubiquitous language helps further reveal the intent and purpose of the code.
The team does document some things, such as the vision statement and story cards, but these act more as reminders than as formal documentation. At any time, the team can and should jot down notes that help them do their work, such as design sketches on a whiteboard, details on a story card, or hard-to-remember requirements in a wiki or spreadsheet.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 8: Planning
Inhaltsvorschau
Today I talked to a friend who wanted to know how I organized software projects. His team has grown rapidly, and their attempts to create and manage detailed plans are spiraling out of control. “It just doesn’t scale,” he sighed.
The larger your project becomes, the harder it is to plan everything in advance. The more chaotic your environment, the more likely it is that your plans will be thrown off by some unexpected event. Yet in this chaos lies opportunity.
Rather than trying to plan for every eventuality, embrace the possibilities that change brings you. This attitude is very different from facing change with clenched jaws and white knuckles. In this state of mind, we welcome surprise. We marvel at the power we have to identify and take advantage of new opportunities. The open horizon stretches before us. We know in which direction we need to travel, and we have the flexibility in our plan to choose the best way to get there. We’ll know it when we find it.
This approach may sound like it’s out of control. It would be, except for eight practices that allow you to control the chaos of endless possibility:
  • Vision reveals where the project is going and why it’s going there.
  • Release Planning provides a roadmap for reaching your destination.
  • The Planning Game combines the expertise of the whole team to create achievable plans.
  • Risk Management allows the team to make and meet long-term commitments.
  • Iteration Planning provides structure to the team’s daily activities.
  • Slack allows the team to reliably deliver results every iteration.
  • Stories form the line items in the team’s plan.
  • Estimating enables the team to predict how long its work will take.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Vision
Inhaltsvorschau
Product Manager, Customers
We know why our work is important and how we’ll
be successful.
Vision. If there’s a more derided word in the corporate vocabulary, I don’t know what it is. This word brings to mind bland corporate-speak: “Our vision is to serve customers while maximizing stakeholder value and upholding the family values of our employees.” Bleh. Content-free baloney.
Don’t worry—that’s not what you’re going to do.
Before a project is a project, someone in the company has an idea. Suppose it’s someone in the Wizzle-Frobitz company. “Hey!” he says, sitting bolt upright in bed. “We could frobitz the wizzles so much better if we had some software that sorted the wizzles first!”
Maybe it’s not quite that dramatic. The point is, projects start out as ideas focused on results. Sell more hardware by bundling better software. Attract bigger customers by scaling more effectively. Open up a new market by offering a new service. The idea is so compelling that it gets funding, and the project begins.
Somewhere in the transition from idea to project, the compelling part—the vision of a better future—often gets lost. Details crowd it out. You have to hire programmers, domain experts, and interaction designers. You must create stories, schedule iterations, and report on progress. Hustle, people, hustle!
That’s a shame, because nothing matters more than delivering the vision. The goal of the entire project is to frobitz wizzles better. If the details are perfect (the wizzles are sorted with elegance and precision) but the vision is forgotten (the wizzle sorter doesn’t work with the frobitzer), then the software will probably fail. Conversely, if you ship something that helps frobitz wizzles better than anything else, does it really matter
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Release Planning
Inhaltsvorschau
Product Manager, Customers
We plan for success.
Imagine you’ve been freed from the shackles of deadlines. “Maximize our return on investment,” your boss says. “We’ve already talked about the vision for this project. I’m counting on you to work out the details. Create your own plans and set your own release dates—just make sure we get a good return on our investment.”
Now what?
First, work on only one project at a time. Many teams work on several projects simultaneously, which is a mistake. Task-switching has a substantial cost: “[T]he minimum penalty is 15 percent... Fragmented knowledge workers may look busy, but a lot of their busyness is just thrashing” . Working on one project at a time allows you to release each project as you complete it, which increasees the total value of your work.
Consider a team that has two projects. In this simplified example, each project has equal value; when complete, each project will yield $$ in value every month. Each project takes three months to complete.
Although I’m describing value in dollar signs, money isn’t the only source of value. Value can be intangible as well.
In Scenario A (see ), the team works on both projects simultaneously. To avoid task-switching penalties, they switch between projects every month. They finish Project 1 after five months and Project 2 after six. At the end of the seventh month, the team has earned $$$$$$.
In Scenario B, the team works on just one project at a time. They release Project 1 at the end of the third month. It starts making money while they work on Project 2, which they complete after the sixth month, as before. Although the team’s productivity didn’t change—the projects still took six months—they earned more money from Project 1. By the end of the seventh month, they earned $$$$$$$$$$. That’s nearly twice as much value with no additional effort.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
The Planning Game
Inhaltsvorschau
Whole Team
Our plans take advantage of both business and technology expertise.
You may know when and what to release, but how do you actually construct your release plan? That’s where the planning game comes in.
In economics, a game is something in which “players select actions and the payoffs depend on the actions of all players.” The study of these games “deals with strategies for maximizing gains and minimizing losses... [and are] widely applied in the solution of various decision making problems.”
That describes the planning game perfectly. It’s a structured approach to creating the best possible plan given the information available.
The planning game is most notable for the way it maximizes the amount of information contributed to the plan. It is strikingly effective. Although it has limitations, if you work within them, I know of no better way to plan.
XP assumes that customers have the most information about value: what best serves the organization. Programmers have the most information about costs: what it will take to implement and maintain those features. To be successful, the team needs to maximize value while minimizing costs. A successful plan needs to take into account information from both groups, as every decision to do something is also a decision not to do something else.
Accordingly, the planning game requires the participation of both customers and programmers. (Testers may assist, but they do not have an explicit role in the planning game.) It’s a cooperative game; the team as a whole wins or loses, not individual players.
Because programmers have the most information about costs—they’re most qualified to say how long it will take to implement a story—they estimate.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Risk Management
Inhaltsvorschau
Project Manager, Whole Team
We make and meet long term commitments.
The following statement is nearly true:
Our team delivers a predictable amount of work every iteration. Because we had a velocity of 14 story points last week, we’ll deliver 14 story points this week, and next week, and the next. By combining our velocity with our release plan, we can commit to a specific release schedule!
Good XP teams do achieve a stable velocity. Unfortunately, velocity only reflects the issues the team normally faces. Life always has some curve balls to throw. Team members get sick and take vacations; hard drives crash, and although the backups worked, the restore doesn’t; stakeholders suddenly realize that the software you’ve been showing them for the last two months needs some major tweaks before it’s ready to use.
Despite these uncertainties, your stakeholders need schedule commitments that they can rely upon. Risk management allows you to make and meet these commitments.
Every project faces a set of common risks: turnover, new requirements, work disruption, and so forth. These risks act as a multiplier on your estimates, doubling or tripling the amount of time it takes to finish your work.
How much of a multiplier do these risks entail? It depends on your organization. In a perfect world, your organization would have a database of the type shown in . It would show the chance of completing before various risk multipliers.
Figure : An example of historical project data
Because most organizations don’t have this information available, I’ve provided some generic risk multipliers instead. (See .) These multipliers show your chances of meeting various schedules. For example, in a “Risky” approach, you have a 10 percent chance of finishing according to your estimated schedule. Doubling your estimates gives you a 50 percent chance of on-time completion, and to be virtually certain of meeting your schedule, you have to quadruple your estimates.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Iteration Planning
Inhaltsvorschau
Whole Team
We stop at predetermined, unchangeable time intervals and compare reality to plan.

Important

Iterations are the heartbeat of an XP project. When an iteration starts, stories flow in to the team as they select the most valuable stories from the release plan. Over the course of the iteration, the team breathes those stories to life. By the end of the iteration, they’ve pumped out working, tested software for each story and are ready to begin the cycle again.
Iterations are an important safety mechanism. Every week, the team stops, looks at what it’s accomplished, and shares those accomplishments with stakeholders. By doing so, the team coordinates its activities and communicates its progress to the rest of the organization. Most importantly, iterations counter a common risk in software projects: the tendency for work to take longer than expected.
Programming schedules die in inches. At first you’re on schedule: “I’ll be done once I finish this test.” Then you’re limping: “I’ll be done as soon as I fix this bug.” Then gasping: “I’ll be done as soon as I research this API flaw... no, really.” Before you know it, two days have gone by and your task has taken twice as long as you estimated.
Death by inches sneaks up on a team. Each delay is only a few hours, so it doesn’t feel like a delay, but they multiply across the thousands of tasks in a project. The cumulative effects are devastating.
Iterations allow you to avoid this surprise. Iterations are exactly one week long and have a strictly defined completion time. This is a timebox: work ends at a particular time regardless of how much you’ve finished. Although the iteration timebox doesn’t
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Slack
Inhaltsvorschau
Programmers, Coaches
We deliver on our iteration commitments.

Important

Imagine that the power cable for your workstation is just barely long enough to reach the wall receptacle. You can plug it in if you stretch it taut, but the slightest vibration will cause the plug to pop out of the wall and the power to go off. You’ll lose everything you were working on.
I can’t afford to have my computer losing power at the slightest provocation. My work’s too important for that. In this situation, I would move the computer closer to the outlet so that it could handle some minor bumps. (Then I would tape the cord to the floor so people couldn’t trip over it, install an uninterruptable power supply, and invest in a continuous backup server.)
Your project plans are also too important to be disrupted by the slightest provocation. Like the power cord, they need slack.
The amount of slack you need doesn’t depend on the number of problems you face. It depends on the randomness of problems. If you always experience exactly 20 hours of problems in each iteration, your velocity will automatically compensate. However, if you experience between 20 and 30 hours of problems in each iteration, your velocity will bounce up and down. You need 10 hours of slack to stabilize your velocity and to ensure that you’ll meet your commitments.
These numbers are just for illustration. Instead of measuring the number of hours you spend on problems, take advantage of velocity’s feedback loop (see ” later in this chapter for more about velocity). If your velocity bounces around a lot, stop signing up for more stories than your velocity allows. This will cause your velocity to settle at a lower number that incorporates enough slack for your team. On the other hand, if your velocity is rock solid, try reducing slack by committing to a small extra story next iteration.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Stories
Inhaltsvorschau
Whole Team
We plan our work in small, customer-centric pieces.
Stories may be the most misunderstood entity in all of XP. They’re not requirements. They’re not use cases. They’re not even narratives. They’re much simpler than that.

Important

Stories are for planning. They’re simple one- or two-line descriptions of work the team should produce. Alistair Cockburn calls them “promissory notes for future conversation.” Everything that stakeholders want the team to produce should have a story, for example:
  • “Warehouse inventory report”
  • “Full-screen demo option for job fair”
  • “TPS report for upcoming investor dog-and-pony show”
  • “Customizable corporate branding on user login screen”

Important

This isn’t enough detail for the team to implement and release working software, nor is that the intent of stories. A story is a placeholder for a detailed discussion about requirements. Customers are responsible for having the requirements details available when the rest of the team needs them.
Although stories are short, they still have two important characteristics:
  1. Stories represent customer value and are written in the customers’ terminology. (The best stories are actually written by customers.) They describe an end-result that the customer values, not implementation details.
  2. Stories have clear completion criteria. Customers can describe an objective test that would allow programmers to tell when they’ve successfully implemented the story.
The following examples are
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Estimating
Inhaltsvorschau
Programmers
We provide reliable estimates.
Programmers often consider estimating to be a black art—one of the most difficult things they must do. Many programmers find that they consistently estimate too low. To counter this problem, they pad their estimates (multiplying by three is a common approach), but sometimes even these rough guesses are too low.
Are good estimates possible? Of course! You just need to focus on your strengths.
One reason estimating is so difficult is that programmers can rarely predict how they will spend their time. A task that requires eight hours of uninterrupted concentration can take two or three days if the programmer must deal with constant interruptions. It can take even longer if the programmer works on another task at the same time.

Important

Estimate in ideal time.
Part of the secret to making good estimates is to predict the effort, not the calendar time, that a project will take. Make your estimates in terms of ideal engineering days (often called story points), which are the number of days a task would take if you focused on it entirely and experienced no interruptions.
Using ideal time alone won’t lead to accurate estimates. I’ve asked some teams I’ve worked with to measure exactly how long each task takes them (one team gave me 18 months of data), and even though we estimated in ideal time, the estimates were never accurate.
Still, they were consistent. For example, one team always estimated their stories at about 60 percent of the time they actually needed. This may not sound very promising. How useful can inaccurate estimates be, especially if they don’t correlate to calendar time? Velocity holds the key.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 9: Developing
Inhaltsvorschau
Imagine you’ve given up the world of software to become a master chef. After years of study and practice, you’ve reached the top of your profession. One day you receive the ultimate invitation: to cook for 500 attendees at a $10,000-a-plate fundraiser.
A limo takes you from your chartered plane to the venue, and you and your cooks walk confidently into a kitchen... only to stop in shock. The kitchen is a mess: rotting food, unwashed cooking implements, standing water in the sinks. It’s the morning of the event. You have 12 hours.
What do you do? You roll up your sleeves and start cleaning. As soon as the first space is clear, a few cooks begin the longest and most complicated food preparation. Others head to the market to get fresh ingredients. The rest keep cleaning. Working around the mess will take too long.
It’s a lesson you’ve learned from software over and over again.
Software development requires the cooperation of everyone on the team. Programmers are often called “developers,” but in reality everyone on the team is part of the development effort. When you share the work, customers identify the next requirements while programmers work on the current ones. Testers help the team figure out how to stop introducing bugs. Programmers spread the cost of technical infrastructure over the entire life of the project. Above all, everyone helps keep everything clean.
The best way I know to reduce the cost of writing software is to improve the internal quality of its code and design. I’ve never seen high quality on a well-managed project fail to repay its investment. It always reduces the cost of development in the short term as well as in the long term. On a successful XP project, there’s an amazing feeling—the feeling of being absolutely safe to change absolutely anything without worry.
Here are nine practices that keep the code clean and allow the entire team to contribute to development:
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Incremental Requirements
Inhaltsvorschau
Customers
We define requirements in parallel with other work.
A team using an up-front requirements phase keeps their requirements in a requirements document. An XP team doesn’t have a requirements phase and story cards aren’t miniature requirements documents, so where do requirements come from?

Important

In XP, the on-site customers sit with the team. They’re expected to have all the information about requirements at their fingertips. When somebody needs to know something about the requirements for the project, she asks one of the on-site customers rather than looking in a document.
Face-to-face communication is much more effective than written communication, as discusses, and it allows XP to save time by eliminating a long requirements analysis phase. However, requirements work is still necessary. The on-site customers need to understand the requirements for the software before they can explain it.

Important

The key to successful requirements analysis in XP is expert customers. Involve real customers, an experienced product manager, and experts in your problem domain (see ” in and ” in ). Many of the requirements for your software will be intuitively obvious to the right customers.
If you have trouble with requirements, your team may not include the right customers.
Some requirements will necessitate even expert customers to consider a variety of options or do some research before making a decision. Customers, you can and should include other team members in your discussions if it helps clarify your options. For example, you may wish to include a programmer in your discussion of user interface options so you can strike a balance between an impressive UI and low implementation cost.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Customer Tests
Inhaltsvorschau
Whole Team
We implement tricky domain concepts correctly.

Important

Customers have specialized expertise, or domain knowledge, that programmers don’t have. Some areas of the application—what programmers call domain rules—require this expertise. You need to make sure that the programmers understand the domain rules well enough to code them properly in the application. Customer tests help customers communicate their expertise.

Important

Don’t worry; this isn’t as complicated as it sounds. Customer tests are really just examples. Your programmers turn them into automated tests, which they then use to check that they’ve implemented the domain rules correctly. Once the tests are passing, the programmers will include them in their 10-minute build, which will inform the programmers if they ever do anything to break the tests.
To create customer tests, follow the Describe, Demonstrate, Develop processes outlined in the next section. Use this process during the iteration in which you develop the corresponding stories.

Important

Customer tests are for communication.
At the beginning of the iteration, look at your stories and decide whether there are any aspects that programmers might misunderstand. You don’t need to provide examples for everything. Customer tests are for communication, not for proving that the software works. (See ” in .)
For example, if one of your stories is “Allow invoice deleting,” you don’t need to explain how invoices are deleted. Programmers understand what it means to delete something. However, you might need examples that show when it’s OK to delete an invoice, especially if there are complicated rules to ensure that invoices aren’t deleted inappropriately.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Test-Driven Development
Inhaltsvorschau
Programmers
We produce well-designed, well-tested, and well-factored code in small, verifiable steps.
“What programming languages really need is a ‘DWIM’ instruction,” the joke goes. “Do what I mean, not what I say.”
Programming is demanding. It requires perfection, consistently, for months and years of effort. At best, mistakes lead to code that won’t compile. At worst, they lead to bugs that lie in wait and pounce at the moment that does the most damage.
People aren’t so good at perfection. No wonder, then, that software is buggy.
Wouldn’t it be cool if there were a tool that alerted you to programming mistakes moments after you made them—a tool so powerful that it virtually eliminated the need for debugging?
There is such a tool, or rather, a technique. It’s test-driven development, and it actually delivers these results.
Test-driven development, or TDD, is a rapid cycle of testing, coding, and refactoring. When adding a feature, a pair may perform dozens of these cycles, implementing and refining the software in baby steps until there is nothing left to add and nothing left to take away. Research shows that TDD substantially reduces the incidence of defects . When used properly, it also helps improve your design, documents your public interfaces, and guards against future mistakes.
TDD isn’t perfect, of course. (Is anything?) TDD is difficult to use on legacy codebases. Even with greenfield systems, it takes a few months of steady use to overcome the learning curve. Try it although TDD benefits from other XP practices, it doesn’t require them. You can use it on almost any project.
Back in the days of punch cards, programmers laboriously hand-checked their code to make sure it would compile. A compile error could lead to failed batch jobs and intense debugging sessions to look for the misplaced character.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Refactoring
Inhaltsvorschau
Programmers
Every day, our code is slightly better than it was the day before.
Entropy always wins. Eventually, chaos turns your beautifully imagined and well-designed code into a big mess of spaghetti.
At least, that’s the way it used to be, before refactoring. Refactoring is the process of changing the design of your code without changing its behavior—what it does stays the same, but how it does it changes. Refactorings are also reversible; sometimes one form is better than another for certain cases. Just as you can change the expression x2 - 1 to (x + 1)(x - 1) and back, you can change the design of your code—and once you can do that, you can keep entropy at bay.
Refactoring enables an approach to design I call reflective design. In addition to creating a design and coding it, you can now analyze the design of existing code and improve it. One of the best ways to identify improvements is with code smells: condensed nuggets of wisdom that help you identify common problems in design.
A code smell doesn’t necessarily mean there’s a problem with the design. It’s like a funky smell in the kitchen: it could indicate that it’s time to take out the garbage, or it could just mean that Uncle Gabriel is cooking with a particularly pungent cheese. Either way, when you smell something funny, take a closer look.
, writing with Kent Beck, has an excellent discussion of code smells. It’s well worth reading. Here are a summary of the smells I find most often, including some that Fowler and Beck didn’t mention.

Divergent Change and Shotgun Surgery

These two smells help you identify cohesion problems in your code. Divergent Change occurs when unrelated changes affect the same class. It’s an indication that your class involves too many concepts. Split it, and give each concept its own home.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Simple Design
Inhaltsvorschau
Programmers
Our design is easy to modify and maintain.
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. —Antoine de Saint-Exupéry, author of The Little Prince
Any intelligent fool can make things bigger, more complex and more violent. It takes a touch of genius and a lot of courage to move in the opposite direction. —Albert Einstein
When writing code, agile developers often stop to ask themselves, “What is the simplest thing that could possibly work?” They seem to be obssessed with simplicity. Rather than anticipating changes and providing extensibility hooks and plug-in points, they create a simple design that anticipates as little as possible, as cleanly as possible. Unintuitively, this results in designs that are ready for any change, anticipated or not.
This may seem silly. How can a design be ready for any change? Isn’t the job of a good designer or architect to anticipate future changes and make sure the design can be extended to support them? Doesn’t Design Patterns: Elements of Reusable Software say that the key to maximizing reuse is to anticipate changes and design accordingly?
I’ll let Erich Gamma, coauthor of Design Patterns, answer these questions. In the following excerpt, Gamma is interviewed by Bill Venners.
Venners: The GoF book [Design Patterns] says, “The key to maximizing reuse lies in anticipating new requirements and changes to existing requirements, and in designing your systems so they can evolve accordingly. To design a system so that it’s robust to such changes, you must consider how the system might need to change over its lifetime. A design that doesn’t take change into account risks major redesign in the future.” That seems contradictory to the XP philosophy.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Incremental Design and Architecture
Inhaltsvorschau
Programmers
We deliver stories every week without compromising design quality.

Important

XP makes challenging demands of its programmers: every week, programmers should finish 4 to 10 customer-valued stories. Every week, customers may revise the current plan and introduce entirely new stories—with no advance notice. This regimen starts with the first week of the project.
In other words, as a programmer you must be able to produce customer value, from scratch, in a single week. No advance preparation is possible. You can’t set aside several weeks for building a domain model or persistence framework; your customers need you to deliver completed stories.
Fortunately, XP provides a solution for this dilemma: incremental design (also called evolutionary design) allows you to build technical infrastructure (such as domain models and persistence frameworks) incrementally, in small pieces, as you deliver stories.

Important

Incremental design applies the concepts introduced in test-driven development to all levels of design. Like test-driven development, programmers work in small steps, proving each before moving to the next. This takes place in three parts: start by creating the simplest design that could possibly work, incrementally add to it as the needs of the software evolve, and continuously improve the design by reflecting on its strengths and weaknesses.

Important

To be specific, when you first create a design element—whether it’s a new method, a new class, or a new architecture—be completely specific. Create a simple design that solves only the problem you face at the moment, no matter how easy it may seem to solve more general problems.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Spike Solutions
Inhaltsvorschau
Programmers
We perform small, isolated experiments when we
need more information.
You’ve probably noticed by now that XP values concrete data over speculation. Whenever you’re faced with a question, don’t speculate about the answer—conduct an experiment! Figure out how you can use real data to make progress.
That’s what spike solutions are for, too.
A spike solution, or spike, is a technical investigation. It’s a small experiment to research the answer to a problem. For example, a programmer might not know whether Java throws an exception on arithmetic overflow. A quick 10-minute spike will answer the question:
  public class ArithmeticOverflowSpike {

      public static void main(String[] args) {

          try {

              int a = Integer.MAX_VALUE + 1;

              System.out.println("No exception: a = " + a);

          }

          catch (Throwable e) {

              System.out.println("Exception: " + e);

          }

      }

  }



  No exception: a = -2147483648
Although this example is written as a standalone program, small spikes such as this one can also be written inside your test framework. Although they don’t actually call your production code, the test framework provides a convenient way to quickly run the spike and report on the results.
The best way to implement a spike is usually to create a small program or test that demonstrates the feature in question. You can read as many books and tutorials as you like, but it’s my experience that nothing helps me understand a problem more than writing working code. It’s important to work from a practical point of view, not just a theoretical one.
Writing code, however, often takes longer than reading a tutorial. Reduce that time by writing small, standalone programs. You can ignore the complexities necessary to write production code—just focus on getting something working. Run from the command line or your test framework. Hardcode values. Ignore user input, unless absolutely necessary. I often end up with programs a few dozen lines long that run almost everything from
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Performance Optimization
Inhaltsvorschau
Programmers, Testers
We optimize when there’s a proven need.
Our organization had a problem. Every transaction our software processed had a three-second latency. During peak business hours, transactions piled up—and with our recent surge in sales, the lag sometimes became hours. We cringed every time the phone rang; our customers were upset.
We knew what the problem was: we had recently changed our order preprocessing code. I remember thinking at the time that we might need to start caching the intermediate results of expensive database queries. I had even asked our customers to schedule a performance story. Other stories had been more important, but now performance was top priority.
I checked out the latest code and built it. All tests passed, as usual. Carlann suggested that we create an end-to-end performance test to demonstrate the problem. We created a test that placed 100 simultaneous orders, then ran it under our profiler.
The numbers confirmed my fears: the average transaction took around 3.2 seconds, with a standard deviation too small to be significant. The program spent nearly all that time within a single method: verify_order_id(). We started our investigation there.
I was pretty sure a cache was the right answer, but the profiler pointed to another possibility. The method retrieved a list of active order IDs on every invocation, regardless of the validity of the provided ID. Carlann suggested discounting obviously flawed IDs before testing potentially valid ones, so I made the change and we reran the tests. All passed. Unfortunately, that had no effect on the profile. We rolled back the change.
Next, we agreed to implement the cache. Carlann coded a naïve cache. I started to worry about cache coherency, so I added a test to see what happened when a cached order went active. The test failed. Carlann fixed the bug in the cache code, and all tests passed again.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Exploratory Testing
Inhaltsvorschau
Testers
By Elisabeth Hendrickson
We discover surprises and untested conditions.

Important

XP teams have no separate QA department. There’s no independent group of people responsible for assessing and ensuring the quality of the final release. Instead, the whole team—customers, programmers, and testers—is responsible for the outcome. On traditional teams, the QA group is often rewarded for finding bugs. On XP teams, there’s no incentive program for finding or removing bugs. The goal in XP isn’t to find and remove bugs; the goal is not to write bugs in the first place. In a well-functioning team, bugs are a rarity—only a handful per month.
Does that mean testers have no place on an XP team? No! Good testers have the ability to look at software from a new perspective, to find surprises, gaps, and holes. It takes time for the team to learn which mistakes to avoid. By providing essential information about what the team overlooks, testers enable the team to improve their work habits and achieve their goal of producing zero bugs.
Beware of misinterpreting the testers’ role as one of process improvement and enforcement. Don’t set up quality gates or monitor adherence to the process. The whole team is responsible for process improvement. Testers are respected peers in this process, providing information that allows the whole team to benefit.
One particularly effective way of finding surprises, gaps, and holes is exploratory testing: a style of testing in which you learn about the software while simultaneously designing and executing tests, using feedback from the previous test to inform the next. Exploratory testing enables you to discover emergent behavior, unexpected side effects, holes in the implementation (and thus in the automated test coverage), and risks related to quality attributes that cross story boundaries such as security, performance, and reliability. It’s the perfect complement to XP’s raft of automated testing techniques.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 10: Values and Principles
Inhaltsvorschau
Until now, I’ve talked about a very specific approach to agility: one style of applying XP’s practices. That’s only the beginning.
No process is perfect. Every approach to development has some potential for improvement. Ultimately, your goal is to remove every barrier between your team and the success of your project, and fluidly adapt your approach as conditions change. That is agility.
To master the art of agile development, you need experience and mindfulness. Experience helps you see how agile methods work. Mindfulness helps you understand your experiences. Experience again allows you to experiment with changes. Mindfulness again allows you to reflect on why your experiments worked—or didn’t work—in practice. Experience and mindfulness, endlessly joined, are the path to mastery.
So far, this book has focused on experience. Before you can reflect on how agile methods work, you need to experience an agile method working. With its emphasis on practicing XP, this book has given you the tools to do so.
Yet practicing XP isn’t enough—you need mindfulness, too. You must pay attention to what happens around you. You must think about what’s happening and, more importantly, why it’s happening. Ask questions. Make small changes. Observe the results. I can’t teach you mindfulness; only you have the power to do it.
I can, however, give you some things to think about as you learn. The XP practices are a manifestation of deeper agile values and principles. Think about these as you use XP. When your situation changes, use the values and principles to guide you in changing your practices.
Can any set of principles really represent agile development? After all, agility is just an umbrella term for a variety of methods, most of which came about long before the term “agile” was coined.
The answer is yes: agile methods do share common values and principles. In researching this part of the book, I collected over a hundred different values and principles from several agile sources. They formed five themes: Improve the Process, Rely on People, Eliminate Waste, Deliver Value, and Seek Technical Excellence. Each is compatible with any of the specific agile methods.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Commonalities
Inhaltsvorschau
Can any set of principles really represent agile development? After all, agility is just an umbrella term for a variety of methods, most of which came about long before the term “agile” was coined.
The answer is yes: agile methods do share common values and principles. In researching this part of the book, I collected over a hundred different values and principles from several agile sources. They formed five themes: Improve the Process, Rely on People, Eliminate Waste, Deliver Value, and Seek Technical Excellence. Each is compatible with any of the specific agile methods.
The following chapters explain these themes in terms of principles and practices. Each chapter includes anecdotes about applying the principles to situations beyond standard XP. Where possible, I’ve borrowed existing names for specific principles.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
About Values, Principles, and Practices
Inhaltsvorschau
Values are ideals. They’re abstract, yet identifiable and distinct. For example, XP’s values are:
Courage
To make the right decisions, even when they’re difficult, and to tell stakeholders the truth when they need to hear it
Communication
To give the right people the right information when they can use it to its maximum advantage
Simplicity
To discard the things we want but don’t actually need
Feedback
To learn the appropriate lessons at every possible opportunity
Respect
To treat ourselves and others with dignity, and to acknowledge expertise and our mutual desire for success
Principles are applications of those ideals to an industry. For example, the value of simplicity leads us to focus on the essentials of development. As puts it, this principle is to “travel light.” says, “Excess methodology weight is costly,” and “Discipline, skills, and understanding counter process, formality, and documentation.”
Practices are principles applied to a specific type of project. XP’s practices, for example, call for colocated teams of up to 20 people. ” in and ” in embody the principles of simplicity because face-to-face communication reduces the need for formal requirements documentation.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Further Reading
Inhaltsvorschau
The following books are excellent resources that go into far more detail than I have room for here. Each has a different focus, so they complement each other nicely.
Agile Software Development focuses on the “individuals and interactions” aspect of agile development. Most of his thoughts correspond to the principles I outline in .
Lean Software Development: An Agile Toolkit for Software Development Managers applies concepts from Lean Manufacturing to agile development, with emphasis on the principles that I describe in and .
Agile Management for Software Engineering is a bit dense, but it has detailed coverage of the Theory of Constraints, which I discuss in ” in .
Practices of an Agile Developer is an easy-to-read collection of guidelines and advice for agile developers, similar to what I discuss in .
Agile Software Development Ecosystems looks at several agile methods through the lens of people and principles. Read this if you want to understand agile development in depth.
Extreme Programming Explained , discusses the thought process behind XP. It will give you more insight into how agile principles relate to the XP practices. Try to get both editions, if you can; they describe the same basic process from very different perspectives. Studying both books and looking for the underlying commonalities will teach you a lot about agile values and principles.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 11: Improve the Process
Inhaltsvorschau
Agile methods are more than a list of practices to follow. When your team has learned how to perform them effectively, you can become a great team by using the practices to modify your process.
Throughout this book, I’ve drawn attention to places where the way you perform XP may vary from how I explain it. No two teams are exactly alike. You’ll do some things differently because you have different people and different needs. As you master the art of agile development, you’ll learn how and when to modify your process to take advantage of your specific situation and opportunities.
To improve your process, you must understand how it affects your project. You need to take advantage of feedback—from the code, from the team, from customers and stakeholders—so you can understand what works well and what doesn’t. Always pay attention to what’s happening around you. Ask “why”: why do we follow this practice? Why is this practice working? Why isn’t this practice working?
Ask team members for their thoughts. There’s an element of truth in every complaint, so encourage open discussion. As a team, reflect on what you’ve learned. When you discover something new, be a mentor; when you have questions, ask a mentor. Help each other understand what you’re doing and why.
XP is full of feedback loops—giant conduits of information that you should use to improve your work. Root-cause analysis and retrospectives clearly improve the team’s understanding, and other practices reinforce the principles in more subtle ways.
For example, sitting and working together as a whole team gives team members opportunities to observe and absorb information. This is tactical feedback, and it can reveal strategic issues when something unexpected happens. Stand-up meetings and the informative workspace contribute to an information-rich environment.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Understand Your Project
Inhaltsvorschau
To improve your process, you must understand how it affects your project. You need to take advantage of feedback—from the code, from the team, from customers and stakeholders—so you can understand what works well and what doesn’t. Always pay attention to what’s happening around you. Ask “why”: why do we follow this practice? Why is this practice working? Why isn’t this practice working?
Ask team members for their thoughts. There’s an element of truth in every complaint, so encourage open discussion. As a team, reflect on what you’ve learned. When you discover something new, be a mentor; when you have questions, ask a mentor. Help each other understand what you’re doing and why.
XP is full of feedback loops—giant conduits of information that you should use to improve your work. Root-cause analysis and retrospectives clearly improve the team’s understanding, and other practices reinforce the principles in more subtle ways.
For example, sitting and working together as a whole team gives team members opportunities to observe and absorb information. This is tactical feedback, and it can reveal strategic issues when something unexpected happens. Stand-up meetings and the informative workspace contribute to an information-rich environment.
Perhaps counterintuitively, the practices of energized work, slack, and pair programming also spread useful information. When team members are under pressure, they have trouble thinking about ways they can improve their work. Energized work and slack reduce that pressure. Pair programming gives one person in each pair time to think about strategy.
Test-driven development, exploratory testing, real customer involvement, iteration demos, and frequent releases all provide information about the project, from code to user response.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Tune and Adapt
Inhaltsvorschau
When you see the need for a change, modify your process. Make the change for your team alone; though your team may be one of many, it’s OK to do things differently. Every team’s needs are different.
These changes require tuning. Think of them as experiments; make small, isolated changes that allow you to understand the results. Be specific about your expectations and about the measurements for judging success. These changes are sources of feedback and learning. Use the results of your experiments to make further changes. Iterate until you’re satisfied with the results.
Some experiments will fail, and others may actually make the process worse. Team members need to be flexible and adaptive. Your team needs to have the courage to experiment and occasionally fail.
Changing your process requires you to have a holistic view of what you do and why. New agile teams should be cautious about changing their process, as they don’t yet have the experience necessary to give them that holistic understanding. Once you have the experience, use the feedback from your changes to improve your process and your understanding of agility.
Tuning and adapting is implicit in XP; teams are supposed to make changes whenever they have a reason to do so. Many XP teams use retrospectives to give themselves a more explicit venue for considering changes. I’ve made retrospectives an explicit practice in this book as well.
The courage to adapt is an important principle, but it’s not explicit in any single XP practice. Rather, it’s a facet of XP’s Courage value. Similarly, the need for a holistic view has been an ongoing theme in this book, but no specific practice reflects that principle. Instead, it’s part of XP’s Feedback value.
My anecdote about changing our team’s release process made it sound like it went more smoothly than it really did. When the project lead left, he took with him much of the knowledge needed to produce a release, knowledge that existed only in his head and not in permanent documents anywhere. We knew this, but decided to take over the release process anyway.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Break the Rules
Inhaltsvorschau
Rules are important—they exist for a reason. Yet rules can’t anticipate all situations. When established conventions thwart your attempts to succeed, it’s time to break the rules.
How do you know when to break the rules? First, you need to understand them and their reasons for existing. That comes with experience. Once you understand the rules, exercise pragmatic idealism: establish an underlying set of ideals—such as the agile principles—based on practical results. Embrace your ideals, but ground them in pragmatism. For example, “We want to avoid integration hell” is a pragmatic result that leads to the ideal of “We will never check in code that doesn’t build or pass its tests.”
With the guidance of your principles, question existing conventions. Ask yourself, “Why do we follow this rule? Do we really need it?” Modify, work around, or break the rules that prevent you from achieving success.
Remember, though, that organizational support is central to success. If you break a rule, you might step on someone’s toes. Be prepared to explain your experiment. You’ll find it’s easier to get away with breaking rules when you’ve demonstrated that you’re trustworthy and effective.
Rule-breaking exists more in XP folklore than in XP practices. For example, early XP teams told stories of coming in to work on a weekend to dismantle cubicle walls, assuming that it would be easier to ask forgiveness than permission. Ron Jeffries, one of XP’s earliest proponents, is famous for saying, “They’re just rules” in regard to the XP practices. He later clarified his statement:
They’re not rules, OK? They’re techniques. They’re tools we apply. They’re habits. They’re practices—things we practice.... They are, however, darn good things to know how to do, and do well.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 12: Rely on People
Inhaltsvorschau
Alistair Cockburn’s 1999 paper, “Characterizing people as non-linear, first-order components in software development,” argues that the people involved in making software affect the project as much as any method or practice. Although Cockburn calls this “stupendously obvious,” he rightly describes it as often overlooked.
Almost every challenge in building great software is, in some way, a people problem. That challenge may be communicating effectively, dealing with the unpredictability of moods and motives, or figuring out how to harness people’s desire to do the right thing for the team and the project. Few problems are solely technical.
Agile methods put people and their interactions at the center of all decisions. How can we best work together? How can we communicate effectively? Successful software projects must address these questions.
Unless you’re writing software by and for yourself, you will have to deal with at least one other person somewhere during the process. A grudging détente is not enough; you need to work together effectively. This means forming solid working relationships that are built on honesty, trust, cooperation, openness, and mutual respect.
You can’t force people to do this. The best your agile method can do is support these sorts of relationships. For example, one way to engender healthy interaction is to have people sit together and collaborate in pursuit of common goals.
It’s far easier, unfortunately, to craft your method in a way that discourages healthy relationships. An extreme example (sadly, one that actually happens) is forcing all developer communication with stakeholders to go through business analysts. As another example, a sure way to damage programmer/tester relationships is to require them to communicate solely through the bug-tracking system.
Blame-oriented cultures also sabotage relationships. Get rid of blame by introducing collaboration and avoiding practices that indicate a lack of trust. Rather than forcing stakeholders to sign a requirements document, work together to identify and clarify requirements and review progress iteratively. Rather than telling developers that they can’t produce any bugs and testers that they must find all the bugs, ask developers and testers to work together to ensure that
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Build Effective Relationships
Inhaltsvorschau
Unless you’re writing software by and for yourself, you will have to deal with at least one other person somewhere during the process. A grudging détente is not enough; you need to work together effectively. This means forming solid working relationships that are built on honesty, trust, cooperation, openness, and mutual respect.
You can’t force people to do this. The best your agile method can do is support these sorts of relationships. For example, one way to engender healthy interaction is to have people sit together and collaborate in pursuit of common goals.
It’s far easier, unfortunately, to craft your method in a way that discourages healthy relationships. An extreme example (sadly, one that actually happens) is forcing all developer communication with stakeholders to go through business analysts. As another example, a sure way to damage programmer/tester relationships is to require them to communicate solely through the bug-tracking system.
Blame-oriented cultures also sabotage relationships. Get rid of blame by introducing collaboration and avoiding practices that indicate a lack of trust. Rather than forcing stakeholders to sign a requirements document, work together to identify and clarify requirements and review progress iteratively. Rather than telling developers that they can’t produce any bugs and testers that they must find all the bugs, ask developers and testers to work together to ensure that customers don’t find any bugs.
It’s easy—especially for technical people—to get caught up in the details of a particular solution. Encourage cooperation and experimentation while respecting the distinction between ideas and people. Credit isn’t important. Being right isn’t important. Treating your team members with respect and cooperating to produce great software is important.
Although no process can enforce effective relationships, XP does a good job of
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Let the Right People Do the Right Things
Inhaltsvorschau
A functioning team is not enough. You need to have the right people working well together. You need a diverse range of expertise. Once you find the right people, trust them to do their jobs. Instead of creating a process that protects your organization from its employees, create a process that enables team members to excel.
Give the team control over its own work. They’re the experts—that’s why they’re on the team. Trust them, and back up that trust by giving them authority over the project’s success. If you can’t trust your team, you don’t have the right people. No one is perfect, but you need a team that, as a whole, you can trust.
Authority over day-to-day decisions extends to your agile process as well. Use the agile principles to change your own process rather than allowing someone to impose process changes.
Within the team, anyone can be a leader. Encourage team members to turn to the person or people most qualified to make a necessary decision. For example, when you need design decisions, ask your senior programmers for help. When you need business decisions, ask your most experienced businessperson to make the right choice.
Leadership doesn’t mean pounding on the table or shouting, “I’m most senior, so we’ll do it my way!” Leadership comes by leading. If the team thinks you’re most qualified to make a decision, they’ll follow your guidance. If not, don’t act as if you have authority over them, even if you think you do. Managers, rather than telling the team what to do, let the team tell you what they need you to do to help them succeed.
This principle has two parts: first, get the right people, then give them the power do their work right. XP supports the first part by including customers and testers on the team and involving real customers when appropriate.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Build the Process for the People
Inhaltsvorschau
Agile methods recognize the humanity at the core of software development. Agile methods are built around people, not machines. Working effectively requires an understanding deeper than the surface mechanics of how people interact or who makes decisions.
One aspect of humanity is that we’re fallible. We make mistakes, forget important practices, and obstinately refuse to do things that are good for us—especially when we’re tired or under stress.
We have strengths, too. We are creative, playful, and—under the right circumstances—passionate and driven to succeed. No machine can match these characteristics.
As you modify your agile method, work with these essential strengths and weaknesses. Don’t require perfection; instead, build your process to identify and fix mistakes quickly. Do take advantage of your team’s creativity. If a task is boring and repetitive, automate it.
Have fun, too. Software development may be big business, but the best developers I know love their jobs. They’re passionate about their projects, and they also joke and play. The great teams I know socialize outside of work. There’s no way for your agile method to enforce this, but you can create the conditions for it to happen by identifying and eliminating the barriers to natural social interaction.
XP’s demand for self-discipline seems to violate this principle of understanding human weakness. People aren’t good at being self-disciplined all the time, so how can XP succeed?
XP handles the challenge of self-discipline in several ways. First, software developers love to produce high-quality work; once they see the quality of code that XP provides, they tend to love it. They may not always stay disciplined about the practices, but they generally want to follow the practices. Allowing people to take responsibility for their own quality encourages them to work to their full potential.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 13: Eliminate Waste
Inhaltsvorschau
It’s difficult to change the course of a heavy cruise ship, whereas a river kayak dances through rapids with the slightest touch of the paddle. Although a cruise ship has its place, the kayak is much more agile.
Agility requires flexibility and a lean process, stripped to its essentials. Anything more is wasteful. Eliminate it! The less you have to do, the less time your work will take, the less it will cost, and the more quickly you will deliver.
You can’t just cut out practices, though. What’s really necessary? How can you tell if something helps or hinders you? What actually gets good software to the people who need it? Answering these questions helps you eliminate waste from your process and increase your agility.
The easiest way to reduce waste is to reduce the amount of work you may have to throw away. This means breaking your work down into its smallest possible units and verifying them separately.
Sometimes while debugging, I see multiple problems and their solutions at once. Shotgun debugging is tempting, but if I try several different solutions simultaneously and fix the bug, I may not know which solution actually worked. This also usually leaves a mess behind. Incremental change is a better approach. I make one well-reasoned change, observe and verify its effects, and decide whether to commit to the change or revert it. I learn more and come up with better—and cleaner—solutions.
This may sound like taking baby steps, and it is. Though I can work for 10 or 15 minutes on a feature and get it mostly right, the quality of my code improves immensely when I focus on a very small part and spend time perfecting that one tiny piece before continuing. These short, quick steps build on each other; I rarely have to revert any changes.
If the step doesn’t work, I’ve spent a minute or two learning something and can backtrack a few moments to position myself to make further progress. These frequent course corrections help me get where I really want to go. Baby steps reduce the scope of possible errors to only the most recent changes, which are small and fresh in my mind.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Work in Small, Reversible Steps
Inhaltsvorschau
The easiest way to reduce waste is to reduce the amount of work you may have to throw away. This means breaking your work down into its smallest possible units and verifying them separately.
Sometimes while debugging, I see multiple problems and their solutions at once. Shotgun debugging is tempting, but if I try several different solutions simultaneously and fix the bug, I may not know which solution actually worked. This also usually leaves a mess behind. Incremental change is a better approach. I make one well-reasoned change, observe and verify its effects, and decide whether to commit to the change or revert it. I learn more and come up with better—and cleaner—solutions.
This may sound like taking baby steps, and it is. Though I can work for 10 or 15 minutes on a feature and get it mostly right, the quality of my code improves immensely when I focus on a very small part and spend time perfecting that one tiny piece before continuing. These short, quick steps build on each other; I rarely have to revert any changes.
If the step doesn’t work, I’ve spent a minute or two learning something and can backtrack a few moments to position myself to make further progress. These frequent course corrections help me get where I really want to go. Baby steps reduce the scope of possible errors to only the most recent changes, which are small and fresh in my mind.
The desire to solve big, hairy problems is common in developers. Pair programming helps us encourage each other to take small steps to avoid unnecessary embellishments. Further, the navigator concentrates on the big picture so that both developers can maintain perspective of the system as a whole.
Test-driven development provides a natural rhythm with its think-test-design-code-refactor cycle. The successful end of every cycle produces a stable checkpoint at which the entire system works as designed; it’s a solid foothold from which to continue. If you go wrong, you can quickly revert to the prior known-good state.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Fail Fast
Inhaltsvorschau
It may seem obvious, but failure is another source of waste. Unfortunately, the only way to avoid failure entirely is to avoid doing anything worthwhile. That’s no way to excel. As said, “Projects with no real risks are losers. They are almost always devoid of benefit; that’s why they weren’t done years ago.”
Instead of trying to avoid failure, embrace it. Think, “If this project is sure to fail, I want to know that as soon as possible.” Look for ways to gather information that will tell you about the project’s likelihood of failure. Conduct experiments on risk-prone areas to see if they fail in practice. The sooner you can cancel a doomed project, the less time, effort, and money you’ll waste on it.
Failing fast applies to all aspects of your work, to examples as small as buying a bag of a new type of coffee bean rather than a crate. It frees you from worrying excessively about whether a decision is good or bad. If you’re not sure, structure your work so that you expose errors as soon as they occur. If it fails, let it fail quickly, rather than lingering in limbo. Either way, invest only as much time and as many resources as you need to be sure of your results.
With these principles guiding your decisions, you’ll fear failure less. If failure doesn’t hurt, then it’s OK to fail. You’ll be free to experiment and take risks. Capitalize on this freedom: if you have an idea, don’t speculate about whether it’s a good idea—try it! Create an experiment that will fail fast, and see what happens.
One of the challenges of adopting XP is that it tends to expose problems. For example, iterations, velocity, and the planning game shine the harsh light of fact on your schedule aspirations.
This is intentional: it’s one of the ways XP helps projects fail fast. If your desired schedule is unachievable, you should know that. If the project is still worthwhile, either reduce scope or change your schedule. Otherwise, cancel the project. This may seem harsh, but it’s really just a reflection of the “fail fast” philosophy.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Maximize Work Not Done
Inhaltsvorschau
The agile community has a saying: “Simplicity is the art of maximizing the work not done.” This idea is central to eliminating waste. To make your process more agile, do less.
However, you can’t take so much out of your process that it no longer works. As Albert Einstein said, “Everything should be made as simple as possible, but not one bit simpler.” Often, this means approaching your work in a new way.
Simplifying your process sometimes means sacrificing formal structures while increasing rigor. For example, an elegant mathematical proof sketched on the back of a napkin may be rigorous, but it’s informal. Similarly, sitting with customers decreases the amount of formal requirements documentation you create, but it substantially increases your ability to understand requirements.
Solutions come from feedback, communication, self-discipline, and trust. Feedback and direct communication reduce the need for intermediate deliverables. Self-discipline allows team members to work without the binding overhead of formal structures. Trust can replace the need to wait days—or longer—for formal signoffs.
Paring down your practices to the responsible essentials and removing bottlenecks lets you travel light. You can maximize the time you spend producing releasable software and improve the team’s ability to focus on what’s really important.
XP aggressively eliminates waste, more so than any method I know. It’s what makes XP extreme.
By having teams sit together and communicate directly, XP eliminates the need for intermediate requirements documents. By using close programmer collaboration and incremental design, XP eschews written design documents.
XP also eliminates waste by reusing practices in multiple roles. The obvious benefit of pair programming, for example, is continuous code review, but it also spreads knowledge throughout the team, promotes self-discipline, and reduces distractions. Collective code ownership not only enables incremental design and architecture, it removes the time wasted while you wait for someone else to make a necessary API change.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Pursue Throughput
Inhaltsvorschau
A final source of waste isn’t immediately obvious. The manufacturing industry calls it inventory. In software development, it’s unreleased software. Either way, it’s partially done work—work that has cost money but has yet to deliver any value.
Partially done work represents unrealized investment. It’s waste in the form of opportunity cost, where the investment hasn’t yet produced value but you can’t use the resources it cost for anything else.
Partially done work also hurts throughput, which is the amount of time it takes for a new idea to become useful software. Low throughput introduces more waste. The longer it takes to develop an idea, the greater the likelihood that some change of plans will invalidate some of the partially done work.
To minimize partially done work and wasted effort, maximize your throughput. Find the step in your process that has the most work waiting to be done. That’s your constraint: the one part of your process that determines your overall throughput. In my experience, the constraint in software projects is often the developers. The rate at which they implement stories governs the amount of work everyone else can do.
To maximize throughput, the constraint needs to work at maximum productivity, whereas the other elements of your process don’t. To minimize partially finished work, nonconstraints should produce only enough work to keep the constraint busy, but not so much that there’s a big pile of outstanding work. Outstanding work means greater opportunity costs and more potential for lost productivity due to changes.
Minimizing partially done work means that everyone but the constraint will be working at less than maximum efficiency. That’s OK. Efficiency is expendable in other activities. In fact, it’s important that nonconstraints have extra time available so they can respond to any needs that the constraint might have, thus keeping the constraint maximally productive.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 14: Deliver Value
Inhaltsvorschau
Your software only begins to have real value when it reaches users. Only at that point do you start to generate trust, to get the most important kinds of feedback, and to demonstrate a useful return on investment. That’s why successful agile projects deliver value early, often, and repeatedly.
Simplicity of code and process are aesthetically pleasing. Yet there’s a more important reason why agility helps you create great software: it improves your ability to recognize and take advantage of new opportunities.
If you could predict to the hour how long your project would take, know what risks would and wouldn’t happen, and completely eliminate all surprises, you wouldn’t need agility—you would succeed with any development method.
However, what you don’t know is exciting. A new crisis or happy discovery next week could completely change the rules of the game. You may discover a brilliant new technique that simplifies your code, or your customer may develop a new business practice that saves time and money.
Want to deliver real value? Take advantage of what you’ve learned and change your direction appropriately. Adapting your point of view to welcome changing requirements gives you great opportunities. Delivering value to your customer is your most important job. Aggressively pursuing feedback from your customer, from real users, from other team members, and from your code itself as early and as often as possible allows you to continue to learn and improve your understanding of the project. It also reveals new opportunities as they appear.
Agility requires you to work in small steps, not giant leaps. A small initial investment of time and resources, properly applied, begins producing quantifiable value immediately. As well, committing to small amounts of change makes change itself more possible. This is most evident when customer requirements outline their needs at a very high level, through stories that promise further clarification during development.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Exploit Your Agility
Inhaltsvorschau
Simplicity of code and process are aesthetically pleasing. Yet there’s a more important reason why agility helps you create great software: it improves your ability to recognize and take advantage of new opportunities.
If you could predict to the hour how long your project would take, know what risks would and wouldn’t happen, and completely eliminate all surprises, you wouldn’t need agility—you would succeed with any development method.
However, what you don’t know is exciting. A new crisis or happy discovery next week could completely change the rules of the game. You may discover a brilliant new technique that simplifies your code, or your customer may develop a new business practice that saves time and money.
Want to deliver real value? Take advantage of what you’ve learned and change your direction appropriately. Adapting your point of view to welcome changing requirements gives you great opportunities. Delivering value to your customer is your most important job. Aggressively pursuing feedback from your customer, from real users, from other team members, and from your code itself as early and as often as possible allows you to continue to learn and improve your understanding of the project. It also reveals new opportunities as they appear.
Agility requires you to work in small steps, not giant leaps. A small initial investment of time and resources, properly applied, begins producing quantifiable value immediately. As well, committing to small amounts of change makes change itself more possible. This is most evident when customer requirements outline their needs at a very high level, through stories that promise further clarification during development.
Aggressively seeking feedback and working in small steps allows you to defer your investment of resources until the last responsible moment. You can start to see the value from a piece of work as you need it, rather than hoping to benefit from it someday in the future.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Only Releasable Code Has Value
Inhaltsvorschau
Having the best, most beautiful code in the world matters very little unless it does what the customer wants. It’s also true that having code that meets customer needs perfectly has little value unless the customer can actually use it. Until your software reaches the people who need it, it has only potential value.
Delivering actual value means delivering real software. Unreleasable code has no value. Working software is the primary measure of your progress. At every point, it should be possible to stop the project and have actual value proportional to your investment in producing the software.
Any functional team can change its focus in a week or a month, but can they do so while maximizing their investment of time and resources to deliver software regularly? Do they really finish code—does “done” mean “done done”—or do they leave an expanding wake of half-finished code? Do they keep their project releasable at any time?
Agility and flexibility are wonderful things, especially when combined with iterative incremental development. Throughput is important! Besides reducing thrashing and waste, it provides much better feedback, and not just in terms of the code’s quality. Only code that you can actually release to customers can provide real feedback on how well you’re providing value to your customers.
That feedback is invaluable.
The most important practice is that of “done done,” where work is either complete or incomplete. This unambiguous measure of progress immediately lets you know where you stand.
Test-driven development produces a safety net that catches regressions and deviations from customer requirements. A well-written test suite can quickly identify any failures that may reduce the value of the software. Similarly, continuous integration ensures that the project works as a whole multiple times per day. It forces any mistakes or accidents to appear soon after their introduction, when they’re easiest to fix. The 10-minute build reduces the bottlenecks in this process to support its frequency.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Deliver Business Results
Inhaltsvorschau
What if you could best meet your customer’s need without writing any software? Would you do it? Could you do it?
Someday that may happen to you. It may not be as dramatic as telling a recurring customer that he’ll get better results if you don’t write software, but you may have to choose between delivering code and delivering business results.
Value isn’t really about software, after all. Your goal is to deliver something useful for the customer. The software is merely how you do that. The single most essential criterion for your success is the fitness of the project for its business purposes. Everything else is secondary—not useless by any means, but of lesser importance.
For example, agile teams value working software over comprehensive documentation. Documentation is valuable—communicating what the software must do and how it works is important—but your first priority is to meet your customer’s needs. Sometimes that means producing good documentation. Usually it means delivering good software, but not always. The primary goal is always to provide the most valuable business results possible.
XP encourages close involvement with actual customers by bringing them into the team, so they can measure progress and make decisions based on business value every day. Real customer involvement allows the on-site customer to review these values with end-users and keep the plan on track. Their vision provides answers to the questions most important to the project.
XP approaches its schedule in terms of customer value. The team works on stories phrased from the customer’s point of view and verifiable by customer testing. After each iteration, the iteration demo shows the team’s current progress to stakeholders, allowing them to verify that the results are valuable and to decide whether to continue development.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Deliver Frequently
Inhaltsvorschau
If you have a business problem, a solution to that problem today is much more valuable than a solution to that problem in six months—especially if the solution will be the same then as it is now. Value is more than just doing what the customer needs. It’s doing what the customer needs when the customer needs it.
Delivering working, valuable software frequently makes your software more valuable. This is especially true when a real customer promotes the most valuable stories to the start of the project. Delivering working software as fast as possible enables two important feedback loops. One is from actual customers to the developers, where the customers use the software and communicate how well it meets their needs. The other is from the team to the customers, where the team communicates by demonstrating how trustworthy and capable it is.
Frequent delivery tightens those loops. Customers see that their involvement in the process makes a real difference to their work. Developers see that they’re helping real people solve real problems. The highest priority of any software project is to deliver value, frequently and continuously, and by doing so, to satisfy the customer. Success follows.
Once you’ve identified what the customer really needs and what makes the software valuable, XP’s technical practices help you achieve fast and frequent releases. Short iterations keep the schedule light and manageable by dividing the whole project into week-long cycles, culminating in a deliverable project demonstrated in the iteration demo. This allows you to deliver once a week, if not sooner.
Practicing the art of “done done” with discipline keeps you on track, helping you identify how much work you have finished and can do while reminding you to pursue throughput. Keeping a ten-minute build reminds you to reduce or remove any unnecessary technical bottlenecks to producing a release. The less work and frustration, and the more automation, the easier it is to deliver a freshly tested, working new build.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Chapter 15: Seek Technical Excellence
Inhaltsvorschau
I like logical frameworks and structures. When I think about technical excellence, I can’t help but wonder: “What’s the intellectual basis for design? What does it mean to have a good design?”
Unfortunately, many discussions of “good” design focus on specific techniques. These discussions often involve assumptions that one particular technology is better than another, or that rich object-oriented domain models or stored procedures or service-oriented architectures are obviously good.
With so many conflicting points of view about what’s obviously good, only one thing is clear: good isn’t obvious.
Some folks describe good design as elegant or pretty. They say that it has the Quality Without a Name (QWAN)—an ineffable sense of rightness in the design. The term comes from Christopher Alexander,a building architect whose thoughts on patterns inspired software’s patterns movement.
I have a lot of sympathy for QWAN. Good design is Truth and Beauty. There’s just one problem. My QWAN is not your QWAN. My Truth and Beauty is your Falsehood and Defilement. My beautiful domain models are uglier than your stored procedures, and vice versa.
QWAN is just too vague. I want a better definition of good design.
Let me digress for a moment: software doesn’t exist. OK, I exaggerate—but only slightly.
When you run a program, your computer loads a long series of magnetic fields from your hard drive and translates them into capacitances in RAM. Transistors in the CPU interpret those charges, sending the results out to peripherals such as your video card. More transistors in your monitor selectively allow light to shine through colored dots onto your screen.
Yet none of that is software. Software isn’t even ones and zeros; it’s magnets, electricity, and light. The only way to create software is to toggle electrical switches up and down—or to use existing software to create it for you.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Software Doesn’t Exist
Inhaltsvorschau
Let me digress for a moment: software doesn’t exist. OK, I exaggerate—but only slightly.
When you run a program, your computer loads a long series of magnetic fields from your hard drive and translates them into capacitances in RAM. Transistors in the CPU interpret those charges, sending the results out to peripherals such as your video card. More transistors in your monitor selectively allow light to shine through colored dots onto your screen.
Yet none of that is software. Software isn’t even ones and zeros; it’s magnets, electricity, and light. The only way to create software is to toggle electrical switches up and down—or to use existing software to create it for you.
You write software, though, don’t you?
Actually, you write a very detailed specification for a program that writes the software for you. This special program translates your specification into machine instructions, then directs the computer’s operating system to save those instructions as magnetic fields on the hard drive. Once they’re there, you can run your program, copy it, share it, or whatever.
You probably see the punchline coming. The specification is the source code. The program that translates the specification into software is the compiler. Jack Reeves explores the implications in his famous essay, “What is Software Design?”
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Design Is for Understanding
Inhaltsvorschau
If source code is design, then what is design? Why do we bother with all these UML diagrams and CRC cards and discussions around a whiteboard?
All these things are abstractions—even source code. The reality of software’s billions of evanescent electrical charges is inconceivably complex, so we create simplified models that we can understand. Some of these models, like source code, are machine-translatable. Others, like UML, are not—at least not yet.
Early source code was assembly language: a very thin abstraction over the hardware. Programs were much simpler back then, but assembly language was hard to understand. Programmers drew flow charts to visualize the design.
Why don’t we use flow charts anymore? Our programming languages are so much more expressive that we don’t need them! You can read a method and see the flow of control.
Before structured programming:
  1000 NS% = (80 - LEN(T$)) / 2

  1010 S$ = ""

  1020 IF NS% = 0 GOTO 1060

  1030 S$ = S$ + " "

  1040 NS% = NS% - 1

  1050 GOTO 1020

  1060 PRINT S$ + T$

  1070 RETURN
After structured programming:
  public void PrintCenteredString(string text) {

      int center = (LINE_LENGTH - text.Length) / 2;

      string spaces = "";



      for (int i = 0; i < center; i++) {

          spaces += " ";

      }



      Print(spaces + text);

  }
OK, it’s not entirely true that modern languages make the flow of control obvious. We still run across huge 1,000-line methods that are so convoluted we can’t understand them without the help of a design sketch. But that’s bad design, isn’t it?
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Design Trade-offs
Inhaltsvorschau
When the engineers at Boeing design a passenger airplane, they constantly have to trade off safety, fuel efficiency, passenger capacity, and production cost. Programmers rarely have to make those kinds of decisions these days. The assembly programmers of yesteryear had tough decisions between using lots of memory (space) or making the software fast (speed). Now, we almost never face such speed/space trade-offs. Our machines are so fast and have so much RAM that once-beloved hand optimizations rarely matter.
In fact, our computers are so fast that modern languages actually waste computing resources. With an optimizing compiler, C is just as good as assembly language. C++ adds virtual method lookups—four bytes per method and an extra level of indirection. Java and C# add a complete intermediate language that runs in a virtual machine atop the normal machine. Ruby interprets the entire program on every invocation!
How wasteful. So why is Ruby on Rails so popular? How is it possible that Java and C# succeed? What do they provide that makes their waste worthwhile? Why aren’t we all programming in C?
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Quality with a Name
Inhaltsvorschau
A good airplane design balances the trade-offs of safety, carrying capacity, fuel consumption, and manufacturing costs. A great airplane design gives you better safety, and more people, for less fuel, at a cheaper price than the competition.
What about software? If we’re not balancing speed/space trade-offs, what are we doing?
Actually, there is one trade-off that we make over and over again. Java, C#, and Ruby demonstrate that we are often willing to sacrifice computer time in order to save programmer time and effort.
Some programmers flinch at the thought of wasting computer time and making “slow” programs. However, wasting cheap computer time to save programmer resources is a wise design decision. Programmers are often the most expensive component in software development.
If good design is the art of maximizing the benefits of our trade-offs—and if software design’s only real trade-off is between machine performance and programmer time—then the definition of “good software design” becomes crystal clear:
A good software design minimizes the time required to create, modify, and maintain the software while achieving acceptable runtime performance.
Oh, and it has to work. That’s nonnegotiable. If a Boeing jet can’t fly, its fuel efficiency doesn’t matter. Similarly, a software design must work.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Great Design
Inhaltsvorschau
Equating good design with the ease of maintenance is not a new idea, but stating it this way leads to some interesting conclusions:
  1. Design quality is people-sensitive. Programmers, even those of equivalent competence, have varying levels of expertise. A design that assumes Java idioms may be incomprehensible to a programmer who’s only familiar with Perl, and vice versa. Because design quality relies so heavily on programmer time, it’s very sensitive to which programmers are doing the work. A good design takes this into account.
  2. Design quality is change-specific. Software is often designed to be easy to change in specific ways. This can make other changes difficult. A design that’s good for some changes may be bad in others. A genuinely good design correctly anticipates the changes that actually occur.
  3. Modification and maintenance time are more important than creation time. It bears repeating that most software spends far more time in maintenance than in initial development. When you consider that even unreleased software often requires modifications to its design, the importance of creation time shrinks even further. A good design focuses on minimizing modification and maintenance time over minimizing creation time.
  4. Design quality is unpredictable. If a good design minimizes programmer time, and it varies depending on the people doing the work and the changes required, then there’s no way to predict the quality of a design. You can have an informed opinion, but ultimately the proof of a good design is in how it deals with change.
Furthermore, great designs:
  • Are easy to modify by the people who most frequently work within them
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Universal Design Principles
Inhaltsvorschau
In the absence of design quality measurements, there is no objective way to prove that one design approach is better than another. Still, there are a few universal principles—which seem to apply to any programming language or platform—that point the way.
None of these ideas are my invention. How could they be? They’re all old, worn, well-loved principles. They’re so old you may have lost track of them amidst the incessant drum-beating over new fads. Here’s a reminder.
Continue to sketch UML diagrams. Discuss design over CRC cards. Produce pretty wall charts on giant printers if you want. Abstractions like these are indispensible tools for clarifying a design. Just don’t confuse these artifacts with a completed design. Remember, your design has to work. That’s nonnegotiable. Any design that you can’t turn into software automatically is incomplete.
If you’re an architect or designer and you don’t produce code, it’s programmers who finish your design for you. They’ll fill in the inevitable gaps, and they’ll encounter and solve problems you didn’t anticipate. If you slough this detail work off onto junior staff, the final design could be lower quality than you expected. Get your hands dirty. Follow your design down to the code.
This clever name for a well-known principle comes from Dave Thomas and Andy Hunt. Don’t Repeat Yourself is more than just avoiding cut-and-paste coding. It’s having one cohesive location and canonical representation for every concept in the final design—anything from “the way we interface with a database” to “the business rule for dealing with weekends and holidays.”
Eliminating duplication decreases the time required to make changes. You need only change one part of the code. It also decreases the risk of introducing a defect by making a necessary change in one place but not in another.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Principles in Practice
Inhaltsvorschau
These universal design principles provide good guidance, but they don’t help with specific languages or platforms. That’s why you need design principles for specific languages, such as Martin’s list of the principles of object-oriented class design. Unfortunately, when you take universal design principles and turn them into specific design advice, you lose something important: context. Every design decision occurs in the context of the whole design—the problem domain, other design decisions, the time schedule, other team members’ capabilities, etc.
Context makes every piece of specific design advice suspect. Yes, you should listen to it—there’s a lot of wisdom out there—but exercise healthy skepticism. Ask yourself, “When is this not true?” and “What is the author assuming?”
Consider the simple and popular “instance variables must be private” design rule. As one of the most widely repeated design rules, it often gets applied without real thought. That’s a shame because without context, the rule is meaningless and easily misused.
It’s true that instance variables should often be private, but if you want to understand the rule and when to break it, ask why. Why make instance variables private? One reason is that private variables enforce encapsulation. But why should anyone care about encapsulation?
The real reason private variables (and encapsulation) are good is that they help enforce decoupling. Decoupled code is good, right? Not always. Appropriately decoupled code is good, but it’s OK for closely related concepts to be tightly coupled.
However, closely related concepts should also be cohesive. They should be close together in the code. In object-oriented programming languages, closely related concepts often belong in the same class.
This is where the “instance variables must be private” rule comes from. When you have an urge to make an instance variable public, it’s a sign that you have both a cohesion problem
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
Pursue Mastery
Inhaltsvorschau
A good software design minimizes the time required to create, modify, and maintain the software while achieving acceptable runtime performance.
This definition, and the conclusions it leads to, are the most important things I keep in mind when considering a design. I follow some core design principles, and I have some techniques that are useful for the languages I work with. However, I’m willing to throw away even the design principles if they get in the way of reducing programmer time and, most importantly, solving real customer problems.
The same is true of agile software development. Ultimately, what matters is success, however you define it. The practices, principles, and values are merely guides along the way. Start by following the practices rigorously. Learn what the principles mean. Break the rules, experiment, see what works, and learn some more. Share your insights and passion, and learn even more.
Over time, with discipline and success, even the principles will seem less important. When doing the right thing is instinct and intuition, finely honed by experience, it’s time to leave rules and principles behind. When you produce great software for a valuable purpose and pass your wisdom on to the next generation of projects, you will have mastered the art of successful software development.
Ende der Inhaltsvorschau. Der weiterere Inhalt dieses Abschnitts ist hier nicht einsehbar.
	

Zurück zu The Art of Agile Development


Themen

Buchreihen

Special Interest

International Sites

O'Reilly China O'Reilly USA O'Reilly Japan O'Reilly Taiwan