Software Development
Cloning VirtualBox images (or how I save hours a day when testing software)
Thursday, April 1, 2010
First things first. If you’re testing software and you’re not using some sort of virtualization solution, stop reading this and go install one. My product of choice is VirtualBox. It’s free (as in no cost and most of it is open source), user friendly, runs on an Ubuntu host computer and I’m familiar with it.
Lately I’ve been doing a lot of testing of the Ubuntu One desktop software and I need to be able to quickly get various versions of Ubuntu up and running. Below I outline how I do that on an Ubuntu host computer. My steps assume that you’re familiar with VirtualBox enough that you know how to setup a virtual machine (VM) already.
Create a master image
The master image is the one we’ll use to clone test images off of. By doing this we can worry about keeping our master image up-to-date and configured the way we need it and then simply clone that image when we have to test.
- Create a new VM in VirtualBox and install the OS (see Lifehacker’s guide if you’re not sure how to do this)
- After restarting the VM when the install is done, install all the latest updates on the master image and restart
- Install the VirtualBox Guest Additions (allows nice integration with the host computer)
- Shutdown the master image
Periodically you’ll want to make sure your master image has all the latest updates, so just boot it up, install the updates and then shut it down.
Clone the master image
Now we’re ready to start testing some software. Instead of using the master image we created above, we’re going to clone that image. This should take less than 5 minutes start to finish.
- In a terminal session do the following:
cd ~/.VirtualBox/HardDisks VBoxManage clonehd master_image.vdi test_image.vdi --format VDI
- In VirtualBox, create a new VM by clicking the New button
- Go through each screen selecting the appropriate values and clicking the Next button until you get to the Virtual Hard Disk part
- Select the Use existing hard disk radio button

- Click on the folder icon next to the pull down menu listing existing VDI files
- Click the Add button

- Select the image you created (should be in ~/.VirtualBox/HardDisks) to add it to the list of available hard disks
- Click on the image you just added and then click the Select button
- Click the Next button
- Click the Finish button
You now have a brand new VM to use for testing. Once you test with this image and decide its usefulness is over you can delete the virtual disk image (VDI) file in ~/.VirtualBox/HardDisks, repeat step 1 above to create a new cloned image, and then edit your cloned VM in VirtualBox to use the new clone image. In other words, you don’t have to setup a new VM (steps 2-10) every time you want to use another VDI if you don’t want to.
Topics: Software Development, Ubuntu One | 4 Comments »
Review The Tests, Then The Code
Sunday, March 1, 2009

Last week I was talking with one of the developers at work and he was telling me about improvements his team was making in regards to (informal/desk check) code reviews. I told him that was great and then followed that up with a recommendation on how to improve even more. Next time there is a code review, start with the tests. This will do two things: 1) Stress the importance of having tests 2) Make the review go quicker, as the tests will either be there and make the intent of the code clear or they won’t be there and the review is postponed until tests are in place.
I know I’m not the first to make this suggestion, but I felt it was worth repeating. Code reviews do have value, even when you pair program. At least, I think they do. Pair programming provides two sets of eyes on the code at the time of creation, but it’s surprising what someone who hasn’t seen the code before will find during a review.
Oh, and if reviewing the tests during a code review doesn’t make the intent of the code any clearer, then I suggest the team investigate behavior driven development (BDD). I’m becoming quite partial to the Cucumber framework for BDD, as I like it’s emphasis on user stories with acceptance tests/examples written in plain text and backed by executable steps.
Topics: Agile, Software Development | 1 Comment »
The Customers Disappear Right Before Our Eyes
Saturday, February 14, 2009
Tonight I was foolish enough to think my family and I could waltz into a restaurant on Valentine’s and get a table without much trouble. We were trying a restaurant we hadn’t been to before and I realized as soon as we pulled into the parking lot this probably wasn’t the best night to experiment. We went inside anyway to see how long the wait was. Much to my surprise, the hostess told us it was only about a 15-20 minute wait. I looked around the restaurant and, while it was full, there wasn’t a large number of people waiting on tables. We got on the waiting list and then proceeded to wait.
What I saw during the wait was kind of surprising. I noticed that the staff were diligently doing their jobs, quickly moving from one spot to another. I had to be careful not to step too far away from the waiting area or I was sure to bump into one of the busy bee workers. And while the staff was incredibly focused on the operations of the restaurant, I couldn’t help but notice they were almost oblivious to their customers, whether those customers be waiting for a table, eating their meal, or somewhere in between. I looked around the restaurant of about 40 tables and noticed that at any given moment there were numerous people looking to get the attention of their waitress. Customers coming in through the door were rarely greeted in a timely manner. Those of us waiting for a table were ignored completely, even as our original wait time came and went.
It dawned on me that this situation is not unlike what happens with some software development projects. We get in the groove of producing the software and never take time to make sure we’re satisfying the customer. Yes, those of us practicing agile have the advantage of delivering in short iterations which, at worst, won’t allow a project to go too long before the customer is back in the mix. But, even on agile projects, I’ve seen teams go through an entire iteration without giving much thought to the customer’s needs beyond the initial planning meeting. We think we understand exactly what the customer wants, can’t or simply don’t get continuous feedback from the customer during the iteration, and we develop the functionality. We become like the restaurant’s staff, who are so busy running the restaurant that they forget about the very people who really keep the restaurant running, the customers. Sure, the orders are taken, the food is getting out to people, drinks are refilled, new people are put on the waiting list, etc., but the customers aren’t satisfied, let alone happy. The software gets designed, written, documented, tested, etc. but the customers aren’t satisfied, let alone happy. Sound familiar?
Tonight was a good reminder that technical and operational excellence is critical to delivering a good customer experience, but if we lose sight of the customer in that process then we will fail miserably. We need to be diligent about keeping constant contact with the customer and focusing on the value we’re delivering. We don’t want our customers to walk away from us like my family and others did on the restaurant we attempted to eat dinner at tonight.
Topics: Agile, Software Development | No Comments »
One Smart Cucumber
Wednesday, January 28, 2009
I was messing around with some Ruby stuff tonight and was reading up on the Cucumber project. Cucumber is a behavior driven development (BDD) testing tool.
Anyone who talks to me about user stories knows I’m kind of a stickler on the value statement. I think I’ve found a kindred soul in Aslak Hellesoy, the creator of Cucumber. The following comes from the Cucumber documentation.
You should discuss the “In order to” part of the feature and pop the why stack max 5 times (ask why recursively) until you end up with one of the following business values:
- Protect revenue
- Increase revenue
- Manage cost
If you’re about to implement a feature that doesn’t support one of those values, chances are you’re about to implement a non-valuable feature. Consider tossing it altogether or pushing it down in your backlog. Focus on implementing the MMFs (Minimum Marketable Features) that will yield the most value.
Here is an example taken from an IRC chat session in #cucumber:
[5:08pm] Luis_Byclosure: I'm having problems applying the "5 Why" rule, to the feature "login" (imagine an application like youtube) [5:08pm] Luis_Byclosure: how do you explain the business value of the feature "login"? [5:09pm] Luis_Byclosure: In order to be recognized among other people, I want to login in the application (?) [5:09pm] Luis_Byclosure: why do I want to be recognized among other people? [5:11pm] aslakhellesoy: Why do people have to log in? [5:12pm] Luis_Byclosure: I dunno... why? [5:12pm] aslakhellesoy: I'm asking you [5:13pm] aslakhellesoy: Why have you decided login is needed? [5:13pm] Luis_Byclosure: identify users [5:14pm] aslakhellesoy: Why do you have to identify users? [5:14pm] Luis_Byclosure: maybe because people like to know who is publishing what [5:15pm] aslakhellesoy: Why would anyone want to know who's publishing what? [5:17pm] Luis_Byclosure: because if people feel that that content belongs to someone, then the content is trustworthy [5:17pm] aslakhellesoy: Why does content have to appear trustworthy? [5:20pm] Luis_Byclosure: Trustworthy makes people interested in the content and consequently in the website [5:20pm] Luis_Byclosure: Why do I want to get people interested in the website? [5:20pm] aslakhellesoy:[5:21pm] aslakhellesoy: Are you selling something there? Or is it just for fun? [5:21pm] Luis_Byclosure: Because more traffic means more money in ads [5:21pm] aslakhellesoy: There you go! [5:22pm] Luis_Byclosure: Why do I want to get more money in ads? Because I want to increase de revenues. [5:22pm] Luis_Byclosure: And this is the end, right? [5:23pm] aslakhellesoy: In order to drive more people to the website and earn more admoney, authors should have to login, so that the content can be displayed with the author and appear more trustworthy. [5:23pm] aslakhellesoy: Does that make any sense? [5:25pm] Luis_Byclosure: Yes, I think so [5:26pm] aslakhellesoy: It's easier when you have someone clueless (like me) to ask the stupid why questions [5:26pm] aslakhellesoy: Now I know why you want login [5:26pm] Luis_Byclosure: but it is difficult to find the reason for everything [5:26pm] aslakhellesoy: And if I was the customer I am in better shape to prioritise this feature among others [5:29pm] Luis_Byclosure: true!
I was impressed to find that section in the documentation. Not only do the docs detail basic usage but they go into the deeper discussion of how to apply agile principles using Cucumber. The balancing act of teaching principles and practices at the same time is no small feat. To find that in software documentation is pretty amazing.
P.S. One of my worst titles ever, I know. I think I was subconsciously inspired by the Hallmark Movie my wife had on a couple nights ago. I now realize I missed my calling as a greeting card writer.
Topics: Agile, Software Development | 1 Comment »
Apache Shindig PHP Setup Problem Solved
Sunday, September 14, 2008
First things first. Shindig is an Apache incubator project that serves as an OpenSocial Container and…I’m already falling asleep. Too boring. I’m way behind the curve on all things “social networking” but I have an idea for an app that may scratch an itch I have, and it just happens that some of this social networking stuff might be a good way to jump start the idea. So that means catching up on a couple of years (or more) of stuff that’s been going in the world of web 2.0, which includes OpenSocial. I wanted a local OpenSocial test sandbox and found Shindig to fit that bill.
Now, onto the problem I was running into and the solution. Unless you want the long boring details, I can save you the trouble and tell you to make sure you have mod_rewrite enabled in Apache.
If you haven’t dozed off by now then it probably means you’re running into issues with the Shindig PHP setup and would like some more details. I followed the directions on setting up the PHP Shindig server on my laptop running Kubuntu 08.04 here at home and kept getting a 404 error. I thought that was strange since I could hit other files with my browser that I put in that directory manually for testing but not the Shindig index.php page. Turns out the Shindig index.php page tries to be more “controller/servlet” like by sniffing the URI and passing it along to the appropriate handler. If it can’t find a match, then it gives a custom 404 error. I noticed the test URI (http://shindig/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml) didn’t have any reference to index.php. Ah yes, the wonders of Apache mod_rewrite! And guess what I didn’t have enabled? Yep, Apache mod_rewrite. So, below is what I did to get things running on an Ubuntu setup from scratch (meaning no Apache 2, PHP 5 was installed or configured):
sudo apt-get install apache2 apache2-common apache2-mpm-prefork apache2-utils ssl-cert libapache2-mod-php5 php5-cli php5-common php5-curl php5-mcrypt svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk/ /home/jhoover/dev/shindig sudo mv /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/ sudo cp /etc/apache2/sites-enabled/000-default /etc/apache2/sites-enabled/shindig sudo pico /etc/apache2/sites-enabled/shindig
Stop laughing, I use the Pico text editor. I’m, as my son would say, “weak sauce”. I know. Anyway, here’s what I have in that virtual host file:
NameVirtualHost *
<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@localhost
ServerName shindig
DocumentRoot /home/jhoover/dev/shindig/php
DirectoryIndex index.html index.php
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
Once we have that in place, we need to edit our host file:
sudo pico /etc/hosts
Append the following to the hosts file and save:
127.0.0.1 shindig
Time to restart Apache:
sudo /etc/init.d/apache2 restart
Now you should be able to go to your web browser of choice and run the demo/test app:
http://shindig/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml
If all went well you should see something a little like this:

Topics: Software Development, Web 2.0 | 4 Comments »


