Agile is actually an umbrella term, and there are certain characteristics that all agile development processes must follow. So, several methodologies come under the agile umbrella, and one of the prominent methodologies is Extreme Programming, and Kent Beck proposed it in 1999.
Extreme Programming – It recommends taking the best practices to extreme levels. If something is good, why not do it all the time. In other words, if something works and it is good, then why not maximize its uses.
Extreme Programming – Taking good practices to the Extreme
Code Review: Research suggests that code review is the best practice to avoid bugs and logical errors, which may not be detected by testing. So, if code review is good, then take code review to the extreme level by pair programming. In pair programming, the code is written by two programmers on one desk, and it’s like one programmer writes a code while the other programmer reviews the code. And, after a certain duration, approximately an hour, they interchange their roles.
Testing: If testing is good and makes the software more reliable, test to the extreme level. The extreme programming suggests writing the test cases continuously, called Test-Driven Development (TDD). In Test-Driven development, even before the code is written, the test cases are written. After completion of coding, test cases will be run, and if it fails, then code will be modified, and test cases will be executed again and again until it passes all the test cases.
Incremental Development: Incremental development is good, and it eliminates a lot of problems of the waterfall model, and there, extreme programming comes up with a new increment then comes up with new increments every few days.
Simplicity: Simplicity is good because it produces fewer bugs, easy to maintain, and therefore, extreme programming says to take simplicity to the extreme level. The simplest design only focuses on the currently required functionality, and no need to think about future requirements, if any.
So, pair programming, test-driven development, incremental development, simplicity of the design are the important characteristics of extreme programming.
Design: To take the design extreme, everybody will design daily, and it is called refactoring.
Architecture: Architecture’s overall design is also taken to the extreme. The agile principle says that everybody will define and refine the metaphor.
Integration Testing: Integration testing is also important, and build the integrate test several times a day.
Extreme Programming – Four Values
Communication: Communication among the team members and with the customers is a must in XP.
Simplicity: Build something simple that will work today rather than something that takes time and yet never used. It is like do not pay much attention to tomorrow.
Feedback: Take continuous customer feedback, and they must be part of the team.
Courage: Don’t hesitate to discard a bad code, and if the code structure has become bad, then discard it and write new code.
Extreme Programming – Activities
Planning: XP planning begins with creating user stories, and each story or requirement is assigned a cost. These stories are grouped into deliverable increments, and XP planning is carried out only for an increment.
Design: XP design follows a Keep It Simple, Stupid (KISS) principle and encourages Class Responsibility Collaborator (CRC) cards. Whenever there is confusion about the best way to go, it suggests creating a spike solution (i.e., prototype). After a prototype works, refactor and put it into the design. It encourages refactoring – an iterative refinement of the internal program design.
Coding: It recommends the construction of unit test cases before coding commences. It is a test-driven development approach where the test cases are written even before the code is written. Also, pair programming is encouraged in a coding activity.
Testing: All unit tests are executed daily, and acceptance tests are defined by the customer and executed to assess customer visible functionalities.
Extreme Programming – Best Practices
- Planning: Determine the scope of the next release by combining business priorities and technical estimates.
- Small releases: Put a simple system into production, then release new versions in very short cycles.
- Metaphor: All development is guided by a simple shared story of how the whole system works.
- Simple Design: The system is to be designed as simply as possible.
- Testing: Programmers continuously write and execute unit tests.
- Refactoring: Programmers continuously restructure the system without changing its behavior to remove duplication and simplify.
- Pair-programming: All production code is written with two programmers on one machine.
- Collective ownership: Anyone can change any code anywhere in the system at any time.
- Continuous Integration: Integrate and build the system many times a day – every time a task is completed.
- 40-hour week: Work no more than 40 hours a week as a rule.
- On-site customer: A user is a part of the team and available full time to answer questions.
- Coding standards: Programmers write all code in accordance with rules emphasizing communication through the code.
Extreme Programming – Suitability for the type of Projects
Extreme programming agile methodology is suitable for small projects that involve new technology or research work, where the requirements change rapidly, and unforeseen technical problems may coexist.
Summary
Extreme programming emphasizes Test-Driven Development(TDD), and any increment starts with a user story. The developer develops test cases, implements a quick and dirty feature every couple of days, and gets customer feedback to alter or incorporate changes. Later refactor it and take up the next increment, and so on. This methodology is successful in small projects and challenging projects, like new technology or research projects. In these cases, the requirements change rapidly, and unforeseen technical problems need to be resolved.
Reference
- Fundamentals of Software Engineering Book & NPTEL Video Lectures by Rajib Mall.
152 total views, 1 views today