CSC/ECE 517 Fall 2012/ch2a 2w8 vp

From PG_Wiki
Jump to: navigation, search

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

Extreme.jpg

Contents


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:

  1. Attempt to reduce the cost of changes in requirements by having multiple short development cycles
  2. 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

Simple.jpg

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.

Back to top

Aspects in key practices

There are 19 key practices:

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:

Advantage:

Collective Ownership:

User – Stories:

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:

  1. Run the suite of unit tests for the entire project, ensuring that they all pass.
  2. Write a unit test for the new feature.
  3. You probably have to stub out the implementation in order to get your test to compile.
  4. Run the test and observe its failure.
  5. Implement the new feature.
  6. 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:

  1. Prioritize the work. Arrange tasks by difficulty. Assign a low value to a simple task
  2. Make a plan.
  3. Customers, managers and developers must be involved.
  4. Define task from specification into user-stories
  5. Break down large tasks if possible
  6. Estimate how much time is needed. Can measure absolutely or relatively in terms of Hours or Story Points
  7. Important questions to ask, What should be completed first? Are tasks not necessary? Will the tasks take too long?
  8. Customer feedback important
  9. Developers can also decide what tasks are important.
  10. Decide what will be done in each iteration
  11. Velocity: Amount of work per iteration Also, if velocity is unknown estimate or do a test iteration.
  12. 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:

  1. Code should be integrated and committed to repository every few hours. Hence holding on to changes is avoided.
  2. 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.
  3. Helps avoid avoids or detects compatibility problems early.
  4. 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”.

Back to top

Advantages of XP

Back to top

Disadvantages of XP

Back to top

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.

Agile-1.jpg
Waterfall-1.png

Back to top

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.

Back to top

Tools

5 Hand-picked Extreme Programming XP Tools

External Links

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox