Tuesday, October 14, 2008

VBA script for cleaning .XLS when Gettings Stories out of Rally

Remember in a previous posting about The Mail Merge method of exporting your stories from Rally where I complained about the work necessary to remove all the markup from the spreadsheet? A listener to this agile confessional took it upon himself to create a VBA script to automate this step. Let's give Pete Turner an Internet thanks for sharing! :-)

Paste the VBA text file into your into your “personal macro workbook." Yyou should be able to open with ALT+F11. If that doesn’t work, try unhiding it using View > Window > Unhide.
You can run the macro with View > Macros

Have fun!

Friday, October 3, 2008

Maven: The coolest build tool ever!

I've been through the grinder on build tools: typing in VIC20 BASIC, building from the command line, building from .sh scripts, building from Make, building from Xmake, building from IDEs, building from nant.

It's been a glorious twenty-eight years of software development (including grade school years of software development). Now I'm hearing good things about maven. A few people love it; many don't like it. I've stayed away from the arguments and kept clinging to my Nant and Eclipse build tools, but now I've landed on a project that's using maven 2.0.9. I have an excuse to dive in!
And I really love it!

It was tough at first, but when I look at the time I dumped into learning Make and its implied rules, it really wasn't so bad. The documentation on "the internets" (thank you Mr. Bush) is pretty minimal, maybe enough if you already understand the big concepts. There is a new book out this month that looks promising: Maven: The Definitive Guide With only the Internet, I probably would have stayed a frustrated Maven user except a smart cookie named Jeff Ramsdale gave a colleague and I a thirty minute intro. To give back to the internets and to put my notes on maven somewhere, here is my high level understanding of organizing a maven project. I'm sure you'll correct me by commenting if I'm out in the weeds.


Maven drives everything via a lifecycle. This lifecycle is built into maven:
  1. validate - validate the project is "correct" and all necessary information is available.  Said another way, "go get my dependencies."
  2. compile - compile the source code of the project
  3. test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed. Don't mix your system tests here.
  4. package - take the compiled code and package it in its distributable format, such as a JAR.
  5. integration-test - process and deploy the package if necessary into an environment where integration tests can be run. Don't put unit tests here as unit tests != integration tests. These tests should be testing that the system or subsystem works.
  6. verify - run any checks to verify the package is valid and meets quality criteria
  7. install - install the package into the local repository, for use as a dependency in other projects locally
  8. deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
A portion of this lifecycle is called a phase, so the above is a list of phases. Maven has a configuration file called a pom.xml. When you invoke maven: $mvn, it looks at the nearest pom.xml and by default, it uses the "install" lifecycle. Since install is number 7 in the above list, maven goes through phases 1, 2, 3,...,7 and may perform operations based on what is in the pom.xml. You can also do a $mvn deploy and mention the phase right in the command line.


Profiles are an abstraction layer on top of the lifecyle. Creating a profile allows you to create configurations which affect how things are done. For example, on our project, we have some integration tests which take two hours to run and we have two integration tests that take ten seconds to run. Before we check in, we want to run those quick integration tests but not the long ones. So we explicitly named the two integration tests in the configuration for the surefire plugin (a junit test runner in maven) which runs the two quick integration tests in the integration_test phase when $mvn is executed.

For the slow integration tests, we created a profile "all_integration_tests" which re-configures the surefire plugin to include running the slower integration tests too (using the naming convention of *IntegrationTest.java) when $mvn -pall_integration_tests is executed.


Goals are like arguments you use to tell a plug-in what to do. By the way, everything in maven is a plug-in so plug-in's are first class citizens. A goal is an argument that you pass to the plug-in. I don't have more to say about goals because I haven't had to use them much. :-)

After all, gotta save something for later.

Thursday, October 2, 2008

The Mail Merge method of exporting your stories from Rally

Chris Sterling, a great agile coach who I get to work with, showed me how to export stories from Rally in a more sophisticated fashion than the PowerPoint method. These steps build upon what he had shown me. Again, this is all about getting the story information out of Rally and into a physical medium which can be easily interacted with by a large group of people, thus removing impediments to collaboration when we are in the same physical space.

This process will produce stories on "cards", two "cards" per sheet of paper. Before the planning event, I use a cutting board to split the sheets into two. I'd give myself an hour before the planning event to get through this process until you are experienced.

Getting the stories out of Rally and into Excel

Use the same steps mentioned in the PowerPoint method and stop after doing the Processing the CSV with Excel step. If you want a stack of cards at the end of this process that are sorted by rank, then make sure your spreadsheet is sorted by rank (or that Rally is sorted by rank) so you won't have to do this by hand.

Setup the Mail Merge

The following directions describe how to do this in Word 2007. Download the mail merge template and open it into Word. The first time you open the file it will give you an error message saying: "Opening this document will run the following SQL command:" because it is trying to load up the .xls file which I used for mail merge. You should tell it "No," though no harm is done if you say yes other than getting a cranky error message.

In the toolbar, click on "Mailing".
The buttons in the "Mailing" toolbar are arranged in a type of life cycle arrangement. Since I'm providing the template, you won't necessarily use all the buttons to get to the last one, "Finish & Merge." Notice the merge fields, which are the groupings surrounded by "<<" and ">>". These are the same as the column names in the .xls file. The data that is inserted into the merg fields will match the font characteristics of the merge fields.

Loading the Excel file & Preview

Because we are using a mail merge utility, it's wording things in the way of "mailings." For us, our set of stories are mail recipients, so the language of the buttons is going to be weird. Click "Select Recipients"->"Use Existing List" and select the .xls which was produced in the earlier step.
Now you can click on "Preview Results" and see how things look.
Now you can exit the preview and adjust the styles as you want. I made the first line largest and easiest to read and loaded it with what I've found to be the most important info we needed for planning. I also crammed as much info as I could onto the sheet of paper. You may have different needs so you may want to exit preview mode and edit the template. The "«Next Record»" merge field means to populate the 2nd "card" on the sheet of paper with the next record. Without this, you'll end up with two copies of the same "card" on each sheet of paper. The darkened background uses up more printer toner, though the team I was working with was taping the "cards" to a white board so they wanted them to stand out.

Finish & Merge

MSWord's mail merge preview has bugs so don't be surprised to see duplicate story cards show up. A phenomena I've seen is where the last story on the virtual sheet, shows up as the first story on the next sheet. This actually isn't the case. Click "Finish & Merge"->"Edit individual documents" to prove this to yourself before selecting "Finish & Merge"->"Print documents..." and sending the job to the printer.

Split the sheets in half with a cutting board, and find a roll of tape, and now you are ready for you planning event!

Further Improvements

An impediment list can be made stronger by exposing the cost to our processes. In the below list, the bigger the number the bigger the cost. I'm using a geometric series.

16 I'd like to avoid the "cleaning" of the markup from the spreadsheet. Anyone know how to turn those Excel cells into something that accepts the markup? Or perhaps there is a Rally configuration that will scrub that markup out of my .csv?

2 I did this process a few times with Avery card stock but this seemed wasteful since there is a lot of paper boarders that aren't used and the cards, albeit nice and thick, aren't necessary. It would be great to buy reams of paper which are perforated to tear in half.

Update: Thanks to Pete Turner, I've added a later posting about a VBA script which cleans up the .xsl file: VBA script for cleaning .XLS when Gettings Stories out of Rally.