<< Searching For The Essense Of Ruby On Rails | Home | RHUG Obsoleted By GCJ 4 >>

How Many XP Practices Do You Follow?

A spontaneous discussion about eXtreme Programming broke out yesterday at OCI North.

We all agreed that we are pretty agile, but we are not strictly XP. We agreed that we do the XP thing when it made sense (to us) and that we are not fanatical about XP. For most of us, this is the most agile project we've ever been involved with.

Here's what I think we measure up against the XP practices:

Code Practice 1: Code and Design Simply

I think we are merciless in this regard. "Take it out!" is the most often heard phrase on this project. "If all the getter is doing is to return the attribute, get rid of the getter and make the attribute public," said Jonathan to me once.

Code Practice 2: Refactor Mercilessly

We do quite a bit of refactoring to our code, usually right after all the tests pass. "I don't feel comfortable with the code" is reason enough for a bout of refactoring. What I have learned is that reducing code duplication should not be the only criterion. There are places where we pay the price of code duplication to make out intentions clear.

At any moment, we have a list of incomplete features and bugs, the "broken windows" list, and a list of working but smelly codes, the "dirty windows" list. We had a few "window cleaning days," days dedicated to work on "dirty windows."

Code Practice 3: Develop Coding Standards

I don't believe we have a coding standard written down somewhere. But we code "as if" there is a standard, and it shows.

Code Practice 4: Develop a Common Vocabulary

Again, it's a naturally emerging thing. We learn from the customer pretty quickly. "If the user click the Foo button, a Bar message should be sent to the processing engine. I don't know what Foo or Bar mean, but that's what should happen, because Mark told us so."

Developer Practice 1: Adopt Test-Driven Development

We write lots of tests. But I can't say tests drive our design. Functionalities are hashed out in meetings around the round table. We write design documents in AFT now. (Jonathan came on board the AFT train yesterday.) For most of the new classes, I know how the class should be at the start. I do write unit tests to "lock the class down" before I commit. I think we write tests first more often when we do bug fixes.

Rob noticing that the number of unit tests has grown to close to 200 started the impromptu XP chat.

Developer Practice 2: Practice Pair Programming

We don't do pair programming. We do shout out questions to each other. We can see each other by just turning around. I don't know if two developers looking at the same file on their respective computers and talking with each other count as pair programming.

Developer Practice 3: Adopt Collective Code Ownership

Quite the contrary, we adopted individual code ownership. When something goes wrong, say at line 147 of Foo.cpp, we use "cvs annotate" to find out the revision number and the committer of the problematic code and then look up the commit comment and the ChangeLog entry for that change. The committer usually can recall the rationale of the change.

The ChangeLog, I think, is something that should be promoted as a "Good Idea." Prior to this project, I only used ChangeLogs when sending in patches for Open Source projects. Most of the projects I worked on require a commit comment. But having all of those comments in one file makes things that much easier.

Developer Practice 4: Integrate Continuously

We do it with cron and a shell script. The build is hourly, and the 6:00pm build always send out an email. The other builds send out an email only if the build fails. No fancy web pages, not red and green lava lamps. But it works.

Business Practice 1: Add a Customer to the Team

We are on the phone with them all the time. They can also email bugs to our request tracking system. We have seen some major requirement drifts. But since the communication happens on a daily basis, both sides have a realistic view of both the feature set and the schedule, especially for the short term.

Business Practice 2: Play the Planning Game

I'm not involved in the planning part. But at any moment, I have one and only one priority that I devote all my time to. Once that is done, the next priority arrives. Somebody is doing the planning, and is doing a darn good job at it.

Business Practice 3: Release Regularly

We tag the repo on major milestones. And the cvs head is always in good shape. And they do pull from cvs head.

Business Practice 4: Work at a Sustainable Pace

I was never asked to do overtime in the last seven months. And our phase 1 code is in production! We celebrated today.


All in all, we follow the XP practices pretty closely, with the exception of pair programming, collective code ownership, and maybe the spirit of test-driven design.

We did not set out to do the project in XP. Actually, I didn't even remember what the 12 practices are until I started this blog entry. Most of the things that we do we do naturally.

How do your project meature up against the XP practices?



Re: How Many XP Practices Do You Follow?

Nice write up. You failed to mention our functional tests. We have 24 functional tests. However, each test is very involved. All together they represent more than 800 compares. It is the functional tests that allow us to refactor the core state processing without fear.

Re: How Many XP Practices Do You Follow?

Yes, the functional tests.

For those who don't know, Kevin and Jonathan cooked up a scripting language early on in the project and made all the domain objects scriptable.

The functional tests are written in this language. They are more concise than ordinary unit tests. They cover functionality of the whole system rather than individual classes.

The wonderful thing about the functional test suite is its coverage. If I modify a line of business logic, I can expect one or more of the functional tests to fail. If not, the probability is high that I've touched a line of dead code.

It also gives us the confidence to determine within minutes if an abnormal behavior of the finished system (of which ours is a subsystem) is the result of a bug in our code, and if it is, spot the bug and fix it.

There are other things that does not fit into XP practice but nevertheless are "Good Things:" One of them is the attention to error and exceptional paths. I have been on projects where a screen is considered done when the "happy path" works. And they fall down rather quickly when external stimuli is the slightly different from what the developer anticipated.

Re: How Many XP Practices Do You Follow?

I'm still in Florida, but I have such devotion to the blog and project that I'm going to comment... ;)

One area where I think we have been weak (but are getting better!) is that we've had a tendency to overdesign some areas and underdesign others.

Things that we initially deemed important (logging, persistence, etc.) have a very complex design that makes it hard for a newcomer to the team to gain traction in, while the complexity is lost on the one and only one time we use such features in the code. A candidate for refactoring, I think, but there's so much time invested in it that we don't really want to let it go. Plus, it works.

As for underdesigning parts, I think that the business logic started to sprawl a bit in the code, and due to the rapidity of development we never really stepped back and thought of how it should be. So I feel that our state model and its implementation, for example, desperately need some reworking but again since the system passes the tests and functions perfectly (or as close as we could get), there is little motivation to do so. Plus, hey, I'm not calling the shots anyway!

I guess this indicates that when you're coding for pleasure versus coding for profit, you really do have different constraints and motivations; no design philosophy can provide an absolute means of balancing all of the variables.

Re: How Many XP Practices Do You Follow?

Rob and I are working on re-factoring the state logic now and that should address the sprawl you are talking about. The re-factoring is happening because we needed new functionality. That is my understanding of the XP re-factoring way. You re-factor the code to accommodate new changes.

Re: How Many XP Practices Do You Follow?

In Developer Practice 3 you say:

The ChangeLog, I think, is something that should be promoted as a "Good Idea."

I agree. In fact when I was tech lead on the Notification Service projects one of the few times I played the "Because I Said So" card was when Justin was proposing that we not use a Change log. That being said: The subversion folks claim that the atomic checkin capability makes the ChangeLog obsolete. The say you can get the same information from "svn log". I wonder...

Add a comment Send a TrackBack