CSC/ECE 517 Fall 2012/ch2a 2w8 vp: Difference between revisions
(28 intermediate revisions by 2 users not shown) | |||
Line 11: | Line 11: | ||
== What is extreme programming == | == What is extreme programming == | ||
Extreme Programming (XP) is a software development methodology created by Kent Beck during his work on the Chrysler Comprehensive Compensation System (C3) payroll project. Extreme Programming is intended to improve software quality and responsiveness to changing customer requirements. It is a one of the several types of agile software development processes. Extreme Programming is successful because it stresses customer satisfaction. Instead of delivering everything you could possibly want on some date far in the future this process delivers the software you need as you need it. Extreme Programming empowers developers to confidently respond to changing customer requirements, even late in the life cycle. | '''[http://en.wikipedia.org/wiki/Extreme_programming Extreme Programming]''' (XP) is a software development methodology created by '''[http://en.wikipedia.org/wiki/Kent_Beck Kent Beck]''' during his work on the Chrysler Comprehensive Compensation System (C3) payroll project. Extreme Programming is intended to improve software quality and responsiveness to changing customer requirements. It is a one of the several types of '''[http://en.wikipedia.org/wiki/Agile_software_development agile software development processes]'''. Extreme Programming is successful because it stresses customer satisfaction. Instead of delivering everything you could possibly want on some date far in the future this process delivers the software you need as you need it. Extreme Programming empowers developers to confidently respond to changing customer requirements, even late in the life cycle. | ||
[[#top|Back to top]] | [[#top|Back to top]] | ||
== Concepts of XP == | == Concepts of XP == | ||
[[ | ===Goals=== | ||
Extreme Programming is a software-development discipline that organizes people to produce higher quality software more productively. | |||
The main goals are: | |||
# Attempt to reduce the cost of changes in requirements by having multiple short development cycles | |||
# Changes are a natural and a desirable aspect of software-development projects, and should be planned for in advance. | |||
===Activities=== | |||
XP describes four basic activities that are performed within the software development process: designing, coding, testing, listening as described below: | |||
====Coding==== | |||
The guiding principle of XP is that without code, there is no working product. Hence, importance is given to code rather than documentation for various aspects. | |||
Coding can also help to communicate thoughts about problems. A programmer dealing with a complex programming problem, might prototype it in a simplified manner and use it to demonstrate what he or she means. Code is always clear and concise and makes the problem unambiguous. | |||
====Testing==== | |||
Extreme programming's approach is that a lot of testing can eliminate many flaws in the product. | |||
Unit tests are performed to determine whether a given unit of the product works as intended. A programmer writes as many automated tests as they can think of that might "break" the code. Only if all tests run successfully, then the coding is complete. Every piece of code that is written is tested before moving on to the next feature. | |||
'''[http://en.wikipedia.org/wiki/Acceptance_testing Acceptance tests]''' verify that the components delivered the programmers satisfy the customer's actual requirements. | |||
====Listening==== | |||
The Programmers must listen to what the customer requirements are clearly, and what '''[http://en.wikipedia.org/wiki/Business_logic business logic]''' is needed and give feedback about the technical aspects of how the problem might be solved, or cannot be solved. Effective communication between the customer and the development team is essential to get the product working as intended. Hence, listening is a very important aspect of XP. | |||
====Designing==== | |||
Creating a design structure organizes the components of the system. Good design will avoid lots of dependencies within a system and will focus on low '''[http://en.wikipedia.org/wiki/Coupling_(computer_science) Coupling]''' and high '''[http://en.wikipedia.org/wiki/Cohesion_(computer_science) Cohesion]'''. Without a proper design the system becomes too complex and the dependencies within the system cease to be clear. | |||
== Four values in XP == | == Four values in XP == | ||
*'''Simplicity''': Keeping code simple makes changing code easier as the requirements inevitably change. Simple solutions to today's problems minimizes the cost of change over time. For example it is ten times harder to fix a mistake of requirements when you are in the design phase, and 100 times harder to make changes late in a project during the coding phase. simple designs minimizes the risk of spending a long time designing sophisticated frameworks that the customer may not use/want. | |||
[[File:simple.jpg| center]] | |||
One important point to note is that XP approach recognizes that the cost of change generally increases like one would expect, but this increase is not always increasing. If the code is refactored and kept simple, we can avoid ever-increasing complexity. | |||
*'''Communication''': With respect to programmers, code communicates best when it is simple else once should strive to simplify it. Another form of communication is '''[http://en.wikipedia.org/wiki/Unit_testing Unit Tests]''', Unit tests exercise the classes and methods in your application,Unit tests communicate the design of a class effectively.Programmers communicate to with one another because they program in pairs('''[http://en.wikipedia.org/wiki/Pair_programming Pair Programming]''').There is no set observer in a pair. XP requires an on-site customer to convey the requirements to the team. The customer decides which features are most important, and is always available to answer questions. | |||
*'''Feedback''': On-site customer the means to get immediate feedback about the project status. There are short release cycles, where the customer is able to evaluate each new feature as it is developed, minimizing the necessity to rework and helping the programmers focus on what is most important to the customer. The customer always defines which features are the most important, so the most valuable features are delivered early in the project. Customers can cancel the project at any time and have a working system with the features as per the last release. | |||
*'''Courage''': For managers, the concept of pair programming can be hard to accept—it seems like productivity will drop by 50%, because only half of the programmers are writing code at any given time. It takes courage to trust that pair programming improves quality without slowing down progress. It takes courage to implement the feature the customer is asking for today using a simple approach, because you probably want to build in flexibility to account for tomorrow's features, as well.Everyone gives and feels the respect they deserve as a valued team member. Everyone contributes value even if it's simply enthusiasm. Developers respect the expertise of the customers and vice versa. Management respects our right to accept responsibility and receive authority over our own work. | |||
[[#top|Back to top]] | [[#top|Back to top]] | ||
== Aspects in key practices == | == Aspects in key practices == | ||
There are 19 key practices: | |||
*Joint | |||
*Common Vocabulary | |||
*Iterations | |||
*Open Workspace | |||
*Retrospectives | |||
*Development | |||
*Test-First Development | |||
*Pair Programming | |||
*Refactoring | |||
*Collective Ownership | |||
*Continuous Integration | |||
*Just-In-Time Design | |||
*Customer | |||
*Storytelling | |||
*Release Planning | |||
*Acceptance Tests | |||
*Frequent Releases | |||
*Management | |||
*Accepted Responsibility | |||
*Air Cover | |||
*Quarterly Review | |||
*Mirror | |||
*Sustainable Pace | |||
Lets understand some of the practices in more detail. | |||
'''Pair-Programming''':<br> | |||
XP teams work in pairs where they share a single computer, keyboard, and mouse. | |||
Flow:<br> | |||
*Programmer picks a User Story. | |||
*Programmer1 asks for help from another Programmer2. | |||
*Programmer1 and Programmer2 work to implement the functionality. | |||
*After the immediate task is completed, programmer1 picks another partner to complete the remaining task or offers help to someone else. | |||
''Advantage'':<br> | |||
*Partners rotate frequently and hence facilitate communication. | |||
*Paring with experienced programmers beginners gain valuable coding experience. | |||
*While one person writes programs other gets time to think about the problem at higher level of abstraction. | |||
'''Collective Ownership''': | |||
*Every team member can work on any part of code in the application. There is constant shuffling and change of roles. | |||
*Collective code ownership works because any team member can ask for help when he/she works on unfamiliar classes. | |||
*It’s easier to catch errors when you have a set of unit cases to rely on. If a new change introduced by a partner breaks the code, it can be easily tracked before the code is integrated. | |||
*Shared ownership model avoids the problem situations where the entire team depends on the one person who understands a part of code. | |||
*It encourages high design quality because every functionality is subject to continuous refactor and modification. | |||
'''User – Stories''':<br> | |||
*Used to estimate for the release planning meeting. | |||
*Easy to comprehend as compared to large requirement documents. | |||
*Very intuitive since they reflect what customers expect hence drive the creation of acceptance test. | |||
*User stories provide enough detail to make a low risk estimate of the time the story will take to implement. | |||
*Each story will be 1, 2 or 3 week estimate in "ideal development time" which is the time it would take to implement the story in code if there were no distractions and the programmers know what to do. If its more than 3 weeks then the stories need to be broken down into simpler stories. | |||
*Avoid details of technology, data base layout, and algorithms being used. | |||
'''Automated – Testing''': | |||
XP is highly dependent on unit testing. Testing provide the safety net enabling pairs of programmers to make changes to any piece of code with courage. In this way programmers are more responsible for the code they create. Also each class have a suite of automated unit test. So before any changes are made to the code below procedure (Test Driven Development.) is followed. | |||
Testing new feature: | |||
XP teams write tests before each new feature is added to the system. Here is the test-driven process: | |||
# Run the suite of unit tests for the entire project, ensuring that they all pass. | |||
# Write a unit test for the new feature. | |||
# You probably have to stub out the implementation in order to get your test to compile. | |||
# Run the test and observe its failure. | |||
# Implement the new feature. | |||
# Run the test again and observe its success. | |||
Also Acceptance Testing is done to test high-level application functionality. This kind of test involves and is driven by the customer. When you need to test high-level application functionality, turn to acceptance testing. This sort of testing is driven by the customer, although they will probably need help from a programmer to implement the tests. Acceptance tests should be designed to pass or fail, and they should be as automated as possible. Unlike unit tests, however, acceptance tests do not have to pass at 100%. | |||
'''Small Releases''': | |||
Below are the activities which involve small release planning: | |||
#Prioritize the work. Arrange tasks by difficulty. Assign a low value to a simple task | |||
#Make a plan. | |||
#Customers, managers and developers must be involved. | |||
#Define task from specification into user-stories | |||
#Break down large tasks if possible | |||
#Estimate how much time is needed. Can measure absolutely or relatively in terms of Hours or Story Points | |||
#Important questions to ask, What should be completed first? Are tasks not necessary? Will the tasks take too long? | |||
#Customer feedback important | |||
#Developers can also decide what tasks are important. | |||
#Decide what will be done in each iteration | |||
#Velocity: Amount of work per iteration Also, if velocity is unknown estimate or do a test iteration. | |||
#Each release plan has some sprints(one to two weeks long). We assign features to each sprint | |||
Then we determine the velocity in terms of story points per sprint. | |||
'''Continuous Integration''': | |||
#Code should be integrated and committed to repository every few hours. Hence holding on to changes is avoided. | |||
#Everyone is made to work on the same version as everyone else in the project. And its individual programmers responsibility to integrate their own code when ever a reasonable break presents itself. | |||
#Helps avoid avoids or detects compatibility problems early. | |||
#There is no addition cost or time needed to integrate the system. More commonly explained by the phrase “pay me now or pay me more later”. | |||
[[#top|Back to top]] | [[#top|Back to top]] | ||
Line 36: | Line 165: | ||
*On-Site Customer - Can give quick and knowledgeable answers to real development questions. Makes sure that what is developed is what is needed. Functionality is prioritized correctly | *On-Site Customer - Can give quick and knowledgeable answers to real development questions. Makes sure that what is developed is what is needed. Functionality is prioritized correctly | ||
*40-Hour Week – Most developers lose effectiveness past 40-Hours. Value is placed on the developer’s well-being. Management is forced to find real solutions | *40-Hour Week – Most developers lose effectiveness past 40-Hours. Value is placed on the developer’s well-being. Management is forced to find real solutions | ||
*Continuous Integration - Reduces to lengthy process. Enables the Small Releases practice | *Continuous Integration - Reduces to lengthy process. Enables the '''[http://www.versionone.com/Agile101/Agile-Development-Release-Planning/ Small Releases practice]''' | ||
*Collective Ownership - Helps mitigate the loss of a team member leaving. Promotes developers to take responsibility for the system as whole rather than parts of the system | *Collective Ownership - Helps mitigate the loss of a team member leaving. Promotes developers to take responsibility for the system as whole rather than parts of the system | ||
*Pair Programming – Two heads are better than one. Focus Two people are more likely to answer the following questions: Is this whole approach going to work? What are some test cases that may not work yet? Is there a way to simplify this? | *Pair Programming – Two heads are better than one. Focus Two people are more likely to answer the following questions: Is this whole approach going to work? What are some test cases that may not work yet? Is there a way to simplify this? | ||
Line 54: | Line 183: | ||
*Contract Issues | *Contract Issues | ||
*Misconception on the cost of change | *Misconception on the cost of change | ||
*Tailoring | *'''[http://en.wikipedia.org/wiki/Taylorism Tailoring]''' | ||
*Coding Standards – Degrading the quality of inline documentation | *Coding Standards – Degrading the quality of inline documentation | ||
*On-Site Customer – Difficult to get an On-Site Customer. The On-Site customer that is given may not be fully knowledgeable about what the company may not have authority to make many decisions. Loss of work to the customer’s company. | *On-Site Customer – Difficult to get an On-Site Customer. The On-Site customer that is given may not be fully knowledgeable about what the company may not have authority to make many decisions. Loss of work to the customer’s company. | ||
Line 61: | Line 190: | ||
*Collective Ownership - Loss of accountability. Limitation to how much of a large system that an individual can practically “own” | *Collective Ownership - Loss of accountability. Limitation to how much of a large system that an individual can practically “own” | ||
*Pair Programming – Many tasks really don’t require two programmers. A hard sell to the customers. Not for everyone | *Pair Programming – Many tasks really don’t require two programmers. A hard sell to the customers. Not for everyone | ||
*Refactoring – Not everyone is capable of refactoring. Refactoring may not always be appropriate. Would upfront design eliminate refactoring? | *'''[http://en.wikipedia.org/wiki/Code_refactoring Refactoring]''' – Not everyone is capable of refactoring. Refactoring may not always be appropriate. Would upfront design eliminate refactoring? | ||
*Testing – Automated unit testing isn’t for everything. Reliance on unit testing isn’t a good idea. A test result is only as good as the test itself | *Testing – Automated unit testing isn’t for everything. Reliance on unit testing isn’t a good idea. A test result is only as good as the test itself | ||
*Simple Design – What is “simple?”. Simple isn’t always best | *Simple Design – What is “simple?”. Simple isn’t always best | ||
*Metaphor – Often the metaphor is the system. Another opportunity for miscommunication. The system is often not well understood as a metaphor | *Metaphor – Often the metaphor is the system. Another opportunity for miscommunication. The system is often not well understood as a metaphor | ||
*Small Releases – Not easy for all projects. Not needed for all projects. Versioning issues | *Small Releases – Not easy for all projects. Not needed for all projects. '''[http://en.wikipedia.org/wiki/Software_versioning Versioning]''' issues. | ||
*The Planning Game – Customer availability. Is planning this often necessary? | *The Planning Game – Customer availability. Is planning this often necessary? | ||
Line 71: | Line 200: | ||
== Comparison with waterfall model == | == Comparison with waterfall model == | ||
Waterfall approach emphasizes on clear definition from the beginning of project. Its strengths are ability to analyse potential changes easily, large and distributed teams are well-coordinated, predictable budgets, and only needs small involvement from subject matter experts. But there are some clear disadvantages also. For example lack of flexibility, difficulty in predicting actual needs for the software, the loss of intangible knowledge between phases, discouragement of team cohesion, and the tendency to not discover design flaws until the testing phase. In reality it is very difficult for projects to follow the sequential flow of the model. It is difficult to identify all requirements and goals at the beginning of projects as requirements tend to change all the way. A working version can only be obtained late in the process. | '''[http://en.wikipedia.org/wiki/Waterfall_model Waterfall]''' approach emphasizes on clear definition from the beginning of project. Its strengths are ability to analyse potential changes easily, large and distributed teams are well-coordinated, predictable budgets, and only needs small involvement from subject matter experts. But there are some clear disadvantages also. For example lack of flexibility, difficulty in predicting actual needs for the software, the loss of intangible knowledge between phases, discouragement of team cohesion, and the tendency to not discover design flaws until the testing phase. In reality it is very difficult for projects to follow the sequential flow of the model. It is difficult to identify all requirements and goals at the beginning of projects as requirements tend to change all the way. A working version can only be obtained late in the process. | ||
Below is a picture of how agile methodologies differ from traditional | Below is a picture of how '''[http://en.wikipedia.org/wiki/Agile_software_development agile methodologies]''' differ from traditional '''[http://en.wikipedia.org/wiki/Waterfall_model Waterfall Model]'''. | ||
[[File:Agile-1.jpg| left]] | [[File:Agile-1.jpg| left]] | ||
[[File:waterfall-1.png| | [[File:waterfall-1.png| center]] | ||
[[#top|Back to top]] | [[#top|Back to top]] | ||
== Research Conclusion == | == Research Conclusion == | ||
Research was carried out in Carnegie Mellon University where data collected was from five years of 50 teams, developing the same project each year and the affects of transitioning from Waterfall to Extreme Programming was analyzed. The characteristics between these two methods were evaluated and compared. According to the paper, waterfall teams spent more time creating high ceremony documents where as Extreme Programming teams spent more time writing code and documenting their design in their code. Surprisingly, the amount of code and features completed were roughly the same for both methods suggesting that on a three month project with three to four developers it didn't matter the method used. Please refer the references for the research paper. | '''[http://repository.cmu.edu/cgi/viewcontent.cgi?article=1056&context=silicon_valley&sei-redir=1&referer=http%3A%2F%2Fwww.google.com%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3Dcompare%2520it%2520with%2520waterfall%2520model%2520and%2520extreme%2520programming%26source%3Dweb%26cd%3D2%26ved%3D0CCQQFjAB%26url%3Dhttp%253A%252F%252Frepository.cmu.edu%252Fcgi%252Fviewcontent.cgi%253Farticle%253D1056%2526context%253Dsilicon_valley%26ei%3DG_aCUKeIFo-k8gTJzIGQAw%26usg%3DAFQjCNEmwlV8Xg6uapysO7P0RTcnlEPz3g#search=%22compare%20waterfall%20model%20extreme%20programming%22 Research]''' was carried out in Carnegie Mellon University where data collected was from five years of 50 teams, developing the same project each year and the affects of transitioning from Waterfall to Extreme Programming was analyzed. The characteristics between these two methods were evaluated and compared. According to the paper, waterfall teams spent more time creating high ceremony documents where as Extreme Programming teams spent more time writing code and documenting their design in their code. Surprisingly, the amount of code and features completed were roughly the same for both methods suggesting that on a three month project with three to four developers it didn't matter the method used. Please refer the references for the research paper. | ||
[[#top|Back to top]] | [[#top|Back to top]] | ||
== | == Tools == | ||
5 Hand-picked Extreme Programming '''[http://www.software-pointers.com/en-extremeprogramming-tools.html XP Tools]''' | |||
==External Links== | ==External Links== | ||
*[http://www.cutter.com/content-and-analysis/resource-centers/agile-project-management/sample-our-research/ead0002/ead0002.pdf Cutter Agile Project Management] | |||
*[http://en.wikipedia.org/wiki/Extreme_programming Extreme Programming Wikipedia ] | |||
*[http://www.cs.usfca.edu/~parrt/course/601/lectures/xp.html USF Lectures on Extreme Programming] | |||
*[http://www.computerworld.com/s/article/66192/Extreme_Programming?taxonomyId=063 Computerworld Articles Extreme Programming] | |||
*[http://www.extremeprogramming.org ExtremeProgramming.org] | |||
*[http://www.jera.com/techinfo/xpfaq.html Jera Extreme Programming] | |||
*[http://www.softwarereality.com/lifecycle/xp/four_values.jsp Software Reality Four Values] | |||
*[http://repository.cmu.edu/cgi/viewcontent.cgi?article=1056&context=silicon_valley&sei-redir=1&referer=http%3A%2F%2Fwww.google.com%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3Dcompare%2520it%2520with%2520waterfall%2520model%2520and%2520extreme%2520programming%26source%3Dweb%26cd%3D2%26ved%3D0CCQQFjAB%26url%3Dhttp%253A%252F%252Frepository.cmu.edu%252Fcgi%252Fviewcontent.cgi%253Farticle%253D1056%2526context%253Dsilicon_valley%26ei%3DG_aCUKeIFo-k8gTJzIGQAw%26usg%3DAFQjCNEmwlV8Xg6uapysO7P0RTcnlEPz3g#search=%22compare%20waterfall%20model%20extreme%20programming%22 Comparing Extreme Programming and Waterfall Project Results Research Article] |
Latest revision as of 01:46, 27 October 2012
Extreme programming (XP)
This chapter focuses on explaining below points. Describe what extreme programming is. Concepts of XP. Four values in XP. Aspects in key practices such as pair programming, collective code ownership, stories, automated testing, small releases and continuous integration. Advantages and Disadvantages with XP. Comparison with waterfall model
What is extreme programming
Extreme Programming (XP) is a software development methodology created by Kent Beck during his work on the Chrysler Comprehensive Compensation System (C3) payroll project. Extreme Programming is intended to improve software quality and responsiveness to changing customer requirements. It is a one of the several types of agile software development processes. Extreme Programming is successful because it stresses customer satisfaction. Instead of delivering everything you could possibly want on some date far in the future this process delivers the software you need as you need it. Extreme Programming empowers developers to confidently respond to changing customer requirements, even late in the life cycle. Back to top
Concepts of XP
Goals
Extreme Programming is a software-development discipline that organizes people to produce higher quality software more productively. The main goals are:
- Attempt to reduce the cost of changes in requirements by having multiple short development cycles
- Changes are a natural and a desirable aspect of software-development projects, and should be planned for in advance.
Activities
XP describes four basic activities that are performed within the software development process: designing, coding, testing, listening as described below:
Coding
The guiding principle of XP is that without code, there is no working product. Hence, importance is given to code rather than documentation for various aspects.
Coding can also help to communicate thoughts about problems. A programmer dealing with a complex programming problem, might prototype it in a simplified manner and use it to demonstrate what he or she means. Code is always clear and concise and makes the problem unambiguous.
Testing
Extreme programming's approach is that a lot of testing can eliminate many flaws in the product.
Unit tests are performed to determine whether a given unit of the product works as intended. A programmer writes as many automated tests as they can think of that might "break" the code. Only if all tests run successfully, then the coding is complete. Every piece of code that is written is tested before moving on to the next feature. Acceptance tests verify that the components delivered the programmers satisfy the customer's actual requirements.
Listening
The Programmers must listen to what the customer requirements are clearly, and what business logic is needed and give feedback about the technical aspects of how the problem might be solved, or cannot be solved. Effective communication between the customer and the development team is essential to get the product working as intended. Hence, listening is a very important aspect of XP.
Designing
Creating a design structure organizes the components of the system. Good design will avoid lots of dependencies within a system and will focus on low Coupling and high Cohesion. Without a proper design the system becomes too complex and the dependencies within the system cease to be clear.
Four values in XP
- Simplicity: Keeping code simple makes changing code easier as the requirements inevitably change. Simple solutions to today's problems minimizes the cost of change over time. For example it is ten times harder to fix a mistake of requirements when you are in the design phase, and 100 times harder to make changes late in a project during the coding phase. simple designs minimizes the risk of spending a long time designing sophisticated frameworks that the customer may not use/want.
One important point to note is that XP approach recognizes that the cost of change generally increases like one would expect, but this increase is not always increasing. If the code is refactored and kept simple, we can avoid ever-increasing complexity.
- Communication: With respect to programmers, code communicates best when it is simple else once should strive to simplify it. Another form of communication is Unit Tests, Unit tests exercise the classes and methods in your application,Unit tests communicate the design of a class effectively.Programmers communicate to with one another because they program in pairs(Pair Programming).There is no set observer in a pair. XP requires an on-site customer to convey the requirements to the team. The customer decides which features are most important, and is always available to answer questions.
- Feedback: On-site customer the means to get immediate feedback about the project status. There are short release cycles, where the customer is able to evaluate each new feature as it is developed, minimizing the necessity to rework and helping the programmers focus on what is most important to the customer. The customer always defines which features are the most important, so the most valuable features are delivered early in the project. Customers can cancel the project at any time and have a working system with the features as per the last release.
- Courage: For managers, the concept of pair programming can be hard to accept—it seems like productivity will drop by 50%, because only half of the programmers are writing code at any given time. It takes courage to trust that pair programming improves quality without slowing down progress. It takes courage to implement the feature the customer is asking for today using a simple approach, because you probably want to build in flexibility to account for tomorrow's features, as well.Everyone gives and feels the respect they deserve as a valued team member. Everyone contributes value even if it's simply enthusiasm. Developers respect the expertise of the customers and vice versa. Management respects our right to accept responsibility and receive authority over our own work.
Aspects in key practices
There are 19 key practices:
- Joint
- Common Vocabulary
- Iterations
- Open Workspace
- Retrospectives
- Development
- Test-First Development
- Pair Programming
- Refactoring
- Collective Ownership
- Continuous Integration
- Just-In-Time Design
- Customer
- Storytelling
- Release Planning
- Acceptance Tests
- Frequent Releases
- Management
- Accepted Responsibility
- Air Cover
- Quarterly Review
- Mirror
- Sustainable Pace
Lets understand some of the practices in more detail.
Pair-Programming:
XP teams work in pairs where they share a single computer, keyboard, and mouse.
Flow:
- Programmer picks a User Story.
- Programmer1 asks for help from another Programmer2.
- Programmer1 and Programmer2 work to implement the functionality.
- After the immediate task is completed, programmer1 picks another partner to complete the remaining task or offers help to someone else.
Advantage:
- Partners rotate frequently and hence facilitate communication.
- Paring with experienced programmers beginners gain valuable coding experience.
- While one person writes programs other gets time to think about the problem at higher level of abstraction.
Collective Ownership:
- Every team member can work on any part of code in the application. There is constant shuffling and change of roles.
- Collective code ownership works because any team member can ask for help when he/she works on unfamiliar classes.
- It’s easier to catch errors when you have a set of unit cases to rely on. If a new change introduced by a partner breaks the code, it can be easily tracked before the code is integrated.
- Shared ownership model avoids the problem situations where the entire team depends on the one person who understands a part of code.
- It encourages high design quality because every functionality is subject to continuous refactor and modification.
User – Stories:
- Used to estimate for the release planning meeting.
- Easy to comprehend as compared to large requirement documents.
- Very intuitive since they reflect what customers expect hence drive the creation of acceptance test.
- User stories provide enough detail to make a low risk estimate of the time the story will take to implement.
- Each story will be 1, 2 or 3 week estimate in "ideal development time" which is the time it would take to implement the story in code if there were no distractions and the programmers know what to do. If its more than 3 weeks then the stories need to be broken down into simpler stories.
- Avoid details of technology, data base layout, and algorithms being used.
Automated – Testing:
XP is highly dependent on unit testing. Testing provide the safety net enabling pairs of programmers to make changes to any piece of code with courage. In this way programmers are more responsible for the code they create. Also each class have a suite of automated unit test. So before any changes are made to the code below procedure (Test Driven Development.) is followed.
Testing new feature: XP teams write tests before each new feature is added to the system. Here is the test-driven process:
- Run the suite of unit tests for the entire project, ensuring that they all pass.
- Write a unit test for the new feature.
- You probably have to stub out the implementation in order to get your test to compile.
- Run the test and observe its failure.
- Implement the new feature.
- Run the test again and observe its success.
Also Acceptance Testing is done to test high-level application functionality. This kind of test involves and is driven by the customer. When you need to test high-level application functionality, turn to acceptance testing. This sort of testing is driven by the customer, although they will probably need help from a programmer to implement the tests. Acceptance tests should be designed to pass or fail, and they should be as automated as possible. Unlike unit tests, however, acceptance tests do not have to pass at 100%.
Small Releases:
Below are the activities which involve small release planning:
- Prioritize the work. Arrange tasks by difficulty. Assign a low value to a simple task
- Make a plan.
- Customers, managers and developers must be involved.
- Define task from specification into user-stories
- Break down large tasks if possible
- Estimate how much time is needed. Can measure absolutely or relatively in terms of Hours or Story Points
- Important questions to ask, What should be completed first? Are tasks not necessary? Will the tasks take too long?
- Customer feedback important
- Developers can also decide what tasks are important.
- Decide what will be done in each iteration
- Velocity: Amount of work per iteration Also, if velocity is unknown estimate or do a test iteration.
- Each release plan has some sprints(one to two weeks long). We assign features to each sprint
Then we determine the velocity in terms of story points per sprint.
Continuous Integration:
- Code should be integrated and committed to repository every few hours. Hence holding on to changes is avoided.
- Everyone is made to work on the same version as everyone else in the project. And its individual programmers responsibility to integrate their own code when ever a reasonable break presents itself.
- Helps avoid avoids or detects compatibility problems early.
- There is no addition cost or time needed to integrate the system. More commonly explained by the phrase “pay me now or pay me more later”.
Advantages of XP
- Built-In Quality
- Overall Simplicity
- Programmer Power
- Customer Power
- Synergy Between Practices
- Coding Standards – Reduces the amount of time developers spend reformatting other peoples’ code. Reduces the need for internal commenting. Call for clear, unambiguous code
- On-Site Customer - Can give quick and knowledgeable answers to real development questions. Makes sure that what is developed is what is needed. Functionality is prioritized correctly
- 40-Hour Week – Most developers lose effectiveness past 40-Hours. Value is placed on the developer’s well-being. Management is forced to find real solutions
- Continuous Integration - Reduces to lengthy process. Enables the Small Releases practice
- Collective Ownership - Helps mitigate the loss of a team member leaving. Promotes developers to take responsibility for the system as whole rather than parts of the system
- Pair Programming – Two heads are better than one. Focus Two people are more likely to answer the following questions: Is this whole approach going to work? What are some test cases that may not work yet? Is there a way to simplify this?
- Refactoring – Prompts developers to proactively improve the product as a whole. Increases developer knowledge of the system
- Testing – Unit testing promote testing completeness. Test-first gives developers a goal. Automation gives a suite of regression test
- Simple Design – Time is not wasted adding superfluous functionality. Easier to understand what is going on. Refactoring and collective ownership is made possible. Helps keeps programmers on track
- Metaphor – Encourages a common set of terms for the system. Reduction of buzz words and jargon. A quick and easy way to explain the system
- Small Releases – Frequent feedback. Tracking. Reduce chance of overall project slippage
- The Planning Game – Reduction in time wasted on useless features. Greater customer appreciation of the cost of a feature. Less guesswork in planning
Disadvantages of XP
- Informal, little, or no documentation
- Scalability
- Contract Issues
- Misconception on the cost of change
- Tailoring
- Coding Standards – Degrading the quality of inline documentation
- On-Site Customer – Difficult to get an On-Site Customer. The On-Site customer that is given may not be fully knowledgeable about what the company may not have authority to make many decisions. Loss of work to the customer’s company.
- 40-Hour Week - The underlying principle is flawed. 40-Hours is a magic number. Some may like to work more than 40-Hours
- Continuous Integration – The one day limit is not always practical. Reduces the importance of a well-thought-out architecture
- Collective Ownership - Loss of accountability. Limitation to how much of a large system that an individual can practically “own”
- Pair Programming – Many tasks really don’t require two programmers. A hard sell to the customers. Not for everyone
- Refactoring – Not everyone is capable of refactoring. Refactoring may not always be appropriate. Would upfront design eliminate refactoring?
- Testing – Automated unit testing isn’t for everything. Reliance on unit testing isn’t a good idea. A test result is only as good as the test itself
- Simple Design – What is “simple?”. Simple isn’t always best
- Metaphor – Often the metaphor is the system. Another opportunity for miscommunication. The system is often not well understood as a metaphor
- Small Releases – Not easy for all projects. Not needed for all projects. Versioning issues.
- The Planning Game – Customer availability. Is planning this often necessary?
Comparison with waterfall model
Waterfall approach emphasizes on clear definition from the beginning of project. Its strengths are ability to analyse potential changes easily, large and distributed teams are well-coordinated, predictable budgets, and only needs small involvement from subject matter experts. But there are some clear disadvantages also. For example lack of flexibility, difficulty in predicting actual needs for the software, the loss of intangible knowledge between phases, discouragement of team cohesion, and the tendency to not discover design flaws until the testing phase. In reality it is very difficult for projects to follow the sequential flow of the model. It is difficult to identify all requirements and goals at the beginning of projects as requirements tend to change all the way. A working version can only be obtained late in the process. Below is a picture of how agile methodologies differ from traditional Waterfall Model.
Research Conclusion
Research was carried out in Carnegie Mellon University where data collected was from five years of 50 teams, developing the same project each year and the affects of transitioning from Waterfall to Extreme Programming was analyzed. The characteristics between these two methods were evaluated and compared. According to the paper, waterfall teams spent more time creating high ceremony documents where as Extreme Programming teams spent more time writing code and documenting their design in their code. Surprisingly, the amount of code and features completed were roughly the same for both methods suggesting that on a three month project with three to four developers it didn't matter the method used. Please refer the references for the research paper.
Tools
5 Hand-picked Extreme Programming XP Tools