XP Team Work Notes (Part 2)

software, work — markmorga on October 24, 2007 at 12:41 pm

A week and a half has passed since my last post. I’ve gathered up a few notes on new things that I’ve noticed:

  • Periodically you run into a work issue where rather than coding, you are tracking down a configuration issue. For example, you might need to figure out why you can’t make a connection to a database. These problems are tedious at the best of times, but they are especially tedious for the half of the pair not at the keyboard. That being said, there still is some value gained by the second pair of eyes.
  • What happens when a pair goes down the rabbit hole? Sometimes a pair begins work on a task which is useful for a refactoring or code sharing reason, but isn’t strictly a user story or spike. It becomes important to “time box” the activity if problems present themselves (”Ok, we’ll work on this until lunch and if we don’t have a solution by then, we’ll shelve this until later.”).
  • Don’t be afraid to modify your framework. One refactoring that we did this week was a change to ActiveRecord::Base that permitted each of the models in our various apps to inherit our model activity logging module without adding Includes to each model class. Due to Ruby’s ability to augment existing classes, this was a bit easier than it might have been in other languages, but there still was a bit of debugging and testing necessary to make it work reliably with all of our projects. This could be the subject of a future posting.
  • Build in repeatability. We currently have four applications that our team is in various states of building. Since we seem to add new projects so often, we spent some time over the last couple of weeks building a baseline application in subversion that contains all of our common application plugins and defaults. This makes starting a new project easier since we commonly use a number of different additions to Rails.
  • Look for pain points and eliminate them. One of our applications had grown to a size that the build/test process had lengthened to twelve minutes. This was causing delays in our check-in process, so we scheduled a spike this iteration to improve the testing speed. Think about the places in your day-to-day work that waste some of your time - long running tests? Searching your project files? Next think about what can be done to eliminate those wasted seconds and minutes. You do things over and over and small improvements in time add up over the course of days, weeks, and months.
  • A reason to have a customer close: sometimes the team ends up ahead of schedule and needs new stories to work on. Often in the iteration planning meeting, additional stories are determined for this potential, but if there aren’t additional stories prepped, having the customer available is essential.
  • Another reason to have a customer close: the customer keeps thinking about the problem. For example, we had received a description of how the real-world objects we were modeling were related from our SME. We understood his description fairly well and made a stab at implementing the models as he described them. One morning, our SME thought further about the relationships of the models and arrived with an updated description which of course necessitated changes on our end. As a result, we had a little rework, but a much better data model emerged because of our daily interaction with the customer.
  • Finally, seek an expert when necessary. We are beginning to use the Ext JS UI framework to build new user interfaces. We’ve chosen to use Ext 2.0 which is only in alpha, so the documentation and examples are still minimal. We requested that a sibling team’s expert in Ext and Javascript come spend some time with us to share some general usage principles and to discuss testing philosophies when creating richer web user interfaces.

New Goodness at Work

software, work — markmorga on October 12, 2007 at 5:19 pm

For the last week, I’ve been embedded with a group of contractors at work who have been developing some new internal tools using Ruby on Rails. I intend to blog a bit about what my experiences have been as time goes by so that I can capture the ideas that I’ve been picking up from my time on the team.

The team practices Extreme Programming which is the software development methodology which I’ve been interested in for the last six or seven years. It was the reason that I sought out the job with Symantec a few years ago and nothing that I’ve done in the time since has compared in regard to my productivity and my enjoyment at work.

First of all, the quality of the team is immediately evident. They are a group of very committed and focussed individuals. They spend more time than most teams ensuring that the object models and code are as clean, simple, and organized as possible. When they find a way of improving some aspect of their work, they take the time to build a tool to make that task simpler, then make sure everyone on the team has access to the tool. For instance, in the past week, one of the development pairs (XP involves pair programming) began working on an Ubuntu Linux dev box instead of the standard Mac Mini stations. They had identified the JEdit editor as a suitable candidate to replace TextMate on the Linux platform. TextMate provides several features that JEdit doesn’t have out of the box and they (or other members of their organization) have developed several Bundles for TextMate that improve their efficiency in coding. The leader of the Linux effort took the time to identify identical plugins for JEdit and wrote one or more plugins to provide identical (or similar) functionality for the most used TextMate features. Too often, I’ve seen programmers either suffering silently with inadequate tools, or building small tools for themselves without sharing them with others. One other thing about editors - this team really knows its editing tools - I’m constantly asking what the key combo was that my partner used to do some cool operation in the text that otherwise I might have done manually. This was a thought from The Pragmatic Programmer that these guys have really taken to heart.

They are obsessed by testing. They test every conceivable aspect of the code (always with automated tests) and use Test Driven Design (TDD) exclusively. This provides many code quality benefits, but most developers don’t have the self-discipline to accomplish this. The pair programming that they practice is also helpful in this regard (more on this below). They go beyond the standard Ruby on Rails ways of doing automated testing in the following ways. They use the UnitRecord, Mocha, and Dust testing extension libraries.

UnitRecord is a tool which permits removing database access from your ActiveRecord based classes. This greatly reduces the time it takes for each test to run - which is a good thing when you have the number of tests that this team produces.

Dust is a tool which permits you to write test cases like this:

functional_tests do
  test "given no name, when validated, then error is in the objects error collection" do
    instance = Klass.new
    instance.valid?
    assert_equal "can't be empty", instance.errors.on(:name)
  end
end

instead of deriving a class from Test::Unit::TestCase and adding methods that start with “test_”

Mocha is my favorite of the new tools. It is a library which provides the ability to mock and stub out classes and methods in a manner similar to jMock (which it is inspired by), but it provides a cool feature that I don’t believe that jMock does: it “…allows you to mock and stub methods on real (non-mock) classes and instances. ” This is a big time saver and lets you isolation test classes without having to refactor the code to avoid dependencies.

For pair programming, the team pairs share a common mac mini which has two monitors, keyboards, and mice (the monitors are mirrored so each developer looks at his own screen and sees the same as his partner). To share time at the keyboard, they play a game which they refer to as ping-pong. The first developer writes a test which the second must write code to satisfy. The second developer then writes a test for the first developer to write code. In this manner, each developer gets practice writing code and tests.

The team has an obsession about simplicity. I value the simplest solutions, but often I have caught myself planning code for the future when I learn that my partner has a simpler way which involves less complexity. For example: don’t add a database table unless necessary - write a hard-coded class instead.

This insistence on simplicity extends to maintenance as well. When the stories for the iteration have been written, one of the pairs was tasked with cleaning up a class in one of our applications which had become a little cluttered over time. The team briefly discussed potential candidates for cleanup and once agreement was reached, the pair started on the refactoring activity.

It has been a good week at work and I’m looking forward to other ideas that I can steal from them in the future - like GotAPI a handy website reference of most common web programming and languages.

In Ze’s Shadow

video blogging — markmorga on October 7, 2007 at 10:52 am

I miss The Show with Ze Frank, NewTeeVee has posted a few “up and comers” that vary from sites influenced by to outright mimicry of Ze.

Glowing Mountain Dew

food and drink, specialeffects — markmorga on October 7, 2007 at 10:32 am

Courtesy of Anton.

Update: Looks awesome, but it’s a hoax. When the camera zooms in on the baking soda, the mountain dew bottle is substituted with one likely containing the contents of a glow stick. Cute, but it won’t work as advertised.

Personal Unit Tests

life — markmorga on October 4, 2007 at 3:08 pm

Hober has a Backpack page with his personal unit tests an idea he heard from Without an E.

I think they each came up with too many goals to hit daily, but who am I to judge.

Top 50 Dystopian Movies

movies — markmorga on October 2, 2007 at 8:53 pm

Snarkerati posted a pretty cool list of 50 best films depicting a dystopia. I’d argue with some of the ranking (good grief - they included the two worst sci-fi films of all time: Starship Troopers and Total Recall), but it definitely has some good stuff on the list.

Signs that you aren’t really agile

software — markmorga on October 2, 2007 at 5:52 pm

Alistair Cockburn has a Letterman style list of Top ten ways to know you are not doing agile.

Kung Pao Chicken … yum!

food and drink — markmorga on October 1, 2007 at 9:25 pm

Thanks to the fabulous Edward Mao’s recipe for Kung Pao Chicken, I’m sitting here fat, dumb, and happy. It was awesomely delicious!

Thanks, Ed!!!

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. | Comanche Hill