Articles

What is extreme programming (XP) ?, on what values, principles and practices is it based

You are familiar with programming, but Extreme Programming (XP for short) is still a bit of a mystery to you.

Don't let the name put you off, you risk missing out on useful information.

In this article, we're going to cover everything you need to know about Extreme Programming so you can use it to your advantage.

What is extreme programming (XP)?

Extreme programming is a software development methodology that is part of what is collectively known as agile methodologies. XP is built on values, principles and practices, and its goal is to enable small and medium-sized teams to produce high-quality software and adapt to ever-changing and evolving requirements.

What distinguishes XP from other agile methodologies is that XP emphasizes the technical aspects of software development. Extreme programming is precise about how engineers work as following engineering practices allows teams to deliver high quality code at a sustainable pace.

Extreme programming is, in a nutshell, good practices taken to an extreme. Since pair programming is good, let's do it all the time. Since testing in advance is good, we test before production code is even written.

How does extreme programming (XP) work?

XP, unlike other methodologies, is based on values ​​and principles that are important and relevant, in terms of engineering practices.

Values ​​provide purpose to teams. They act as a "north star" to guide your decisions at a high level. However, the values ​​are abstract and too fuzzy for specific guidance. For example: Saying you value communication can lead to many different results.

Practices are, in a sense, the opposite of values. They are concrete and down to earth, defisetting the specifics of what to do. Practices help teams hold themselves accountable for values. For example, the practice of information workspaces promotes transparent and simple communication.

Principles are domain-specific guidelines that bridge the gap between practices and values.

The Values ​​of Extreme Programming XP

XP values: communication, simplicity, feedback, courage and respect. Let's look at each of them in more detail.

Values ​​and Principles of Extreme Programming

Staff BlogInnovazione.it of the image alexsoft.com

Communication: Lack of communication prevents knowledge from flowing within a team. Often, when there's a problem, someone already knows how to fix it. But lack of communication prevents them from learning about the problem or contributing to its solution. Thus, the problem ends up being solved twice, generating waste.

Simplicity: Simplicity says that you always strive to do the simplest thing that works. It is often misunderstood and taken as the simplest thing, period, ignoring the "that works" part.

It's also vital to remember that simplicity is highly contextual. What is simple for one team is complex for another and depends entirely on the skills, experience and knowledge of each team.

Feedback: Feedback in more traditional, cascading software development methodologies is often “too little, too late”.

XP, however, embraces change and XP teams strive for timely and constant feedback. If course correction is needed, XPers want to know as soon as possible.

Cycle of extreme programming

Staff BlogInnovazione.it of the image alexsoft.com

Feedback comes in many shapes and sizes. When you're partnered programming, comments from your colleague are vital feedback. So are other team members' opinions on an idea, including the customer who, ideally, is a member of the team.

Tests are another source of valuable feedback that goes beyond test results. Whether writing tests is easy or difficult, so is feedback. If you're having trouble writing tests, your project is probably too complex. Listen to feedback and streamline your design.

Something that sounds like a great idea may not work so well in practice. Hence, finished code is also a source of feedback, as is a distributed product.

Finally, keep in mind that there is too much feedback. If a team generates more feedback than it can handle, important feedback could fall off the radar. So it's essential to slow down and figure out what's causing the excess feedback and fix it.

Courage: Kent Beck deficourage emerges as “effective action in the face of fear”. As a software engineer, you have a lot to fear and therefore plenty of opportunities to show courage.

It takes courage to tell the truth, especially the unpleasant ones, such as honest estimates. Giving and receiving feedback also takes courage. And it takes courage to avoid falling into the sunk cost fallacy and discard a failing solution that has received substantial investment.

Compared: A fundamental premise of XP is that everyone cares about their work. No amount of technical excellence can save a project if there is no care and respect.

Every person is worthy of dignity and respect, and that includes, of course, the people involved in a software development project. When you and your team members respect and care for each other, the client, the project and its future users, everyone benefits

The Principles of Extreme Programming XP

Principles provide more specific guidance than values. They are guidelines that illuminate the values ​​and make them more explicit and less ambiguous.

Staff BlogInnovazione.it of the image alexsoft.com

For example, based on the value of courage alone, you might conclude that it is advisable to make a big change in your schedule right away. However, the Baby Steps principle tells us that big changes are risky. So, prefer the small ones instead.

Humanity: Humans create software for humans, an often overlooked fact. But taking into consideration basic human needs, strengths and weaknesses creates products that humans want to use. And a work environment that offers you the opportunity for fulfillment and growth, the feeling of belonging and basic security, is a place where you more easily consider the needs of others.

Economy: In XP, teams always pay attention to the economic realities of software development, constantly evaluate economic risks and project needs.

For example, they would implement user stories based on their business value rather than technical concerns.

Mutual benefit: After XP, you avoid solutions that benefit one party at the expense of another. For example, extended specs might help someone else understand it, but it distracts you from implementing it and delays it for your users.

A mutually beneficial solution is to use automated acceptance tests. Get instant feedback on your implementation, your peers get precise specs in code, and users get their features first. Plus, all of you will have a safety net against regressions.

Benefit (Mutual Benefit): If a given solution works at one level, it may also work at a higher or lower level. For example, getting early and constant feedback is at stake to varying degrees in XP.

  • at the developer level, programmers get feedback from their work using the test-first approach;
  • at a team level, the continuous integration pipeline integrates, builds, and tests code multiple times a day;
  • Organizationally, the weekly and quarterly cycles allow teams to get feedback and improve their work as needed.

Improved: According to the principle of improvement, teams do not aim for perfection in an initial implementation, but for an implementation that is good enough, and then continuously learn and improve it with feedback from real users.

Diversity: You and your colleagues benefit from a diversity of perspectives, skills and attitudes. Such diversity often leads to conflict, but that's okay.

Conflict and disagreement are opportunities for better ideas to emerge when everyone plays by the values ​​of courage and respect. Courage to express opposing points of view, respect in expressing them in a civil and empathic way. And all of this is an effective communication exercise.

Reflection: Great teams reflect on their work and analyze how to be better. XP offers many opportunities for this. Not just in its weekly and quarterly cycles, but in every practice it promotes.

Feelings are important to consider in addition to logical analysis. Your gut can inform you before you can reason about anything. And so he can talk to non-technical people, they can ask questions that open up completely new possibilities.

Flow: Traditional software development methodologies have distinct phases, which last a long time and have little opportunity for feedback and course correction. Instead, software development in XP occurs in activities that occur continuously, in a consistent "stream" of value.

Opportunity for insertion into a young, dynamic, and educational context: Problems are inevitable in software development. However, every problem is an opportunity for improvement. Learn to look at them this way and you are much more likely to come up with creative and goal-oriented solutions that also serve to prevent them from happening again.

Redundancy: The principle of redundancy says that if a given problem is critical, you must employ many tactics to counter it.

Take the flaws. There is no single tactic that can prevent all defects from escaping production.

So XP's solution is to stack a set of quality measures. Pair programming, testing, continuous integration. Each a single line of defense, together a virtually impenetrable wall.

Failure: failure is not a waste when it translates into knowledge. Taking action and quickly learning what doesn't work is much more productive than inaction caused by indecision when choosing among many options.

Quality: People often think that there is a dilemma between quality and speed.

It's the other way around: pushing to improve quality is what makes you go faster.

Innovation newsletter
Don't miss the most important news on innovation. Sign up to receive them by email.

For example, refactoring—changing the structure of code without changing its behavior—is a practice that makes code easier to understand and change. As a result, you're less likely to introduce code defects, which allows you to deliver more value first by not having to fix bugs.

Little steps: Big changes are risky. XP mitigates that risk by making changes in small steps, at every level.

Programmers write code in small steps using test-driven development. They integrate their code into the mainline multiple times a day, instead of just every few weeks or even months. The project itself takes place in short cycles rather than long-lasting phases.

Responsibility accepted: In XP, responsibility should be accepted, never assigned.

Accountability should come with the authority to make decisions about what you are responsible for. The opposite is also true. You don't want people making decisions if they don't have to live with their consequences.

Similarities and Differences with traditional and non-agile methods

Extreme programming, being an agile methodology, can be accepted and started to adopt it without following rigid plans. This is an iterative design rather than a big initial project.

XP differs significantly from traditional methodologies, i.e. cascading, avoiding long-lasting phases.

  • Instead of a planning phase, in XP you plan at the beginning of each development cycle which is usually only a week long.
  • Instead of testing episodes, test your application as early as possible: that is, before the actual code is implemented.
  • Instead of rolling out features in isolation during long implementation phases and then struggling to merge your contributions to the mainline, you work in small chunks and integrate them as often as possible

How is XP different from other agile methodologies?

Extreme programming, by its nature, has a lot in common with other agile methodologies but is also unique among them.

Most other development methodologies don't say much, if anything, about how to get the job done. XP, on the other hand, is very opinionated when it comes to this and places great emphasis on software engineering practices.

Extreme Programming versus Scrum

Scrum is a framework to help teams develop complex projects in an adaptive way. Scrum doesn't dictate how developers do their work. XP, as mentioned, places a lot of emphasis on good programming practices.

Scrum framework

Staff BlogInnovazione.en Image net solutions

Also, XP is obviously about programming. Scrum, on the other hand, can be applied to any project that benefits from an iterative approach.

XP accepts changes to its components. Teams are empowered and even encouraged to modify practices based on their specific needs. The Scrum Guide, on the other hand, is adamant that "Although only parts of Scrum can be implemented, the result is not Scrum."

Also, Scrum is a framework that needs to be complemented with methodologies and practices to get the job done.

This means that working in extreme programming and Scrum is highly recommended.

Roles and responsibilities

According to Kent Beck, a mature XP team shouldn't assign rigid roles, but recognize that roles can be useful for fledgling teams until they start to slow down or make collaboration difficult.

Let's look at some key roles:

  • Client: Ideally, the customer should be on site to answer questions, prioritize user requirements, or assist with acceptance testing. When this is not possible, this role could be filled by a customer representative.
  • Programmers: On an XP team, programmers estimate the effort required to complete tasks, write automated tests, and implement stories.
  • Coach: it is not necessary to have a coach and it is possible to reach the goal without having one. However, having someone with XP experience, to coach a team can ensure that team members follow practices, turn them into habits, and don't revert to the old ways.
  • Tracker- A tracker tracks team progress metrics and talks to each team member to identify issues and find solutions. The tracker calculates metrics that indicate how well the team is doing, such as speed and burndown graphs, or the team uses a digital scrum or kanban board that automatically calculates them.

Methods and techniques

These are the practices adopted in XP. They are divided into three main groups: software engineering, workplace and project management.

Software engineering

Pair programming: In XP, you write code in pairs sitting on a machine. You and your couple talk to each other as you analyze, implement, and test the feature you're working on. Pair programming is especially good at producing code with fewer bugs while still being engaging, fun, and tiring.

Ten minute limit: Required Allows 10 minutes to build the entire project, including running all automated tests, in ten minutes maximum. This limit is to keep testing streamlined and effective.

Tests before programming: implement features using the test-first approach, also called test-driven development (TDD). TDD consists of development using a simple iterative procedure:

  • write code after a test fails;
  • then, write production code to pass the test;
  • if necessary, refactor your production code to make it cleaner and easier to understand.

TDD brings several benefits.

First, feedback. If it's difficult to write a test, the design you're looking for or that you've inherited is probably too complex and you need to simplify it.

Secondly, TDD allows programmers to trust the code they write and creates a nice looping rhythm where the next step is always clear.

Last but not least, using TDD from the start ensures 100% code coverage. The test suite then truly becomes a safety net for future changes, encouraging code refactoring and creating a virtuous circle of quality.

Incremental design: The practice of incremental design means that you need to invest in your application design every day, looking for opportunities to remove duplication and make small improvements to achieve the best possible design for what your system needs today.

Continuous integration: In XP, you integrate your work into the main shared repository several times a day, triggering an automatic build of the entire system. Integrating as early and as often as possible dramatically reduces the cost of integration as it makes merges and logical conflicts less likely to occur. It also exposes environmental and addiction issues.

Shared code (collective ownership): XP promotes shared code, or collective ownership: each developer is responsible for all code. It encourages information exchange, reduces the team bus factor and increases the overall quality of each module if we consider the principle of diversity.

Single CodeBase: Single codebase is also known as “trunk-based development”. It means that there is only one source of truth. So instead of developing in isolation for long periods of time, merge your contributions into a single stream early and frequently. Feature flags help limit your use of features until they're complete.

Daily distribution: deployment in production at least once a day is a logical consequence of continuous integration:. In fact, today, many teams go even further and practice continuous implementation. That is, whenever someone joins the mainline, the application is deployed to production.

Code and tests: This practice means that source code, including tests, is the only permanent artifact of a software project. Engaging in the generation of other types of artifacts, including documentation, is often wasteful because it doesn't generate real value for the customer.

If you need other artifacts or documents, make an effort to generate them from production code and tests.

Root cause analysis: Whenever a defect goes into production, don't just correct the defect. Make sure you figure out what caused it in the first place, why you and your teammates failed to prevent the skid. Then, take steps to make sure it doesn't happen again.

Work environment

Sit together: In XP, teams prefer to work together in an open space. This practice promotes communication and a sense of belonging to a team.

The whole team: Everyone who is needed for the success of the project is part of the XP team. This is highly contextual – different for each team – and dynamic, it can change within a team.

Information workspaces: An information workspace uses the physical space of the team to display information that allows anyone to know, at a glance, the progress of the project. How this is done can vary, from physical notes and graphs to screenshots showing Kanban boards and dashboards from project management software.

Energized work: In XP, you only work as long as you can do energetic work. Working hours must be limited to 40 per week, maximum.

Project management

Analysis- Write user requirements in a format known as user analysis. A user analysis has a short, descriptive name and also a short description of what needs to be implemented.

Slack: When planning a cycle, add minor tasks that the team can abandon if the need arises. More stories can always be added if the team delivers too much.

Cycles (monthly and weekly): Development in XP occurs in two main cycles: the weekly cycle and the monthly cycle.

Meetings, cycles, scheduled releases: Development in XP works in two main cycles: the weekly cycle and the quarterly cycle. Initially, Kent Beck recommended a two-week cycle, but changed that in the second edition of his book.

Weekly cycle: the weekly cycle is the "pulse" of an XP project. The cycle begins with a meeting in which the client chooses which stories he wants to create during the week. Additionally, the team reviews their work, including last week's progress, and thinks about ways to improve their process.

Monthly cycle: Every month, the team reflects and identifies improvement opportunities in their process. The client chooses one or more themes for that month, along with the analyzes in these themes.

How to start working with extreme programming ?
Technical skills and XP habits can be hard to learn. Some of the practices may seem foreign to programmers not used to them.

Ercole Palmeri

Innovation newsletter
Don't miss the most important news on innovation. Sign up to receive them by email.

Latest Articles

Innovative intervention in Augmented Reality, with an Apple viewer at the Catania Polyclinic

An ophthalmoplasty operation using the Apple Vision Pro commercial viewer was performed at the Catania Polyclinic…

May 3, 2024

The Benefits of Coloring Pages for Children - a world of magic for all ages

Developing fine motor skills through coloring prepares children for more complex skills like writing. To color…

May 2, 2024

The Future is Here: How the Shipping Industry is Revolutionizing the Global Economy

The naval sector is a true global economic power, which has navigated towards a 150 billion market...

May 1, 2024

Publishers and OpenAI sign agreements to regulate the flow of information processed by Artificial Intelligence

Last Monday, the Financial Times announced a deal with OpenAI. FT licenses its world-class journalism…

April 30 2024