Session 24

Release 3 and Source Code Management


810:188
Agile Software Development


Agile Moments

Slow and Meticulous

If you haven't read any of Paul Graham's essays, you should. He's not a part of the agile software community; he's a Lisp hacker (and a rich one at that!) But he has very pragmatic ideas about programming. His recent book Hackers and Painters is pretty big seller as essays about software development go.

Over the weekend I read Paul's latest essay, Made in USA, and had an Agile Moment (TM):

In software, paradoxical as it sounds, good craftsmanship means working fast. If you work slowly and meticulously, you merely end up with a very fine implementation of your initial, mistaken idea. Working slowly and meticulously is premature optimization. Better to get a prototype done fast, and see what new ideas it gives you.

The article is about why the US is good at designing some things, like software, and bad at others, like cars. Graham's answer: Americans don't care much for taste or quality. Instead, we are driven by speed, and some products are done better when done quickly without undue emphasis on getting it "right".

You may not always agree with Graham, but he will make you think.


Activity 1: New CMS Features

Work with your project team to...

Propose three features that you would like to add to our growing content management system.

You can add features that are incremental additions (e.g., new elements to a chapter) or major additions (e.g., generate Word or LaTex output). Think of yourselves as users of a course website, or as a creator!


Activity 2: Planning Game

Work with your project team to...

Estimate the time in hours required to implement each of these stories.

Assume that a single pair of students from your team will write the code, and that you'll be working in the same language on the same body of code you created for Release 2. Remember to include time for writing tests before and time for refactoring after.

The stories:


Source Code Control

The terms "source control" and "source code management" (SCM) are used to describe several different ideas, and several different terms are used to refer to the same. But all the ideas have to do with managing the code that makes up a system. As Eric Sink writes, SCM:

At its simplest, an SCM tool provides a repository in which the team maintains a single, common library of the programs, scripts, documentation, and other documents that make up a project. Typically, the repository lives on a server to which all members of the team have access.

A programmer checks out a copy of some or all of the code, creating a working folder on her own machine, in which she does her work.

Sidebar: A SCM tool can be used to manage any set of documents... Example: OOPSLA 2004 web site built and managed by many individuals all over the world...

Programmers work in this way (again, from Eric Sink):

Basic activities: add .. get .. check-out .. check-in

Best Practice: Don't break the tree.

Repository as time machine... Labels or tags...

Best Practice: Write good log entries.


CVS Demo

From script:

mac os x > mkdir /Users/wallingf/cvsroot
mac os x > setenv CVSROOT /Users/wallingf/cvsroot
mac os x > cvs -v
Concurrent Versions System (CVS) 1.10 `Halibut' (client/server)

Copyright (c) 1989-1998 Brian Berliner, david d `zoo' zuhn,
                        Jeff Polk, and other authors
...
mac os x > cd pinball-game-kit/
mac os x > ll
total 104
-rwxr-xr-x  1 wallingf  staff  -  868 Nov 22 16:24 Ball.java
-rwxr-xr-x  1 wallingf  staff  -  260 Nov 22 16:23 CannonBall.java
-rwxr-xr-x  1 wallingf  staff  -  504 Nov 22 16:27 Hole.java
-rwxr-xr-x  1 wallingf  staff  -  543 Nov 22 16:24 MovableBall.java
-rwxr-xr-x  1 wallingf  staff  -  844 Nov 22 16:25 Peg.java
-rwxr-xr-x  1 wallingf  staff  -  157 Nov 22 16:23 PinBall.java
-rwxr-xr-x  1 wallingf  staff  -  175 Nov 22 16:26 PinBallGame.java
-rwxr-xr-x  1 wallingf  staff  - 3956 Nov 22 16:22 PinBallGameFrame.java
-rwxr-xr-x  1 wallingf  staff  -  246 Nov 22 16:24 PinBallTarget.java
-rwxr-xr-x  1 wallingf  staff  -  810 Nov 22 16:27 PinBallThread.java
-rwxr-xr-x  1 wallingf  staff  -  523 Nov 22 16:26 ScorePad.java
-rwxr-xr-x  1 wallingf  staff  - 1264 Nov 22 16:25 Spring.java
-rwxr-xr-x  1 wallingf  staff  -  852 Nov 22 16:26 Wall.java
mac os x > chmod 644 *.java
mac os x > rm .DS_Store
mac os x > cvs import -m "creating top-level repository" pinball-game wallingford v1
N pinball-game/Ball.java
N pinball-game/CannonBall.java
N pinball-game/Hole.java
N pinball-game/MovableBall.java
N pinball-game/Peg.java
N pinball-game/PinBall.java
N pinball-game/PinBallGame.java
N pinball-game/PinBallGameFrame.java
N pinball-game/PinBallTarget.java
N pinball-game/PinBallThread.java
N pinball-game/ScorePad.java
N pinball-game/Spring.java
N pinball-game/Wall.java

No conflicts created by this import

mac os x > cd ~/Desktop/
mac os x > cvs checkout pinball-game

cvs checkout: Updating pinball-game
U pinball-game/Ball.java
U pinball-game/CannonBall.java
U pinball-game/Hole.java
U pinball-game/MovableBall.java
U pinball-game/Peg.java
U pinball-game/PinBall.java
U pinball-game/PinBallGame.java
U pinball-game/PinBallGameFrame.java
U pinball-game/PinBallTarget.java
U pinball-game/PinBallThread.java
U pinball-game/ScorePad.java
U pinball-game/Spring.java
U pinball-game/Wall.java

mac os x > cd pinball-game/
mac os x > emacs PinBallGame.java
mac os x > javac *.java
mac os x > java PinBallGame
mac os x > rm *.class
mac os x > ll
total 112
-rw-r--r--  1 wallingf  staff  -  868 Nov 23 08:02 Ball.java
drwxr-xr-x  5 wallingf  staff  -  170 Nov 23 08:05 CVS
-rw-r--r--  1 wallingf  staff  -  260 Nov 23 08:02 CannonBall.java
-rw-r--r--  1 wallingf  staff  -  504 Nov 23 08:02 Hole.java
-rw-r--r--  1 wallingf  staff  -  543 Nov 23 08:02 MovableBall.java
-rw-r--r--  1 wallingf  staff  -  867 Nov 23 08:08 Peg.java
-rw-r--r--  1 wallingf  staff  -  157 Nov 23 08:02 PinBall.java
-rw-r--r--  1 wallingf  staff  -  158 Nov 23 08:10 PinBallGame.java
-rw-r--r--  1 wallingf  staff  - 4205 Nov 23 08:09 PinBallGameFrame.java
-rw-r--r--  1 wallingf  staff  -  246 Nov 23 08:02 PinBallTarget.java
-rw-r--r--  1 wallingf  staff  -  810 Nov 23 08:02 PinBallThread.java
-rw-r--r--  1 wallingf  staff  -  579 Nov 23 08:07 ScorePad.java
-rw-r--r--  1 wallingf  staff  - 1264 Nov 23 08:02 Spring.java
-rw-r--r--  1 wallingf  staff  -  852 Nov 23 08:02 Wall.java
mac os x > cvs update

cvs update: Updating .
M Peg.java
M PinBallGame.java
M PinBallGameFrame.java
M ScorePad.java

mac os x > cvs commit Peg.java PinBallGame.java PinBallGameFrame.java ScorePad.java
[ edited log file ]
Checking in Peg.java;
/Users/wallingf/cvsroot/pinball-game/Peg.java,v  <--  Peg.java
new revision: 1.2; previous revision: 1.1
done
Checking in PinBallGame.java;
/Users/wallingf/cvsroot/pinball-game/PinBallGame.java,v  <--  PinBallGame.java
new revision: 1.2; previous revision: 1.1
done
Checking in PinBallGameFrame.java;
/Users/wallingf/cvsroot/pinball-game/PinBallGameFrame.java,v  <--  PinBallGameFrame.java
new revision: 1.2; previous revision: 1.1
done
Checking in ScorePad.java;
/Users/wallingf/cvsroot/pinball-game/ScorePad.java,v  <--  ScorePad.java
new revision: 1.2; previous revision: 1.1
done

mac os x > cvs log ScorePad.java 

RCS file: /Users/wallingf/cvsroot/pinball-game/ScorePad.java,v
Working file: ScorePad.java
head: 1.2
branch:
locks: strict
access list:
symbolic names:
	v1-0-0: 1.1.1.1
	wallingford: 1.1.1
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
----------------------------
revision 1.2
date: 2004/11/23 14:24:40;  author: wallingf;  state: Exp;  lines: +4 -2
Modified Files:
    Peg.java PinBallGame.java PinBallGameFrame.java ScorePad.java

Removed the class variable PinBallGameFrame world from the
PinBallGameFrame class.  ScorePads and Pegs now receive the
PinBallGameFrame in which they live as a constructor argument.
----------------------------
revision 1.1
date: 2004/11/23 14:02:30;  author: wallingf;  state: Exp;
branches:  1.1.1;
Initial revision
----------------------------
revision 1.1.1.1
date: 2004/11/23 14:02:30;  author: wallingf;  state: Exp;  lines: +0 -0
creating top-level repository
=============================================================================

mac os x > cvs diff -c -r1.1 -r1.2

*** ScorePad.java	2004/11/23 14:02:30	1.1
--- ScorePad.java	2004/11/23 14:24:40	1.2

***************

*** 3,19 ****

  public class ScorePad extends Hole
  {
     private int value;
  
!    public ScorePad( int x, int y, int v )
     {
        super( x, y );
        value = v;
        setColor( Color.red );
     }
  
     public void hitBy( PinBall aBall )
     {
!       PinBallGameFrame.world.addScore( value );
     }
  
     public void paint( Graphics g )
--- 3,21 ----
  public class ScorePad extends Hole
  {
     private int value;
+    private PinBallGameFrame world;

!    public ScorePad( int x, int y, int v, PinBallGameFrame f )
     {
        super( x, y );
        value = v;
+       world = f;
        setColor( Color.red );
     }
  
     public void hitBy( PinBall aBall )
     {
!       world.addScore( value );
     }
  
     public void paint( Graphics g )

mac os x > cvs diff -c -r 1.1 -r 1.2 ScorePad.java
mac os x > emacs README
mac os x > cvs update

cvs update: Updating .
? README

mac os x > cvs add README

cvs add: scheduling file `README' for addition
cvs add: use 'cvs commit' to add this file permanently

mac os x > cvs update

cvs update: Updating .
A README

mac os x > cvs commit README
[ edit log message ]
Checking in README;
/Users/wallingf/cvsroot/pinball-game/README,v  <--  README
initial revision: 1.1
done

mac os x > cvs log README 

RCS file: /Users/wallingf/cvsroot/pinball-game/README,v
Working file: README
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
----------------------------
revision 1.1
date: 2004/11/23 14:36:58;  author: wallingf;  state: Exp;
Added README file for those unfamiliar with this project.
=============================================================================

mac os x > rm README
mac os x > cvs update

cvs update: Updating .
cvs update: warning: README was lost
U README

mac os x > ll

total 120
-rw-r--r--  1 wallingf  staff  -  868 Nov 23 08:02 Ball.java
drwxr-xr-x  5 wallingf  staff  -  170 Nov 23 08:38 CVS
-rw-r--r--  1 wallingf  staff  -  260 Nov 23 08:02 CannonBall.java
-rw-r--r--  1 wallingf  staff  -  504 Nov 23 08:02 Hole.java
-rw-r--r--  1 wallingf  staff  -  543 Nov 23 08:02 MovableBall.java
-rw-r--r--  1 wallingf  staff  -  867 Nov 23 08:08 Peg.java
-rw-r--r--  1 wallingf  staff  -  157 Nov 23 08:02 PinBall.java
-rw-r--r--  1 wallingf  staff  -  158 Nov 23 08:10 PinBallGame.java
-rw-r--r--  1 wallingf  staff  - 4205 Nov 23 08:09 PinBallGameFrame.java
-rw-r--r--  1 wallingf  staff  -  246 Nov 23 08:02 PinBallTarget.java
-rw-r--r--  1 wallingf  staff  -  810 Nov 23 08:02 PinBallThread.java
-rw-r--r--  1 wallingf  staff  -  112 Nov 23 08:38 README
-rw-r--r--  1 wallingf  staff  -  579 Nov 23 08:07 ScorePad.java
-rw-r--r--  1 wallingf  staff  - 1264 Nov 23 08:02 Spring.java
-rw-r--r--  1 wallingf  staff  -  852 Nov 23 08:02 Wall.java

mac os x > less README
mac os x > rm README 


mac os x > cvs rm README

cvs remove: scheduling `README' for removal
cvs remove: use 'cvs commit' to remove this file permanently

mac os x > cvs update

cvs update: Updating .
R README

mac os x > cvs commit

cvs commit: Examining .
[ edit log message ]
Removing README;
/Users/wallingf/cvsroot/pinball-game/README,v  <--  README
new revision: delete; previous revision: 1.1
done

[ look at CVS repository ]

mac os x > cvs log README

RCS file: /Users/wallingf/cvsroot/pinball-game/Attic/README,v
Working file: README
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
----------------------------
revision 1.2
date: 2004/11/23 14:40:27;  author: wallingf;  state: dead;  lines: +0 -0
Deleted README solely to demonstrate how.
----------------------------
revision 1.1
date: 2004/11/23 14:36:58;  author: wallingf;  state: Exp;
Added README file for those unfamiliar with this project.
=============================================================================

mac os x > ll
total 112
-rw-r--r--  1 wallingf  staff  -  868 Nov 23 08:02 Ball.java
drwxr-xr-x  5 wallingf  staff  -  170 Nov 23 08:40 CVS
-rw-r--r--  1 wallingf  staff  -  504 Nov 23 08:02 Hole.java
-rw-r--r--  1 wallingf  staff  -  543 Nov 23 08:02 MovableBall.java
-rw-r--r--  1 wallingf  staff  -  867 Nov 23 08:08 Peg.java
-rw-r--r--  1 wallingf  staff  -  157 Nov 23 08:02 PinBall.java
-rw-r--r--  1 wallingf  staff  -  158 Nov 23 08:10 PinBallGame.java
-rw-r--r--  1 wallingf  staff  - 4205 Nov 23 08:09 PinBallGameFrame.java
-rw-r--r--  1 wallingf  staff  -  246 Nov 23 08:02 PinBallTarget.java
-rw-r--r--  1 wallingf  staff  -  810 Nov 23 08:02 PinBallThread.java
-rw-r--r--  1 wallingf  staff  -  579 Nov 23 08:07 ScorePad.java
-rw-r--r--  1 wallingf  staff  - 1264 Nov 23 08:02 Spring.java
-rw-r--r--  1 wallingf  staff  -  852 Nov 23 08:02 Wall.java


Activity 3: CVS Questions

Work with your project team to...

Ask your two questions. If someone knows the answer, great. If not, add it to a group list for group discussion.

We'll answer as many questions as we can today, and I'll get answers for the rest of the questions for an upcoming session.


Wrap Up


Eugene Wallingford ==== wallingf@cs.uni.edu ==== November 23, 2004