CSC/ECE 517 Fall 2012/ch2a 2w8 vp

From Expertiza_Wiki
Revision as of 03:07, 25 October 2012 by Vrkhamke (talk | contribs) (→‎Goals)
Jump to navigation Jump to 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

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: coding, testing, listening, and designing. Each of those activities is described below.

Coding

The advocates of XP argue that the only truly important product of the system development process is code – software instructions that a computer can interpret. Without code, there is no working product.

Coding can also be used to figure out the most suitable solution. Coding can also help to communicate thoughts about programming problems. A programmer dealing with a complex programming problem, or finding it hard to explain the solution to fellow programmers, might code it in a simplified manner and use the code to demonstrate what he or she means. Code, say the proponents of this position, is always clear and concise and cannot be interpreted in more than one way. Other programmers can give feedback on this code by also coding their thoughts.

Testing

Extreme programming's approach is that if a little testing can eliminate a few flaws, a lot of testing can eliminate many more flaws.

Unit tests determine whether a given feature works as intended. A programmer writes as many automated tests as they can think of that might "break" the code; 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 requirements as understood by the programmers satisfy the customer's actual requirements.

Listening

Programmers must listen to what the customers need the system to do, what "business logic" is needed. They must understand these needs well enough to give the customer feedback about the technical aspects of how the problem might be solved, or cannot be solved. Communication between the customer and programmer is further addressed in the Planning Game. Designing

From the point of view of simplicity, of course one could say that system development doesn't need more than coding, testing and listening. If those activities are performed well, the result should always be a system that works. In practice, this will not work. One can come a long way without designing but at a given time one will get stuck. The system becomes too complex and the dependencies within the system cease to be clear. One can avoid this by creating a design structure that organizes the logic in the system. Good design will avoid lots of dependencies within a system; this means that changing one part of the system will not affect other parts of the system.

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:

Different Types of 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.

Back to top

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.

Back to top

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

Back to top

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?

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.

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

References

<references> </references>

External Links

  1. [ http://www.cutter.com/content-and-analysis/resource-centers/agile-project-management/sample-our-research/ead0002/ead0002.pdf Cutter Agile Project Management]
  2. [ http://en.wikipedia.org/wiki/Extreme_programming Extreme Programming Wikipedia ]
  3. [ http://www.cs.usfca.edu/~parrt/course/601/lectures/xp.html USF Lectures on Extreme Programming]
  4. [ http://www.computerworld.com/s/article/66192/Extreme_Programming?taxonomyId=063 Computerworld Articles Extreme Programming]
  5. [ http://www.extremeprogramming.org ExtremeProgramming.org]
  6. [ http://www.jera.com/techinfo/xpfaq.html Jera Extreme Programming]
  7. [ http://www.softwarereality.com/lifecycle/xp/four_values.jsp Software Reality Four Values]
  8. [ 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]