Chapter 1. eXtreme Programming Overview

If you have never before read anything about eXtreme Programming (XP), read this chapter. If you want know how XP can help you develop better code for the .NET Framework, read this chapter.

This chapter does not provide a detailed, in-depth examination of XP. It provides just enough information about XP to get you started. Also explained in this chapter is the importance of XP to .NET developers. This chapter discusses the business needs for XP techniques and how software development practices have changed to meet those needs. After all, XP has evolved in response to the changing business needs of software teams.

Because the material within this chapter is introductory in nature, I direct you to other reference material for further reading.

What Is eXtreme Programming?

XP is a formalized set of software development methods that have been shown to work well together. A central theme of XP is the idea that the cost of change on a software project does not need to rise throughout the life cycle of a project. If the cost of change can be leveled off, the attitude toward the development process can be radically rethought.

XP aims to embrace the ever-changing business needs when developing a software solution. XP is nonproprietary and doesn’t involve buying any special tools. XP challenges many of the common development practices, requires an open mind, and necessitates that the development team learn new techniques. XP evolution has been driven by a groundswell of developers unhappy with the continuing failings of traditional software development methodologies.

XP is very much driven from the programmer’s perspective, but never loses focus of the business aspects. Customer input is highly valued throughout the development process. In fact in an XP approach, the customer is part of the development team and thus maintains closer control of the project.

A downfall of many software projects is the “us versus them” approach taken between software developers and customers. To counter this, an important aspect of XP is that it revolves around customer satisfaction. XP draws the customer into the software development team, thereby allowing the whole team to become aligned to delivering the goal.

XP is nothing new. Many XP practices are things that developers have been doing for years. The difference is that XP pulls them all together and “turns the volume up.”[1] The idea is to find the things that work well and make them work even better. This is where the extreme comes from, the high-intensity use of these practices.

The goal of XP for you, the developer, is to enable you to focus on the code, developing high-quality solutions in a predictable and repeatable manner. XP focuses on the use of 12 main practices. Each one of these practices is a valuable tool to have in your toolbox. Each practice supports and strengthens some of the other practices. When used together, these practices have been shown to add up to more than the sum of the parts.

The XP practices support four key values: communication, simplicity, feedback, and courage. Each of the values interacts with the other. Together these values work to create a strong foundation for developing high-quality software solutions. By using these practices and supporting these values, a team can ensure that high-quality software gets produced to meet the most pressing business needs.

Working in The Ever-Faster-Changing World

The pace of change in the business world continues to increase at a dramatic rate. Even with the downturn after the dot.com crash, the business world is moving forward at a more rapid pace than ever before. With less funding available for IT projects, more than ever is expected from software development teams. To keep up with customer and client requests, we need some help.

The Answers According to Microsoft

Microsoft’s response to this need follows their line of reasoning behind tools such as Visual Basic, Visual C++, and MFC: Let us (Microsoft) worry about the plumbing, and you (the developer) can worry about solving the business problems. The .NET Framework takes this a step further than any of the offerings before. The .NET Framework provides what is, in effect, a large virtual machine for your software to run on. This framework provides a huge amount of base functionality for you to work with to meet your customer needs. It also enables you to interoperate with existing COM-based technology and write your solutions as components, with different components being written in different languages.

The Answers According to XP

Emerging almost simultaneously with the .NET Framework, with the aim of solving some of the same problems, has been the agile development movement (http://www.agilealliance.org). One of the most well-publicized and written about of the agile development methods is XP. XP aims, through the use of the practices explained in this chapter, to solve these problems of ever-changing needs and creating big, complex solutions.

How .NET and XP Fit Together

.NET is a concrete technology (a set of tools and libraries) with which we can work. XP provides us with a set of practices and techniques we can use to better develop our software.

The .NET Framework provides a rich environment for building collaborative applications. Visual Studio .NET provides a rapid development IDE to help developers create these applications. .NET is being marketed as helping developers create solutions that support their business (customers) in a more responsive way; XP practices are centered on creating predictable software for the customer. The common thread between XP and .NET is the central role played by the customer.

Together XP and .NET work well, and most of the development teams I have worked with in the past year have been using both .NET and XP techniques to enhance their offerings to their customers and users. They are what I call eXtreme .NET teams.

You Don’t Have to “Believe” in XP to Learn Something from It

Many developers tell me that XP is “a nice idea, but it would never work in the real world.” Although I disagree, because I have seen it work very well in the real world, it might be that it would never work in their world. Moving to XP can be a cultural shift and can cause massive disruption if not handled carefully. However, some of the techniques practiced by developers who use XP are incredibly powerful tools for any developer to have in his or her toolbox. So even if you are in doubt and don’t believe XP is worth considering, I suggest you at least try to learn what is valuable from this set of practices.

This book teaches these XP practices for you as a developer of .NET software. I hope that you learn from each one and use XP to create great software.

The Roles

Within an XP environment, members of the team take certain roles. The following roles are the ones relevant to this book:

  • Customer—The customer is the goal owner. This role does not always have to be taken by a real end user (or purchaser) of the system. Often a product manager or a person from marketing can effectively play this role. The customer must have a full understanding of what they want from the software being developed. They do not need technical savvy (necessarily), but the customer should have a good understanding of what users will want to do with the software.

    In the eXtreme .NET team introduced in the Chapter 0, Chris is the customer.

  • Developer—I assume that if you are reading this book, you are a developer. It is the developer’s job to work with everyone on the team to create a great piece of software. The developer’s day-to-day activity should focus on writing high-quality code.

    The eXtreme .NET team has Eddie, Sue, Pete, and Deepak as developers.

  • Coach—The coach is someone who has good people skills and can help remove blockages that are preventing the team from moving forward. The coach needs to understand the XP practices to help the rest of the team best employ them. The coach is a developer and will work on the code with the team. Most coaches are experienced developers, but they are not always the most experienced people on the team.

    Eddie is taking the role of the coach in the eXtreme .NET team we are following.

What .NET Developers Can Gain from XP Practices

Over the past few years, as always, new technologies and methods for building software have emerged. Two of the largest and most publicized have been XP and Microsoft’s launch of the .NET Framework. They have both come from very different places and focus on different areas of the software development paradigm.

.NET is a brand name given by Microsoft to their latest range of development tools and frameworks. Here I focus on the use of the Microsoft .NET Framework for developing software that runs on the Common Language Runtime. Since the launch of the .NET Framework, Microsoft has been pushing hard to help companies develop software on the new platform. The success of .NET will depend on the uptake by software developers and then the clients of the software that is developed. The more software developed, and therefore available for a platform, the more attractive it becomes to utilize it, the more likely it will be that developers build software for it, and so on. Bill Gates terms this a virtuous cycle.

So what have these two new things in the software development world got to do with each other? When development teams move to a new language or development platform, they do so for a reason, not just because it’s there! These reasons can vary, but the core theme that runs through them is “it will help us develop better software.” Better can mean several things: faster, more robust, higher quality, more usable, greater scalability, less code to write, and so forth. Many of the teams I have worked with over the past few years have made the decision to not only adopt a new development toolkit, but also a new process for developing software. I have seen a trend emerging of teams moving both to .NET and adopting a more agile development process. These are eXtreme .NET teams.

XP Practices Covered in This Book

The following subsections examine how our eXtreme .NET team uses certain practices to develop better software. In this book not all of the XP practices are covered. I have selected the ones that I believe will add the most value to a team developing a solution using the .NET Framework.

Whole Team (a.k.a. On-Site Customer)

If you adopt the whole team practice, the customer is an integral part of the team. Therefore, the customer is always available to discuss issues and resolve them as they arise. This practice reduces the turnaround time for queries and prevents incorrect assumptions from being made. This practice really puts the pressure on the customer role. If a customer really wants software developed, they must put energy into the process. The concept of them being part of the team adds to the reality of one team, one goal.

Never overlook the value of an on-site customer in any project. When both the development team and the customer are discovering new features of a platform together, this practice becomes more valuable than ever before. The immediate feedback that can be provided by the customer enables the team to add really valuable functionality that they may have missed before.

Consider how this applies to our eXtreme .NET team:[2]

If Chris hadn’t been there to work with the developers, one of several things might have happened:

  1. The developers might have thought “that’s cool, we’ll try to remember to tell Chris about that next time we see him” (and then most likely they would have forgotten).

  2. The developers might have assumed Chris wouldn’t want it and because timeframes were tight, not bothered to mention it in case Chris asked for it as well as everything else they were doing.

  3. The developers might have assumed it was valuable for Chris and implemented it, but then not had time to finish story Y, when actually Chris would have preferred not to have story X delivered.

Any of these (or other) outcomes would have been making assumptions about what the customer actually wanted. Having the customer on site to answer these questions as they come up becomes incredibly valuable.

Planning Game

The planning game practice provides a mechanism for planning out the features in a piece of software. The planning game helps a team estimate timeframes for delivering the software with the features. This practice involves the whole team, including the customer. By including the whole team, the communication between the team members is enhanced. The developers sit with the customer to define the required features and prioritize them. The practice takes the form of a cooperative game. The aim for all participants is to achieve the same end goal: maximize the value of the software produced.

Consider how our eXtreme .NET team interacts during part of their planning game:

You can see how this conversation involves all the members of the team. By involving everyone, no knowledge is hidden. Everything is out in the open. Each member of the team knows the current goals.

Pair Programming

Pair programming refers to developing code with two developers sitting at one computer. In an XP team, you work with a partner on every piece of production code. Pair programming provides a constant peer review of the code. It helps to spread knowledge throughout the team and trains developers to communicate their intentions more fully as they work together. The aim is to increase the overall intelligence creating each part of the system. The combined intelligence of two developers should be greater than either one of them alone.

As far as information dissemination goes, I have never seen anything work as effectively and as fast as pair programming. One developer learns a new trick on the IDE while messing around after work one evening. The next morning that developer shows her partner what she has learned. The pair then splits when they have finished a task (unit of work, discussed further later on) and work with another two people whom they both show the new trick. Before lunch, four developers have all learned the new technique. By the end of the day, everyone on a team of 12 could easily have learned this new trick. Now imagine this working when each of those 12 developers is learning new things. If they all learn one new thing each evening and then spread the word the next day, the entire team is learning 12 new things a day. In reality, most developers learn more than one new thing a day when they are developing software.

This works best when you have a very dynamic environment with rapidly rotating pairs. I recommend that everyone attempt to swap pairs at least twice a day. The more the better. Some of the best eXtreme .NET teams I have worked with swap pairs between four and six times a day; this is where the extreme comes in!

Test-Driven Development

Test-driven development (TDD) is the practice of writing tests before writing the production code. These tests are a cornerstone that supports many of the other practices, such as refactoring and simple design. The tests communicate the intention of the code and validate that intention each time they are run. This validation helps to increase confidence in the software developed.

TDD is a fantastic example of developers providing their own safety net before walking the tightrope of a new development language or framework. Consider how our eXtreme .NET team has benefited from TDD:

In this example, Eddie and Sue were pretty sure the class library would behave as they expected it to, based on their experiences with a different class library. The fact they wrote tests meant they could move forward quickly, fix the problems early, and learn how the class library worked.

The team had another conversation:

Here Sue and Pete discovered through writing the tests some functionality that the .NET Framework classes provided. This meant they could move ahead more quickly without writing code that duplicated the functionality already provided.

The combination of TDD and pair programming meant that two members of the team learned the new feature in the .NET Framework. XP teaches that the more of the practices you use, the greater the benefit you get. The practices play off each other, and the last conversation was a good example of that in action.

Constant Refactoring

Refactoring refers to the process of changing the structure of the code without changing the behavior. Refactoring is a practice that aids the removal of duplicate code and simplifies the code base. Enhancements can be made more easily to refactored code. The practice of constant refactoring means that after each task is complete, the pair reviews their code to see how they might simplify the code without changing the behavior. This practice enables programmers to treat the code in a more dynamic manner. Developers describe their code as becoming more fluid after they learn to refactor effectively.

Refactoring allows an overall architecture to emerge in the system as it is being developed. This approach contrasts with the normal approach of designing the architecture up front and then developing the code to fit with the architecture.

I believe that this is a key component of XP that has really helped many of the teams I have worked with to develop new software with the .NET Framework. Instead of bringing preconceived ideas of how software should be built and trying to make the new .NET code fit into this model, the XP teams have let their architectures emerge. These teams have been able to gain advantages that they would never have gotten if they had attempted to squeeze their code into an old model. This is especially the case for developers coming from either the VB or ASP background.

Let’s join Sue and Eddie as they have just finished a task to see how they use refactoring to change the design:

Teams I have worked with who have previously developed large-scale enterprise applications in Java and C++ have been both surprised and pleased with the architectures they have developed. They have told me that if they had done a big architecture design up front, they would never have built the system that way, and it would have been far more complicated than was needed.

Spiking

XP promotes a form of experimentation and research known as spiking or “doing a spike.” Spiking is experimentation to validate a theory. When the development team needs to know something, a thin vertical slice can be “driven” into the technology to get some answers. These answers can help the project succeed. Most spiking is done without the safety harness of TDD. Spiking is often carried out by solo developers who believe they need a break from pairing. Spikes are also “driven” by the one left out of a team when there are an odd number of developers, so not everyone can pair.

Driving a spike into the area of functionality the development team is planning to work on next will often produce some valuable information. In .NET projects I have worked on I have seen spikes effectively expose new information in the following areas:

  • C# performance

  • Web-service compliance for Remoting servers

  • Issues with COM interoperability

  • Transactional support in ADO.NET

All of these examples were areas in which the development team had uncertainties. In a traditional development approach, someone would have been given the task of dealing with that particular issue. That one person would have become the specialist in that area. For some developers, this is fine because they believe they are securing their jobs in the future by being the top gun in that area. This is a false belief. They are in fact acting as a bottleneck to the team’s overall knowledge attainment. By driving a spike and then reporting the result back to the team, the knowledge gets spread, and more perspective can be given to a task. Pairing with another developer to write the tests and production code after a spike is done also helps to spread the knowledge.

Here’s an excerpt from a meeting with our eXtreme .NET team:

Here this team discovered that the spike had taken them some of the way to knowing the answer, but more work still had to be done.

Continuous Integration

After each task is complete, the code written gets integrated with the entire solution. The entire code base is compiled, and all the tests are run to ensure the code just created does not break anything. This continuous integration practice enables the team to ship early and often and enables them to deliver the short iterations on a regular basis.

As part of this practice, automated build and test scripts are developed. These scripts compile and test the entire solution. The scripts are set up as part of the development environment to make the entire process run more smoothly. This practice eliminates the element of human error from the process.

The practices of a methodology are aimed at reducing the chances of something going wrong. In the past, many projects would design and develop modules or components of the system independently. Near the end of the project, the team would attempt to integrate these modules to produce the final solution. This has become known as the big bang approach and is often a rather painful experience—an experience that involves lots of swearing and cursing because the components do not work together as expected. The XP practice of continuous integration aims to prevent this problem from arising by insisting that developers integrate their code after each task is complete and run the entire suite of tests to ensure that their code has not broken anything.

This practice is valuable when developing systems that consist of distributed components, such as Web services, remoting, custom components, or class libraries. Solutions developed in .NET often include many of these components. Even a simple ASP.NET Web site is likely to include some user controls (ASCX files). By carrying out the continuous integrations, the developers get immediate feedback on the changes they have made. The team can then work to fix any issues that arise. When working with a new toolkit, developers are much less likely to fully understand all the implications of the changes they are making. This XP practice helps these developers to cope with this issue in a far more manageable way.

Stand-Up Meetings

The practice of Stand-Up Meetings occurs each morning. The team stands up and discusses the progress from the previous day and current work issues. Standing up keeps the meetings short and focused.

Learning is about listening and doing. The proof that you have learned something is shown by your ability to teach it to someone else. Stand-up meetings provide an opportunity to spread knowledge to the team. Each morning the team stands up and each member makes a brief statement about his or her achievements the previous day and where he or she wants to get today. This is a great forum for telling the team about some new technology or a new tool that you discovered the previous day. This discussion can then elicit ideas from other team members, as in the following example from our eXtreme .NET team:

The Other Practices

The practices described so far are the ones that I focus on in this book. Other XP practices include the following:

  • Sustainable pace (a.k.a. fixed working week)—Work fixed hours, go fast while at work, and then get out. This is based on the principle that tired developers often make costly mistakes. Therefore, stay fresh and increase the intensity. By keeping to a fixed pace, we can last longer, and our endurance will be greater. Another benefit of sticking to fixed working hours is that the pace of progress can be more easily measured and therefore estimated in the future. If every week we work a different number of hours, it becomes very hard to make anything close to accurate estimates.

  • Metaphor—Have a way of describing the system being developed in terms of something everyone understands. For example, it is like a bakery; we take the ingredients and mix them a certain way to get the results. This is possibly the least-used practice and yet it has the potential to solve a large number of issues. Using a common vocabulary to describe the behavior of a system enables a shift from talking technical to talking about the user features of the system.

  • Simple design—Keep the design as simple as possible. Don’t gold plate or add features because you think you will need them later. This keeps the code doing just the things we need it to do now and no more. This practice helps to keep the cost of change low by not encumbering the system with unneeded features.

  • Short releases—Release a stable working version of the software every one to three weeks for the customer to review. This allows for increased feedback as to the direction of the development. This practice supports the feedback and communication values previously mentioned. Note that it is hard to accomplish this practice without employing the practice of simple design and thus the value the simplicity. These small periods of development are called iterations in XP terminology. We return to the concept of iterations later in the book.

  • Coding standards—Code written adheres to a set of guidelines so that it all has the same look and feel. This makes it harder to claim ownership of the code and so supports collective ownership. This process enables any developer (or pair) to refactor and enhance code you have written.

  • Collective ownership—The entire system and process is owned by the team, not any one individual. This means that no one person has any more right to change a piece of code than another. This helps to enforce coding standards. The flexibility of the code is thus increased because it can be changed and enhanced by the entire team; in this way, the combined intelligence of the team can be applied to make the software better.

  • Leave baggage behind—Do not get too attached to anything because things will change. The class library you wrote two years ago may no longer have any value. The toolkit or language you use today may well not be the one we use tomorrow. Travel light and you will travel faster.

  • Quality work—There is no such thing as an acceptable bug. Keep the quality of your software as close to zero defect as humanly possible. Work with the broken-window[5] theory that once bugs creep into your system, they will multiply at a fierce rate. Kill them quickly before they can do this.

  • Incremental change—Do not make big changes to a system; it will become unstable. Take it small steps at a time, and you will be more likely to succeed.

  • Honesty and openness—Work in an environment where everyone is open and honest. Discuss issues with everyone so that everyone can help to resolve them.

  • Go with instincts—People have gut instincts for a reason. Learn to work with them and embrace them in your environment; they add value to what the development team is producing.

  • Teach learning—Learning is vital to longevity in the software development world. It is imperative to the long-term success of a team that it encourages learning and teaching among its members.

  • Embrace change—The only certainty in software is that it will change. Learn to embrace this change and love the possibilities that arise from the changes made.

  • Play to win—An attitude of success breeds success; this is very different from “playing not to lose.” Build a record of success stories, and you will win more often.

In his book, Extreme Programming Explained, Kent Beck identified an initial 12 practices that have become the main XP practices; some teams even call this set of practices vanilla XP. It is often said that a team is not using XP unless they use all 12 of these practices. I think this is partly true. If you do not try something, you will not know whether it works. I think that a team can say it is an XP team if it uses many of the practices but has tried all of the practices.

The original 12 practices discussed in Kent’s book are test driven development, planning game, whole team, pair programming, continuous integration, constant refactoring, short releases, simple design, metaphor, collective ownership, coding standards, and sustainable pace. As you can see, the majority of the practices covered in this book fall into the original 12 practices.

Along with these 12 practices, there exists an array of other practices often followed by XP teams. These have evolved and been adopted from other methodologies of development. These extra practices have been popularized via Web sites and forums and then adopted by teams.

Even if you do not (or cannot) use all of these practices, they independently add value to the code you are writing. Techniques such as TDD will help you focus on the task at hand and deliver higher-quality code. Refactoring will enable you to change the structure and design of your system without affecting its behavior. Breaking tasks down into smaller units will enable you to focus on solving the problem one small step at a time. Pair programming will allow two developers to solve a problem that may have caused one person difficulty; it also provides an ongoing peer review of the code. Automating steps in your development process enables you to perform more regular integrations and get more reliable and rapid feedback on the state of the system.

The 4 (+1) Key Values

As previously mentioned, the four key values of XP are communication, simplicity, feedback, and courage. Kent Beck, one of the creators of the term eXtreme Programming and author of the first book on XP, has also added respect as the fifth of the key values. The following subsections briefly discuss each of these values.

Communication

Problems often result because people are not communicating. This is especially true in efforts that are team focused, such as software development. When the team is not openly communicating, the information flow that keeps the team moving forward is damaged.

Bad communication happens for a reason. Communication is not generally seen as an important skill for developers to obtain. In fact, many developers have previous poor experiences of communication. Managers often do not want to hear what is being said. Other developers have their own issues to contend with and do not want to hear about your issues. This experience does not encourage developers to speak out when things need to be said. A few of these experiences may lead to an environment in which communication is at best limited and at worst nonexistent. A junior developer joining such an environment would not know anything was amiss. His lack of experience could lead to the belief that poor communication is how software should be developed.

The proponents of XP (myself included) claim that communication is vital to develop software of value. The information flow created by ongoing communication allows all members of the team to contribute to the final results. This enables a group of individuals to behave as a team with the goal of developing great software.

Many of the XP practices force communication to be prevalent among the development team. Some of these practices such as the planning game, pair programming, and stand-up meetings are obvious mechanisms, but others such as coding standards and refactoring also lead to greater communication, as you will see in later chapters. An XP team uses the role of the coach to police the communication, ensure it is occurring, and encourage the use of practices to overcome any barriers.

Simplicity

“What is the simplest thing that could possibly work?” is a cry often heard in XP teams. This means to do the simplest thing that will enable you to move forward in the right direction.

Don’t plan the future! The future will happen regardless of whether you plan it. By planning the future, you are always avoiding the present. You are avoiding the present now by planning. You are avoiding the present that will be by focusing on where you are in your plan. A common response I get to this is a declaration of my madness. “Of course you have to plan for the future and design the system first; otherwise, how would you ever be able to write the code? Don’t be crazy!” This is so difficult for developers that it is one of the biggest hurdles to overcome when moving into an XP environment.

As you will learn in this book, XP does not promote detailed upfront design of the entire system. The design is done a small part at a time, allowing for greater flexibility in the software being developed. By developing one small piece of functionality at a time, testing first and constantly refactoring, you do not need to design the system; it will design itself! The designs will emerge as an outcome of taking a disciplined approach to using the practices. The team needs to have experience with object-oriented coding and design patterns so that they can see these patterns emerge and work with them. For this reason, tools such as UML are still incredibly valuable; they enable communication of the patterns as they emerge in the system.

The point of keeping things simple is to code for now rather than never. By this I mean that we should code to solve today’s problems for your customers, not problems in the future that might or might not come up. Doing this gives you a far greater chance of solving those problems more rapidly and providing the customer with some value in the short term. If every day you produce something of value for the customer, then after several weeks the software you are building will have a culmination of all that value. This is often a sticking point for developers.

To see how this is possible, you need to understand how the practices enable us to treat the code in a different way than traditional approaches. The unit tests provided by TDD and refactoring techniques enable us to change code more readily. Creating a more fluid code base means we do not need to be concerned if the decisions we make early on are absolutely correct. We can change the design of the entire system more easily than ever before.

This simple code that you (and your team) have written will ship quicker because less can go wrong. Shipping more quickly enables you to get the value to the customer more rapidly and solicit feedback (see next section) more readily.

Simpler code means less to communicate. By keeping the solution as simple as possible, you are aiding the first value we discussed. Having less to communicate means it is easier to communicate and explain what the code is doing and the emerging design.

One final point: Simple does not mean easy. Developers who are starting out often misinterpret this as “Do the easiest thing you can possibly do.” This is incorrect; simple is often a lot harder to achieve than complicated. As you work through this book, you should start to see how by keeping the task you are working on simple you can build more complex solutions. An example presented later in this book is replacing a switch statement with polymorphic behavior. The switch statement is easier to write, but the polymorphism provides a simpler solution.

Feedback

Feedback on your progress enables you to adjust your actions to better meet the goals of the project. Feedback leads to a greater understanding of the state of the system being developed. This understanding tells you exactly what you have done right and what you need to work on. Knowing what you need to work on is incredibly valuable. The feedback acts as a guide for the next set of tasks. Understanding an issue early often averts a potential crisis later on.

If you ask an XP team how they are coming along, you might get a response such as “don’t ask me, ask the system.” XP teams build feedback systems into their software using tests, profiling tools, and automated builds. The results from these are generally posted in very public places, providing feedback on their progress for all to see.

The granularity of the feedback cycles goes from minutes to months. The following identifies some of the practices that support these different timescales.

  • TDD—Developers drive the code development by writing tests first and then the code to make the tests pass. This leaves test code in the system that provides feedback on the stability of the system. An XP team will receive this feedback at intervals of minutes as they work on the code throughout the day.

  • Customer user stories—The practice of letting customers define the functionality their users require on story cards, typically index cards. These story cards are discussed further with the customer when the time comes to implement that functionality. This provides the customer with up-to-the-minute feedback on what is being worked on. (Customer user stories are discussed more in the next chapter.) Most customers will check completed stories daily.

  • Stand-up meetings—When a customer story is completed, the customer is informed. Often the customer will get a demo of the system within a day of a story being completed. This helps to obtain more rapid feedback. The meetings occur daily, and so again this is daily feedback.

  • Short releases—Within the first month or two, an early working version of the software should be ready to ship. This is a goal that every XP team I have worked with has managed to reach. This shipment might be to only a few friendly parties (usually chosen by the customer). Shipping will allow the developers to receive feedback as to the usefulness of the system being developed and the correctness of the functionality. The timeframe for feedback from short releases is in terms of weeks and months.

Simplicity, communication, and feedback create a self-supporting cycle; feedback leads to more communication, communication leads to understanding what to test, simple systems are easier to test, easier to test means more feedback, and so on, as shown in Figure 1-1.

The self-supporting cycle.

Figure 1-1. The self-supporting cycle.

Courage

To use the practices prescribed by XP and get the full value from doing so takes courage. Many of the practices are difficult, and if taken at face value, they don’t seem to make sense. It is this courage to take up the practices and make the results happen that contributes to the extreme in XP.

By employing the safety harnesses provided through the use of the practices, developers can increase the intensity of their work. They can go fast and furious at cutting code that solves the problems at hand. By doing this, developers will find they get more produced but may tire more easily; this is called upping the burn rate and lowering the hours. It is about working hard and fast while at work and then getting out to relax and enjoy life. All of these things take courage to do.

Other aspects that require courage include making changes when needed, not before, and being prepared to throw code away. Both of these practices are alien to many developers and might require a change in the way you think about the code you are writing. As mentioned previously, one of the themes of XP is to lower the cost of change. Writing code that we might need in the future actually increases the cost of change. Code you do not need now is code that we are not using but that needs to be changed. The cost of change can be lowered by not including code until it used. The tests help us to validate this; if we find code that is not being used, we should throw it away because it is encumbering the system needlessly.

Employing just courage alone without the safety nets and harnesses provided by the other values and through following the practices is dangerous, often lethal, to the project. Take care and allow your confidence to grow as you follow the practices so that you can have the courage to communicate new ideas. To ensure these new ideas, keep the system simple. Experiment with new ideas and get feedback on new ideas. These ideas will become the code in your software.

Respect

One of the least-discussed and yet most important values of XP is respect. This is mainly applied on a human level to the people we work and live with. It is through respect that we can learn how other people think. Knowing how people think enables us to adjust our own behaviors to better work together to accomplish the goals for which we are aiming. Let’s start with our own team of developers. The respect for other developers in our team and other teams around us is vital to the health of our environment. Showing humility for other developers will enable us to learn from them.

Although this book is not about building teams, I recommend that every developer who works in a team of more than one person find out more about team-based behaviors. If every developer did this, the world’s software teams would be much more productive.

I believe every member of a team has some value to offer that team, and it often takes work to instill that belief in other members of the team. Showing disrespect for a member of the team is akin to what is described by Jim McCarthy[6] as “flipping the bozo bit”; each team member has a bozo bit. Initially, none of us is a bozo, and the bits are all off. When you flip the bit on, that person becomes a bozo and has to work hard to switch the bit off. It is important to respect our fellow team members and not “flip the bit” on them.

The management in an organization has a job to do. It often does not include writing code, but this does not make them any less valuable to the project. The management is there to help make your life easier so you can accomplish the job at hand. Have respect for the managers. They are often under pressure to perform and deliver. If you have respect for this, you can work together as a team to accomplish far more than is possible by working against each other.

Finally, it is imperative to respect the users of your software. In one survey done on a piece of software that had been released, 500 users were asked to carry out tasks with the software. The results were disappointing; more than 90 percent of the users failed to carry out all the tasks. The developers, when told this, responded with, “Where did you find so many stupid users?” This lack of respect for the users led to the creation of a piece of software that had all the functionality but was incredibly hard to use; this was not valuable for their business or the customer’s business and the software had to be changed to make it more user friendly. It is important to respect the users and understand how they will use the software.

Conclusion

You should now have a better idea of what XP is and what you can gain from it. XP might not be for all of us, and some areas of business may never find it suitable for their development methodology. However, we can all learn things from the XP practices. The rest of this book takes you through the techniques you can apply every day, even if you are not working in an XP development team. In the next chapter, we start this process by learning pair programming and how two developers can work together to solve problems and write better code.

1.

“Turning the volume up” means taking something that works well and making it work even better.

2.

The eXtreme .NET team is introduced in Chapter 0.

3.

Story cards are explained in Chapter 2.

4.

Gamma, Erich, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns. Reading, Massachusetts: Addison-Wesley Professional, 1995.

5.

Gladwell, Malcolm. The Tipping Point. Boston, Massachusetts: Back Bay Books, 2002. This book describes the broken-window theory.

6.

McCarthy, Jim. Dynamics of Software Development. Redmond, Washington: Microsoft Press, 1995.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.198.60