Extreme Programming Report P.g.patil
Extreme Programming Report P.g.patil
By :-
PURVESH GOPAL PATIL
Guide :-
PROF.R.K.Dhande
I
J.T. MAHAJAN COLLEGE OF ENGINEERING, FAIZPUR
Department of Electronics and telecommunication Engineering
CERTIFICATE
Dr.K.G.Patil
Principal
II
III
DECLARATION
I hereby declare that the seminar report entitled, “EXTREME PROGRAMMING” was
carriedout and written by me/ us under the guidance of Prof.R.K.DHANDE , Assistant
Professor, Department of Electronics and telecommunicatio Engineering. This work has
not been previously formed the basis for the award of any degree nor has been submitted
elsewhere for the award of anydegree
Place :- Faizpur
Date :-
IV
ACKNOWLEDGEMENT
V
ABSTRACT
VI
TABLE OF CONTENTS
1 INTRODUCTION 1
2 THE XP PRACTICES 5
3 USER STORIES 6
4 ACCEPTANCE TESTS 9
5 ACCEPTANCE TESTS 12
6 SYSTEM METAPHOR 13
7 SPIKESOLUTION 13
8 SMALL RELEASES 14
9 ITERATION 15
10 PAIR PROGRAMMING 19
11 REFACTORING 21
12 DOCUMENTATION 22
13 DISTINGUISHING FEATURES OF XP 28
14 CONCLUSION 30
15 REFERENCES 31
VII
1. INTRODUCTION
If one or two developers have become bottlenecks because they own the core
classes in the system and must make all the changes, then try collective code
ownership. You will also need unit tests. Let everyone make changes to the core
classes whenever they need to. You could continue this way until no problems are left.
Then just add the remaining practices as you can. The first practice you add will seem
easy. You are solving a large problem with a little extra effort.
1
The second might seem easy too. But at some point between having a few XP rules and
all of the XP rules it will take some persistence to make it work. Your problems
willhave been solved and your project is under control. It might seem good to abandon
the new methodology and go back to what is familiar and comfortable, but continuing
does pay off in the end. Your development team will become much more efficient than
you thought possible. At somepoint you will find that the XP rules no longer seem like
rules at all. There is a synergy between the rules that is hard to understand until you
have been fully immersed. This up hill climb is especially true with pair programming,
but the pay off of this technique is very large. Also, unit tests will take time to collect,
but unit tests are the foundation for many of the other XP practices so the pay off is
very great.
2
XP projects are not quiet; there always seems to be someone talkingabout
problems and solutions. People move about, asking each other questions and trading
partners for programming. People spontaneously meet to solve tough problems, and
then disperse again. Encourage this interaction, provide a meeting area and set up
workspaces such that two people can easily work together. The entire work area should
be open space to encourage team communication. The most obvious way to start
extreme programming (XP) is with a new project. Start out collecting user stories and
conducting spike solutions for things that seem risky. Spend only a few weeks doing
this. Then schedule a release planning meeting. Invite customers, developers, and
managers to create a schedule that everyone agrees on. Begin your iterative
development with an iteration planning meeting. Now you're started.
Usually projects come looking for a new methodology like XP only after the
project is in trouble. In this case the best way to start XP is to take a good long look at
your current software methodology and figure out what is slowing you down. Add XP
to this problem first. For example, if you find that 25% of the way through your
development process your requirements specification becomes completely useless,
then get together with your customers and write user stories instead.
3
If you are having a chronic problem with changing requirements causing you to
frequently recreate your schedule, then try a simpler and easier release planning
meeting every few iterations. (You will need user stories first though.) Try an iterative
style of development and the just in time style of planning of programming tasks. If
your biggest problem is thenumber of bugs in production, then try automated
acceptance tests. Use this test suite for regression and validation testing. If your biggest
problem is integration bugs then try automated unit tests. Require all unit tests to pass
(100%) before any new code is released into the code repository.
4
2. THE XP PRACTICES
1. Planning Game
2. Small releases
3. Metaphor
4. Simple design
5. Test Driven Development
6. Refactoring
7. Pair programming
8. Collective ownership
9. Continuous development
10. Sustainable pace
11. On-site customer
12. Coding standards
5
3. USER STORIES
User stories serve the same purpose as use cases but are not the same. They are
used to create time estimates for the release planning meeting. They are also used
instead of a large requirements document. User Stories are written by the customers as
things that the system needs todo for them. They are similar to usage scenarios, except
that they are not limited to describing a user interface. They are in the format of about
threesentences of text written by the customer in the customers‟ terminology without
techno-syntax.
User stories also drive the creation of the acceptance tests. One or more
automated acceptance tests must be created to verify the user story has been correctly
implemented.
One of the biggest misunderstandings with user stories is how they differ from
traditional requirements specifications. The biggest difference is in the level of detail.
User stories should only provide enough detail to make a reasonably low risk estimate
of how long the story will take to implement. When the time comes to implement the
story developers will go to the customer and receive a detailed description of the
Developers estimate how long the stories might take to implement. Each story will get
a 1, 2 or 3-week estimate in "ideal development time". This ideal development time is
how long it would take to implement the story in codeif there were no distractions, no
other assignments, and you knew exactly what to do. Longer than 3 weeks means you
need to break the story down
6
further. Less than 1 week and you are at too detailed a level, combine some stories.
About 80 user stories plus or minus 20 is a perfect number tocreate a release plan
during release planning.
7
4. ACCEPTANCE TESTS
Acceptance tests are created from user stories. During an iteration the user
stories selected during the iteration planning meeting will be translated into acceptance
tests. The customer specifies scenarios to test when a user story has been correctly
implemented. A story can have one ormany acceptance tests, what ever it takes to
ensure the functionality works.
Acceptance tests are black box system tests. Each acceptance test represents
some expected result from the system. Customers are responsible for verifying the
correctness of the acceptance tests and reviewing test scores to decide which failed
tests are of highest priority. Acceptance tests are also used as regression tests prior to a
production release.
A user story is not considered complete until it has passed its acceptance tests.
This means that new acceptance tests must be created each iteration or the
development team will report zero progress. Quality assurance (QA) is an essential
part of the XP process. On some projects QA is done by a separate group, while on
others QA will be integrated intothe development team itself. In either case XP
requires development to have much closer relationship with QA.
Acceptance tests should be automated so they can be run often. The acceptance
test score is published to the team. It is the team'sresponsibility to schedule time to
each iteration to fix any failed tests. The name acceptance test was changed from
functional tests. This better reflects the intent, which is to guarantee that customer‟s
requirements havebeen met and the system is acceptable.
8
4.1. UNIT TESTING
Automated means that the results are verified automatically. The tests are
usually written in the same computer language as the production code. The test
verification is therefore code, which compares actual resultsto the expected results. If a
result is unexpected, the test fails. This kind of testing is in contrast to the usual print
lines mixed into the production code, where the programmer looks at the output on the
command line and tries to figure out whether the code behaves as expected.
Unit tests are written in java using JUnit. JUnit is a testing framework written
in Java. JUnit defines how to structure test cases and provides tools to run them. The
tests are usually executed in VisualAge.
9
Principle methods of a class should be tested. Tests should write for the cases
that are critical. Writing a test guarantees that if a developer changes the code inn an
unanticipated way, the error will be detected immediately when the tests are run.
Confidence in the code is enhanced if all tests are still running after a day of coding.
Each test should be independent of other tests. This reduces the complexity of the tests
and it avoids false alarms because of unexpected side effects. One test method tests one
or more methods of production code the developer should write the unit tests while (or
before or after) developing the production code. Tests should be run before and after
refactoring a piece of code, before starting to implement a new functionality in the
system and during integration.
10
5. RELEASE PLANNING
A release planning meeting is used to create a release plan, which lays out the
overall project. The release plan is then used to create iterationplans for each individual
iteration. It is important for technical people to make the technical decisions and
business people to make the business decisions. Release planning has a set of rules that
allows everyone involved with the project to make their own decisions. The rules
define a method to negotiate a schedule everyone can commit to.
The essence of the release planning meeting is for the development team to
estimate each user story in terms of ideal programming weeks. An ideal week is how
long you imagine it would take to implement that story if you had absolutely nothing
else to do. No dependencies, no extra work, but do include tests. The customer then
decides what story is the most important or has the highest priority to be completed.
weeks of estimated user stories by the project velocity to determine howmany iterations
till the release is ready.
11
6. SYSTEM METAPHOR
Choose a system metaphor to keep the team on the same page by naming
classes and methods consistently. What you name your objects is very important for
understanding the overall design of the system and codereuse as well. Being able to
guess at what something might be named if it already existed and being right is a real
time saver. Choose a system of names for your objects that everyone can relate to
without specific, hard toearn knowledge about the system. For example the Chrysler
payroll system was built as a production line. At another auto manufacturer car sales
were structured as a bill of materials. There is also a metaphor knownas the naive
metaphor which is based on your domain itself. But don't choose the naive metaphor
unless it is simple enough.
7. SPIKE SOLUTION
12
8. SMALL RELEASES
The development team needs to release iterative versions of the system to the
customers often. The release planning meeting is used to discover small units of
functionality that make good business sense and can be released into the customer's
environment early in the project. Thisis critical to getting valuable feedback in time to
have an impact on the system's development. The longer you wait to introduce an
important feature to the system's users the less time you will have to fix it.
13
9. ITERATION
14
It is important to take iteration deadlines seriously. Track progress during an
iteration. If it looks like you will not finish all of your tasks then call another iteration
planning meeting, re-estimate, and remove some of the tasks. Concentrate your effort
on completing the most important tasks as chosen by your customer, instead of
having several unfinished tasks chosen by the developers.
It may seem silly if your iterations are only one week long to makea new plan,
but it pays off in the end. By planning out each iteration as if it was your last you will
be setting yourself up for an on-time delivery of your product.
9.1. BUGS
When a bug is found tests are created to guard against it coming back. A bug in
production requires an acceptance test be written to guard against it. Creating an
acceptance test first before debugging helps customers concisely define the problem
and communicate that problem to the programmers. Programmers have a failed test to
focus their efforts and know when the problem is fixed.
Given a failed acceptance test, developers can create unit tests to show the
defect from a more source code specific point of view. Failing unit tests give
immediate feedback to the development effort when the bughas been repaired. When
the unit tests run at 100% then the failing acceptance test can be run again to validate
the bug is fixed.
15
9.2. PROJECT VELOCITY
The project velocity (or just velocity) is a measure of how much work is getting
done on your project. To measure the project velocity you simply add up the estimates
of the user stories that were finished during the iteration. It's just that simple. You also
total up the estimates for the tasks finished during the iteration. Both of these
measurements are used for iteration planning.
During the iteration planning meeting customers are allowed to choose the
same number of user stories equal to the project velocitymeasured in the previous
iteration. Those stories are broken down into technical tasks and the team is allowed to
sign up for the same number of tasks equal to the previous iteration's project velocity.
A few ups and downs in project velocity are expected. You should use a release
planning meeting to re-estimate and re-negotiate the release plan if your project
velocity changes dramatically for more than one iteration. Expect the project velocity
to change again when the system is put into production due to maintenance tasks.
Project velocity is about as detailed a measure as you can make that will be
accurate. Don't bother
16
dividing the project velocity by the length of the iteration or the number ofpeople. This
number isn't any good to compare two project's productivity. Each project team will
have a different bias to estimating stories and tasks,some estimate high, some estimate
low. It doesn't matter in the long run. Tracking the total amount of work done during
each iteration is the key to keeping the project moving at a steady predictable pace.
The problem with any project is the initial estimate. Collecting lots of details
does not make your initial estimate anything other than a guess. Worry about
estimating the overall scope of the project and get that right instead of creating large
documents. Consider spending the time you would have invested into creating a
detailed specification on actuallydoing a couple iterations of development. Measure the
project velocity during these initial explorations and make a much better guess at the
project's total size.
17
10. PAIR PROGRAMMING
18
Problem solving: team acquires the ability to solve the „impossible
problems faster.
Learning: pair programmers get a chance to learn from each other.
Team building and communication: people learn to discuss and
work together. This improves team communication and
effectiveness.
Pair programming contributes in three ways:
19
11. REFACTORING
20
12. DOCUMENTATION
XP practices are natural. At least the practices are trying to go withthe natural
instincts of people (and of programmers). They try to set up behaviors which are self-
sustaining, not through discipline or through pressure, but because they have results
which are good and which are proximate enough to the behaviors so as to reinforce
them. XP ensures that you have the communication you need, without increasing the
documentation you have to write.
Documentation or Communication: It true that programmer doesn‟t liketo write
documents. It's also true that on many projects the documents getout of date. It's
conventional to blame the latter on the former, but the truth is that when the schedule
gets tight, managers and project leaders are just as inclined to skip the updates as are
programmers. Programmers don't like documentation because managers make it clear
that what they really want is the program. What do programmers like? They like to
program. They like to write code; they like to make it work; they like to make it
beautiful. How can we go with that natural instinct and meet our needs for
documentation? Documents are used to communicate: to communicate requirements,
internal design, status and information needed externally to the project. Let's look at
those in turn. For each, we'll focus on what needs to be communicated and how XP
helps make sure that the communication happens.
21
Communicating Requirements: Some projects work from large requirements
documents specifying what needs to be in the product. There are some issues with the
use of such documents, and sometimes they are quite important:
Documents don't really communicate very well.
Documents aren't easy to write for customers.
Documents take time.
22
quite readily as part of a tracking and documentation process showing that
requirements have been implemented.
Informal Conversations Communicate Requirements: Because the Customer is On
Site, she is also available for questions to clarify details of the requirements. She
quickly learns to control how many interruptions she gets by improving the
information she communicates during release and iteration planning. Too little, and
she gets too many interruptions. Too much and she spends too much time in
preparation. She can balance things between writing, conversation, and question
answering to suit her own needs.
Natural Communication of Requirements: the On-Site Customer practice converts
an inefficient paperwork exercise into a dynamic conversation discussing
requirements as the project goes along. Everything is communicated -- must be
communicated if the tests are to run -- and the balance between paper, presentation,
conversation, and question answering can be adjusted to suit the participants.
Communicating Internal Design: All the members of the team need to understand
the system. They need to be able to advance the code, to make it do whatever is
needed. They need to do those changes in a way that are consistent with the overall
shape of the code, and the direction it is moving: we might say with its design.
One way to be sure that everyone on the team understands and follows the design is
to create a design and document it with UML diagrams or words or both. Everyone
would agree that you shouldn't do too much of this up front, but it's hard to say how
much is too much. To communicatea design in this way, you need good-looking
documents and more comprehensive.
23
Release Planning Communicates Design: The XP release planning process includes
a step where the programmers take the stories anddiscuss them among themselves, in
order to estimate them. To estimate them, they figure out roughly how to implement
each story. Guess what: the programmers are communicating about design. And
watch them carefully: sometimes when they think they might forget, they write a
noteabout how to implement a story, right on the card. They're recording enough
about the design to remember it later. This is design, and communication of design.
Iteration Planning Communicates Design: The XP Iteration planning process
includes a step where the programmers brainstorm the tasks to doeach story, putting
the tasks on the whiteboard for later signup. This is a design step. The whole team is
participating in the design, and seeing it take shape. The key design components are
left on the whiteboard until implemented. This is design, and communication of
design. Day to Day Development Communicates Design: In Quick Design Session: a
few programmers get together and do a little CRC session or draw some UML or
discuss how to do something. When they come up with something interesting, they
tell the folks who weren't in the session about it. They do this naturally: it's interesting
and they want to talk about it. If they come up with an important notion, they'll draw
and write it on the whiteboard and leave it up while it's useful. This is design, and
communication of design.
Pair Programming and Collective Ownership Communicates Design:
XP teams practice pair programming. Pairs switch around daily, with
everyone working with everyone. XP teams practice collective code
24
ownership, so that everyone can (and does) work on all parts of the system from time
to time. This is communication of design.
Refactoring Communicates Design: An essential aspect of XP is refactoring. Martin
Fowler's book Refactoring is subtitled Improving the design of existing code.
Refactoring is a process whereby the programmers (in pairs, of course) examine and
consider whether the codeis reflecting the design in their heads, and consider what the
code is saying about what the design should be. Then they improve the code to
improve the design. This is design, and communication of design.
Natural Communication of Design: Within the XP team, the practices bring about a
high level of common understanding of the design. Using the natural willingness of
programmers to talk about what they are doing and how cool it is, and using pair
programming, XP teams spread what needs to be known without the need for much
formality.
Communicating Status: Some aspects of your status certainly need to be
communicated externally to the project team. These communications willoften -- but
not always -- lead to documents.
Standup Meeting: XP recommends a daily "standup" meeting, where theteam stands
in a circle and quickly raises issues that people need to understand. This will include
design issues and the like, but the main thing is a quick review of status, requests for
help, problems encountered,and discoveries made. The standup meeting makes sure
that all the attendees know about everything that's going on. Naturally, customers and
managers are invited, and should attend.
Big Visible Chart: The important status information that needs to be fresh in people's
minds all the time should be represented in Big Visible Chart. Here are some
examples of useful charts:
25
Story Chart. You need to know how you're doing on getting stories
done. Consider a simple bar chart, the height showing the total
number of stories, with the number currently completed filled in.
Thischart shows any growth in the requirements, and shows
progresstoward completion, at a glance.
Story Wall. Some teams keep all the story cards up on a wall,
arranged in iteration order: the planned order of implementation.
When the customer changes her mind about the order, or about a
story, the wall is rearranged. Stories that are done are marked,
perhapswith a bright green diagonal line through the card.
Iteration Wall. The plan and status for the current iteration should be
visible to all, all the time. Some teams write the iteration plan on the
whiteboard. Typically when a task or story is done, the team will mark
it completed. A glance at the wall tells everyone what's up. Other
teams fill the wall with the story and task cards, marking them
complete as they get finished.
Communicating Externally: You may need external documentation to support the
product, either at the design level or for user documentation. The natural flow of the
process supports getting the work done.
Status Reports: Send management copies of your Big Visible
Charts, tied together with a few paragraphs.
Requirements Tracking: If you need requirements tracking, try
associating stories with acceptances tests, and maybe include a
little version information extracted from your code management
software.
26
The details of what to document and how to produce the information are
always unique to the project and its people. But the focusthat XP would recommend
is always this:
1. Communicate using the hottest medium you possibly can: from face-
to-face conversation at a whiteboard down through phone
conversation, through email, video or audiotape, down to paper or its
online equivalent.
2. Find ways to have people's everyday activities embody
communication. Find ways to have their everyday activities
automatically generate the information that needs to be published.
Find ways to extract information from development artifacts like
source code.
3. Treat periodic or specialized documents as stories: use your existing
planning mechanisms to get them done.
13. DISTINGUISHING
FEATURES OF XP
27
Its reliance on automated tests written by programmers and
customers to monitor the progress of development, to allow the
system to evolve and to catch defects easily.
Its reliance on oral communication, tests and source code to
communicate system structure and intent.
Its reliance on an evolutionary design process that lasts as long as
the system lasts.
Its reliance on the close collaboration of programmers with
ordinary skills
Its reliance on practices that work with both short-term instincts of
programmers and the long-term instincts of the project.
Risk management: the basic problems faced by all projects are
schedule slips, project canceled, defect rate, business
misunderstood, business changes and so on. XP address risks at all
levels of development process.
Placing highest value on code that is easily read.
28
14. CONCLUSION
29
15. REFERENCES
30
31