240 likes | 414 Views
XP- eXtreme Programming. Amit Shabtay. Software Development Process. SDP is essentially composed of: Requirements-> Design-> Implementation-> Testing-> Documentation-> Maintenance However, this is not descriptive enough.
E N D
XP- eXtreme Programming Amit Shabtay
Software Development Process • SDP is essentially composed of: • Requirements-> Design-> Implementation-> Testing-> Documentation-> Maintenance • However, this is not descriptive enough. • Different organizations have different requirements for their processes, so there is not one "correct" process
Development Methodologies • The Software Crisis • 84% of software projects are not on time • 31% of software projects never complete • Most software is buggy, unstable and insecure • Lack of repeatability (engineering) • eXtreme Programming • For small projects: up to 12 people, 100 stories • Rational Unified Process • For large projects: a “heavy-weight” process • A commercial product
Rational Unified Process • By Rational, see http://www-306.ibm.com/software/awdtools/rup/ • Decompose large system to sub-systems • A team and development effort per system • Architects team does overall design, sharing • Five stages of each system’s life cycle • Business modeling, Requirements, Analysis & Design, Implementation, Test • Many artifacts are not code or tests • Iterative Development • Highly managed, highly automated process
The RUP platform includes • Tools for configuring RUP for a project’s specific needs. • Tools for developing your own internal knowledge into process components • Customizable Web-based deployment tools • Online community for exchanging best practices.
eXtreme Programming • By Kent Beck, see XProgramming.com • Embrace change • Simplicity • Customer involvement & rapid feedback • Incremental pay-as-you-go design • Test-first programming
The 12 XP Principles (I) • Planning Game • Simple Design • On-Site Customer • Pair Programming • Testing • Continuous Integration
The 12 XP Principles (II) • Small Releases • Collective Ownership • Coding Standard • Metaphor • 40-Hour Week • Refactoring
Planning Game, Simple Design • XP planning addresses two key questions in software development: • Predicting what will be accomplished at due date. • Determining what to do next (picking stories). • This is done every two weeks or so. • It provide steering control in the hands of the customer. • Design is kept simple design, knowing that in the next iterations it may change.
On-Site Customer • In a team, there exists a “customer”. • He is the business representative. • He provides the requirements, sets priorities and steers the project.
Pair Programming I • Two Programmers sit at one workstation • They take turns “driving” • Pairs are short lived • Pairing transmits knowledge to the team • Pairing train newbies
Pair Programming II • Laurie Williams, • http://collaboration.csc.ncsu.edu/laurie/ • Findings: • Pairs use no more manhours than singles. • Pairs create fewer defects. • Pairs create fewer lines of code. • Pairs enjoy their work more.
Testing • Write a test case. • Write the code that passes it. • Repeat until program does what you want. • It shows that the tested framework is functioning properly. • It also gives a working base to continue from. • We move, in tiny steps, from working base, to working base.
Continuous Integration • Build, end to end, at every check in. • Check in frequently. • Put resources on speeding build time. • Put resources on speeding test time.
Small Releases • First, the team releases running, tested software, delivering business value chosen by the Customer, every iteration • The customer can use it for evaluation or even release to end users • Second, XP teams release to their end users frequently as well. XP Web projects release as often as daily
Collective Ownership, Coding Standard • All the contributors to an XP project sit together, members of one team, including the customer. • There is no exclusive role of just one individual (except the customer) • On an Extreme Programming project, any pair of programmers can improve any code at any time. • Because of that, it is important to keep identical code standards.
Metaphor • To keep a common vision of how the program works, the team can define a “metaphor” for the project. • “This program works like a hive of bees, going out for pollen and bringing it back to the hive" as a description for an agent-based information retrieval system. • The metaphor Extreme Programming (XP) uses to describe software development is of driving a car- always in a need for steering.
40-Hour Week • Extreme Programming teams are in it for the long term. • To get a quality work, you need to treat the team as human beings.
Refactoring • Improving the design of existing code, without changing its observable behavior • "Programs have two kinds of value: what they can do for you today and what they can do for you tomorrow." Kent Beck
When? • When to refactor • Before adding functionality • Before fixing a bug • During code review • When not to refactor • During adding functionality • During fixing a bug • No good set of unit tests • Small programs (usually)
Code Smells • “If it stinks, change it” • Duplicate code • Switch statements • Long method • Data class • Long parameter list • Primitive obsession • Temporary field • …
For Conclusion • eXtreme programming is all about: • Fanatic testing • Preparing for unknown changes • Keeping it simple. • It is not always the best development process to choose- it must meet some requirements.