Extreme Programming (XP) is a deliberate and disciplined approach to software development. XP is used for risky projects with dynamic requirements to experience greater success and developer productivity. XP emphasizes customer involvement and promotes team work based on its simple rules and practices. Customers enjoy being partners in the software process and developers actively contribute regardless of experience level.
This methodology also emphasizes team work. Managers, customers, and developers are all part of a team dedicated to delivering quality software. XP implements a simple, yet effective way to enable groupware style development.
XP improves a software project in four essential ways: Communication, Simplicity, Feedback, and Courage. XP programmers communicate with their customers and fellow programmers. They keep their design simple and clean. They get feedback by testing their software starting on day one. They deliver the system to the customers as early as possible and implement changes as suggested. With this foundation XP programmers are able to courageously respond to changing requirements and technology.
The basic Rules and Practices in XP are :

PlanningDesigning
User stories are written.
Make frequent small releases.
The Project Velocity is measured.
The project is divided into iterations.
Iteration planning start seach iteration.
Move people around.
A stand-up meeting starts each day.
Fix XP when it breaks.
Simplicity.
Choose a system metaphor.
Use CRC cards for design sessions.
Create spike solutions to reduce risk.
No functionality is added early.
Re-factor whenever and wherever possible.
CodingTesting
The customer is always available.
Code must be written to agreed standards.
Code the unit test first.
All production code is pair programmed.
Only one pair integrates code at a time.
Integrate often.
Use collective code ownership.
Leave optimization till last.
No overtime.
All code must have unit tests.
All code must pass all unit tests before it
can be released.
When a bug is found tests are created.
Acceptance tests are run often and the
score is published.