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?
Searching For The Essense Of Ruby On Rails
I stumbled upon this Ryan Tomayko post today.
Ryan is a Python guy. Like a lot of Java people, Ryan took notice of the recent ONLamp.com piece about Ruby on Rails and the ensuing Slashdotting of it. Here's some of his thoughts that I agree:
IMO, the real breakthrough with Rails is that each of the layers in the stack come bundled together and each understands the others fairly intimately. This combined with the dynamic aspect of the language allows pieces up the stack to provide sensible default functionality given concrete pieces down the stack.
...
This may sound silly but I waste a ton of time trying to organize my project's source files...
Another aspect of Rails that I appreciated is that it seems to promoteand possibly even requirea strict organizational structure of source files. This structure can be generated for you by helper scripts.
Ruby on Rails Article at ONLamp.com
Curt Hibbs's tutorial for Ruby on Rails showed up on O'Reilly ONLamp.com yesterday:
Maybe you've heard about Ruby on Rails, the super productive new way to develop web applications, and you'd like to give it a try, but you don't know anything about Ruby or Rails. This article steps through the development of a web application using Rails.
Curt demostrated Rails development at an OCI Java lunch last year. He did build an online forum application within an hour. I am very much in favor of cutting the XML configuration horror out of web development. Yet I kept asking myself, and others at OCI, "Where's the catch?"
Things To Look Into
Here's a list of things that I would like to look into, when I have time:
- OSGi
- Brian Coyner is playing with it. Andrew Binstock claims it is Java's client side container.
- C-JDBC
- Mentioned by Patrick Niemeyer at the JUG last Thursday when Patrick Linskey presented about JDO and EJB (BTW, the slides are posted).
- java.lang.instrument
- You've got to look into it when a new package shows up in java.lang!
- Boost.Python
- Scripting C++ in python.
- SWIG
- Scripting C/C++ in multiple languages, including Java and C#. I have know it for a long time, but never seriously learned it.
Here's how I did on my last list 496 days ago:
- JOnAS
- I took a cursory look and found that it has good documentation. Deployment seems less developer friendly. I stuck with JBoss.
- nXML
- I liked it and am still using it. I learned RELAX NG (pronounced relaxing according to Mark Volkmann) because of it.
- Jena
- Interesting academic exercise, couldn't really find a place to use it. I know the inside of Mozilla is full of RDFs, but boy was it hard to learn.
- xmln and xmlv
- Fun stuff. Meant to be used with sed and awk to manipulate XML. Jonathan would loved it. I still have them in my /usr/local/bin and use them occasionally.
- XUL
- I liked the idea of writing a web app that has tree controls and table controls. But do Mozilla XUL apps count as web apps?
A Free JDK Really Is Coming
I first heard of plans of an open-source Java from IBM 55 days ago from Kevin Bedell's weblog quoting Eric Raymond but without further sourcing.
Today's traffic on the JPackage.org mailing list seems to unofficially confirm what that post said:
Michael A. Peters and Nicolas Mailhot:
Le mercredi 12 janvier 2005 à 01:38 +0000, Michael A. Peters a écrit : > Also - perhaps a jpackage repo and key. > That though is a little harder because currently (afaik) jpackage does > not provide a repo mirror list. Maybe that should wait until jpackage > has their free j2sdk done (I understand they are working on one) Well, this is supposed to be secret stuff;) Please don't block on it - there may someday be a redistributable jvm rpm at jpackage, and someday may even be next week, but the $VENDOR we're working with obviously has its own paying products higher on the priority list so it's taking some time... FYI at one point it looked like we could do jpp 1.6 with a jvm in but in the end we had to do the release without it since it was taking too long. > Fedora already installs one jpackage package, and jpackage does seem to > be the way to go if you want to do java stuff on Fedora, I know of no > other alternative that works well through yum. There is more than one jpackage package in Fedora Devel right now;). Stuff is moving both ways pretty smoothly. Regards, -- Nicolas MailhotMe:
On Mon, 17 Jan 2005 13:18:35 +0100, Nicolas Mailhot <Nicolas.Mailhot at laposte.net> wrote: > > Well, this is supposed to be secret stuff;) Please don't block on it - > there may someday be a redistributable jvm rpm at jpackage, and someday > may even be next week, but the $VENDOR we're working with obviously has > its own paying products higher on the priority list so it's taking some > time... Since you posted to a public mailing list, is it still a secret? Can I quote you in my blog? Does the $Vendor have a three letter name that starts with an I and ends with an M and has a B in the middle? :) -- Weiqi Gao (高为奇)Weiqi Gao wrote: > Since you posted to a public mailing list, is it still a secret? I guess it isn't secret any more! Keeping something quiet on the Internet is always a hopeless task... > Does the $Vendor have a three letter name > that starts with an I and ends with an M and has a B in the middle? :) *No* *comment*! Pete> Since you posted to a public mailing list, is it still a secret? That there is something in the works is not a big secret - we've got leaks before. As for the rest, I won't confirm any timetable (or even $VENDOR's name). I'll just say $VENDOR should and will be praised for trying to work with us. It's not always easy. > Can > I quote you in my blog? Does the $Vendor have a three letter name > that starts with an I and ends with an M and has a B in the middle? :) Since I've already said it's a commercial vendor I'll only confirm the three-letter name part;) Regards, -- Nicolas Mailhot
They Didn't Even Notice It
I did a presentation about JMX and Java 5 Monitoring and Management Features at the OCI internal Java lunch yesterday. Brian's blog entry has links to more articles on this topic.
In typical developer fashion, I want to talk about the tools I used for the presentation: S5, MultiDesktop Manager, and nXML.
S5 (A Simple Standard-Based Slide Show System) is a slide show format based entirely on XHTML, CSS, and JavaScript by Eric Meyer. I first learned about it from Eric Burke. It is indeed simple. Every slide is a <div class="slide">, and an <h1> inside it becomes the title, and everything else becomes the content. Including and positioning graphics is a breeze: just use the <img> element.
I don't think the audience noticed any big difference from PowerPoint, as most other Java lunches are in, during the presentation, except for people who already know about S5, as I used the default theme.
S5 did retire DocBook Slides for me, which I used for the JBoss presentation at the JUG a while back.
I learned about MultiDesktop Manager while reading weblogs. I forgot whose weblog it was. Once MultiDesktop Manager is installed and started, a Windows tray icon appears that has menu items for starting another Desktop and switch to it. The Control-Alt-LeftArrow and Control-Alt-RightArrow keys switches between the Desktops.
I started my presentation in full screen mode in one Desktop, and started the demo application (jconsole) in another. This saved me from having to get in and out of full screen mode for the presentation in front of the audience. The cut over between the presentation Desktop and the demo Desktop is very clean.
Drawbacks of MultiDesktop Manager include not being able to close the Desktops that are created, and not being able to remember the created Desktops on next startup.
nXML is an Emacs major mode for XML editing written by James Clark. I blogged about it 489 days ago. nXML has improved a lot since then. In my year end review I mentioned the download-install-forget cycle. Obviously, for me at least, nXML did not fall into that cycle.
My Earliest USENET Post
It's Find Your Earliest USENET Post day today.
Although I found the earliest mention of my name on USENET 378 days ago, that's not my earliest post.
In the process of finding my earliest post (5432 days ago), I came across some pretty interesting posts here, here and here.
I can't believe how much time I spent on USENET postings. On the other hand, it's gratifying to find comp.databases.ms-access still remembers me fondly to this day.
Forced To Learn SELinux
I don't fully understand it yet, but I was forced to learn a little bit of SELinux recently. I have known that Fedora Cores 1, 2 and 3 came with SELinux (Security Enhanced Linux developed by the NSA) for some time, but it did not affect the operation of my system until recently when PosrgreSQL failed to start after a reboot.
There were messages in the system log like this:
Dec 25 17:50:47 gao-2004 kernel: audit(1104018647.963:0): avc: denied { read }
for pid=10109 exe=/usr/bin/postgres name=PG_VERSION dev=hda3 ino=950339 sconte
xt=root:system_r:postgresql_t tcontext=root:object_r:var_lib_t tclass=file
At first glance I thought this must be a permissions problem. But the permission on the PG_VERSION file looked OK:
-rw------- 1 postgres postgres 4 Nov 13 22:31 PG_VERSION
A few minutes of Googling lead me to the many postings on the Fedora Core mailing list, and ultimately to the Fedora Core 3 SELinux FAQ. I realized that my PostgreSQL RPMs had been automatically updated by yum the day before, and the server is locked down by SELinux now.
I'll spare you the theory behind SELinux, because it's all in the FAQ, and only mention a few interesting bits.
A -Z switch has been added to the ls, id and ps commands to display the security context:
[weiqi@gao] $ pgrep postmaster | xargs ps -Zw LABEL PID TTY STAT TIME COMMAND user_u:system_r:postgresql_t 2603 ? S 0:00 /usr/bin/postmaster - p 5432 -D /var/lib/pgsql/data user_u:system_r:postgresql_t 2605 ? S 0:00 postgres: stats buffe r process user_u:system_r:postgresql_t 2606 ? S 0:00 postgres: stats colle ctor process [root@gao] # ls -Z /var/lib/pgsql/data/PG_VERSION -rw------- postgres postgres system_u:object_r:postgresql_db_t /var/lib/pgsql/d ata/PG_VERSION
In order for a process to be able to read a file, the security context of the process and of the file must be related in such a way in the SELinux pilicy file that allows the reading.
The problem I had was that my PG_VERSION file's security context was out of whack. Fortunately, the SELinux policy file also defines what the security context of every file in the system should be. The restorecon command can be used to correct the error. So I ran
[root@gao] $ restorecon -R /var/lib/pgsql
to get the security context right. And that fixed my problem.
Yesterday, MySQL, after being updated overnight, wouldn't start on reboot. And this time I know what to try. Sure enough, restorecon did the trick.
Standard Java, Extra-JCP Technologies, Rebel Frameworks, ...
"Quickly, what is Standard Java?"
"Stuff coming out of Sun. JCP, JSR, etc."
"What about SWT?"
"Never paid attention to it. It's IBM trying to sabotage standard Java."
"What about the Logging API?"
"That's standard Java. And standards are good."
"What about Log4j?"
"Not standard. Should be dead. Shouldn't use it. Everyone should migrate away from it."
"What about EJBs?"
"EJB is standard and good. I wrote three entity beans myself. It's quite easy. I used an Access database."
"What about Spring and Hibernate?"
"I heard Paul and Eric talking about them. The bloggers talk about them all the time. But they're not standards. We are not going to use them in our projects."
"Do you use Ant, JUnit, XDoclet? They are not standard."
"Uh? They have got to be standards, because we use them all the time."
"I bet you've never heard of OSGi."
"Nop. There is no JSR for it. Must be useless."
"Do you like static imports?"
"Yeah, yeah, yeah. It's a new feature in Java 5. It's standard and it must be good."
"What about compiling Java into native code, using GCJ?"
"You must never do that. You lose platform portability. Plus, GCJ is just a bunch of kids trying to get Sun to open source their JDK."
The person answering is a run-of-the-mill corporate IT developer who works 9 to 5, who reads java.sun.com and perhaps eWeek and who doesn't read blogs. Of course his answers are all wrong.
Here are the correct answers to some of the questions:
- There is no such thing as standard Java. Sun almost submitted the Java language spec to ECMA but withdrew at the last minute.
- The JCP process is used to define what goes into the JDK (and the J2EE/J2ME). Nothing more. Sun has the ultimate control over it, but they've been good at letting other platform vendors participate.
- Extra-JCP technologies is a very natural thing to have, just like non-Microsoft technologies for Windows. No Java project could survive a day without at least some extra-JCP technologies.
- SWT, Spring, Hibernate are in one sense reactions to (maybe perceived) deficiencies in JDK/J2EE. In that sense they may be termed "Rebel Frameworks." But there are many situations when they can be used to good effects.
- Even obscure technologies are useful in some specialized domains. Don't discount them as useless or irrelevant. Just because the authors chose not to hype their creations, doesn't mean the technology is less advanced or sound. We will do well to get familiarized with them.
Happy New Year! Tonight At 12---11 Central
Happy New Year!
That said, I'd like to start my new year of gripes with the unfair treatment of all the people who live in the Central Time Zone of the United States by the television networks.
If you live elsewhere in the United States, you've undoubtedly hear TV programs being announced thusly: "Don't miss the special report, tonight at 9/8 Central."
Why is it that, of the four time zones of mainland United States, three get their own schedule: their network evening news starts at 6:30pm, their prime time programming runs from 8:00pm to 11:00pm, and their late night talk shows start at 11:30pm, while the Central Time Zone, gets everything early by an hour?
For those who have never experienced it, just imagine how messed up your schedule will be if your network evening news came on at 5:30pm and the late shows started at 10:30pm, before your kids were in bed!
And the experience is manifested in its worse form in New Years Eve, when families gather round the television set to watch the festivities, at 11:00pm!
And if our schedules are messed up by an hour, perpetually, year round, forever, what's the point of us following the rest of the country to change our clocks twice a year for Daylight Savings Time?
Sheesh!
