SDSU CS 683 Emerging Technologies: Embracing Change
Spring Semester, 2001
Extreme Programming Overview
Previous    Lecture Notes Index    Next    
© 2001, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 08-Mar-01

Contents of Doc 13, Extreme Programming Overview


References

The New Methodology, Martin Fowler, http://www.martinfowler.com/articles/newMethodology.html

Refactoring: Improving the Design of Existing Code, Martin Fowler, 1999

Extreme Programming Explained: Embrace Change, Beck, 2000


Doc 13, Extreme Programming Overview Slide # 2

Extreme Programming (XP)


XP is a lightweight way to produce software

Started March 6, 1996 with


Other lightweight processes:




Doc 13, Extreme Programming Overview Slide # 3
Risk

Software development

Schedules slip
Building the wrong product
Market for product changes
Buggy software
Too many features that users don't want
Struggle between management and developers

If can't manage risks than it is hard to succeed


Doc 13, Extreme Programming Overview Slide # 4
The Struggle between Management & DeveloperThe Developer Bill of Rights







Doc 13, Extreme Programming Overview Slide # 5
The Customer Bill of Rights






Doc 13, Extreme Programming Overview Slide # 6

Four Variables of Software Development


How much money to spend developing the product
Too little money makes it hard to develop the product
Too much money too soon causes problems
The time allocated to develop the product
Too little time makes development impossible
Too much time hurts development
Market may change
Lose feedback from system in use

The least measurable variable
The first to suffer in a crunch
Poor quality increases development time and costs

What features will be in the product


Doc 13, Extreme Programming Overview Slide # 7
Quality and Development Time





Doc 13, Extreme Programming Overview Slide # 8
Interaction between Four Variables

The interaction between is non-linear


If a program takes one programmer a year to develop

Can we use 50 programmers to develop it in a week or

Use 250 programmers to develop it in a day?


Doc 13, Extreme Programming Overview Slide # 9

The 12 Practices




Doc 13, Extreme Programming Overview Slide # 10
The Planning Game - Greatly Simplified

Customer writes user stories for the product

User story is a short description of the behavior of the product

Customer ranks stories by importance

Developers estimate development time per story

Using customer ranks & developers estimates the stories for next iteration are selected

Development Simplified

Developers


To implement a task


Doc 13, Extreme Programming Overview Slide # 11

What is Refactoring


Refactoring is the design of existing code with adding more functionality

What does that mean?

Doc 13, Extreme Programming Overview Slide # 12
Refactoring Example - Problem 3

This code stinks

at: anInteger put: anObject
   (smallKey ~= largeKey)
      ifTrue:
         [(anInteger < smallKey) 
            ifTrue: [self atLeftTree: anInteger put: anObject]
            ifFalse: [(smallKey = anInteger)
               ifTrue: [smallValue := anObject]
               ifFalse: [(anInteger < largeKey)
                  ifTrue: [self atMiddleTree: anInteger put: anObject]
                  ifFalse: [(largeKey = anInteger)
                     ifTrue: [largeValue := anObject]
                     ifFalse: [(largeKey < anInteger)
                        ifTrue: [self atRightTree: anInteger put: anObject]]]]]]
      ifFalse:
         [self addNewKey: anInteger with: anObject].

Apply "Replace Nested Conditional with Guard Clauses" refactoring to get:

at: anInteger put: anObject
   smallKey ~= largeKey
      ifFalse: [^self addNewKey: anInteger with: anObject].
   anInteger < smallKey 
      ifTrue: [^self atLeftTree: anInteger put: anObject].
   smallKey = anInteger ifTrue: [^smallValue := anObject]
   anInteger < largeKey
      ifTrue: [^self atMiddleTree: anInteger put: anObject]
   largeKey = anInteger ifTrue: [^largeValue := anObject]
   largeKey < anInteger
      ifTrue: [^self atRightTree: anInteger put: anObject]


Doc 13, Extreme Programming Overview Slide # 13
More Refactorings

To get the code below I applied:


TernarySearchTree>>at: aKey
   ^root at: aKey
   
TernaryTreeNode>>at: aKey
   aKey < smallData key ifTrue:[^leftSubtree at: aKey].
   aKey = smallData key ifTrue:[^smallData value].
   aKey < largeData key ifTrue:[^middleSubtree at: aKey].
   aKey = largeData key ifTrue:[^largeData value].
   aKey > largeData key ifTrue:[^rightSubtree at: aKey]
   
LeafTreeNode>>at: aKey
   aKey = data key 
      ifTrue:[^data value]
      ifFalse:[self error: 'Key not found']
   
NilTreeNode>>at: aKey
   self error: 'Key not found'


Copyright ©, All rights reserved.
2001 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

Previous    visitors since 08-Mar-01    Next