Installing DBFit for SQL Server
I’ve been using DBFit on several projects recently, and I’m really pleased with the results. If you’re not familiar with DBFit, it’s a set of Fit fixtures that allows Fitnesse tests to execute directly against a database, without you having to build a separate connector. This post shows you how to get started with DbFit with the least amount of pain.
We practice Test Driven Development at ext.IT and while TDD is a pretty mature discipline in most modern programming languages, it’s still not widely practiced in the database world. We’ve had some success in the past using TSQLUnit, but I prefer DbFit because you can use it to write Unit Tests as well as Acceptance Tests. In addition, Fitnesse allows you to add additional colour in the form of documentation to truly turn your acceptance tests into an executable specification.
One thing that doesn’t (at least to me) appear to be clear from the documentation is that to install DbFit to test a Microsoft SQL Server database, you can simply install Fitnesse, and then install FitSharp. The advantage of doing this, compared to installing DbFit from sourceforge is that you will be working with the latest and greatest versions of Fitnesse and FitSharp. The current instance of DbFit on sourceforge uses a Fitnesse build from 2008.
Here is a high level overview of the installation steps (more detailed information including troubleshooting steps is available at each of the links below):
- If necessary, install Java 6 from here: http://www.java.com/en/download/index.jsp
- Install Fitnesse from here: http://fitnesse.org/FrontPage.FitNesseDevelopment.DownLoad. As it mentions on the downloads page, just download fitnesse.jar, into the folder in which you’d like to install it and type java -jar fitnesse.jar -p 8080 (where 8080 is the port number you’d like to use to run fitnesse from – usually port 80 is taken by other stuff on your machine) at the command line. Fitnesse will unpack and install itself.
- If necessary, install .NET framework 3.5 or 4.0 from here: http://msdn.microsoft.com/en-us/netframework/aa569263
- Install FitSharp from here (choose the correct version for your version of the .NET framework): https://github.com/jediwhale/fitsharp/downloads. To install FitSharp, create a folder under the folder into which you installed Fitnesse (I name mine FitSharp) and unpack the installation files into this folder.
- Once you’re installed and up and running, follow the examples in the DbFit Reference to see how the whole thing works.
- One additional tip is that if you’re following the Hello World example in the DbFit reference, use the following text instead of the one they document in Step 2: Setting Up the Environment. This will correctly point you to the location of your FitSharp installation files and use the Microsoft SQL Server flavour of DbFit:
!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,"FitSharp\fit.dll" %p}
!define TEST_RUNNER {FitSharp\Runner.exe}
!define PATH_SEPARATOR {;}
!path FitSharp\dbfit.sqlserver.dll
I’ll be posting some further information on using DbFit as an executable specification that includes acceptance tests, for Unit Testing and performance testing, as well as showing you some of the ways we’ve organized our test suites to make them more maintainable and easier to understand. Happy Database Testing!
Launching Cast Iron Studio 5 on Windows 7
We were recently working on a customer’s Cast Iron projects that had been upgraded from version 4.5 to version 5.0 and ran into a problem launching Cast Iron Studio 5.0.0.6, which we solved.
I thought I’d throw this blog post out as I couldn’t find any help from Google about this problem, so if anyone else is running into this, then you will be able to find an answer without having to open a support ticket with IBM!
Problem
After installing Cast Iron Studio 5.0.0.6 on Windows 7, the Studio will launch correctly the first time, but each subsequent time you try to run Cast Iron Studio, it will show the splash screen then close the application.
If you look in the installation folder, you will see an error.txt file that contains something similar to this:
org.osgi.framework.BundleException: A fragment bundle cannot be started: update@plugins/com.approuter.module.jde.tp-1.0.0.jar [77]
at org.eclipse.osgi.framework.internal.core.BundleFragment.startWorker(BundleFragment.java:224)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:257)
at com.approuter.studio.plugins.BootstrapActivator.startApplication(BootstrapActivator.java:60)
at com.approuter.studio.plugins.BootstrapActivator.start(BootstrapActivator.java:39)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:355)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1074)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:616)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:299)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:489)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:211)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:321)
Solution
The solution is simple – launch Cast Iron Studio with Administrator privileges. You can of course right click the application from the start menu short cut and choose Run as administrator, but to avoid having to right click every time, follow these steps:
- Go to the desktop shortcut for Cast Iron Studio (if you didn’t create a shortcut when you installed Cast Iron, then simply right click the Cast Iron Studio start menu item and click Send To…, Desktop (create shortcut).
- Right click the short cut and click Properties.
- From the Shortcut tab, click the Advanced button.
- Check the box that says Run as administrator.
- Click OK to close the Advanced properties dialog and click OK to close the shortcut properties dialog.
If you’d prefer to use a start menu item, rather than a shortcut, simply right click the short cut and cilck Pin to Start Menu.
Now Cast Iron Studio will launch successfully.
Let me know if this blog post helped you, or if there is a simpler work around that exists; this was an odd problem that didn’t appear to have a well documented solution that Google could find for me.
Show them the numbers – it’s results that matter
On a recent project one of our customers had some questions about the project’s progress. The project was a mid-size systems integration between Oracle Financials and Onyx CRM for a Fortune 500 company.
As with many large companies, there were several business units and people with interest in the project, and also as with many large companies, people had several other projects to deal with and were not attending the daily standups or weekly progress meetings.
I began to hear that there were some concerns about the project progress from some of the management team and a concern that we were spending too much time writing tests instead of code.
This came as a big surprise to me: from the perspective of the team working on the project on a daily basis (both customer and ext.IT), we were sailing along with no problems. We were providing the usual artifacts such as status reports which showed how we were tracking against estimated hours and when our code complete date would be, and all of this was tracking well against our original estimates, so to hear that people were unhappy was a big shock.
I called a meeting with all of the stakeholders and as soon as I invited all of the stakeholders I realized two things:
- This meeting would be the first time in the whole project that all of the stakeholders had been in a room together.
- While we had discussed our approach during the initial engagement, we hadn’t held a project kickoff with all of the stakeholders to discuss our approach to building software.
Both of these items were my fault, but here I was, several months into the project with an unhappy customer, so I thought I would address it in this meeting.
I put together a short presentation which discussed our approach to building software, including brief descriptions of how we perform iterations, test driven development, automated acceptance testing, retrospectives and other benefits to the way we build software, and why we considered our approach to be best practice.
Almost as an afterthought, I ended the presentation with a couple of slides showing our project status. This was an afterthought because everyone at the meeting was a recipient of the weekly status report containing the same information. I created one slide comparing our original project estimates (before we had detailed requirements) to our detailed estimates (once requirements were fleshed out) and to our actual hours so far on the completed features, and another slide showing our defect count and comparing it to another of the customer’s internal projects that they had build without the benefit of automated tests.
Once the meeting started, it was clear that I didn’t need any of the slides about our approach. We spent a few minutes discussing the original estimates against the actual time taken for completed features: everyone was happy with the job we had done in estimating against the original high-level requirements. We also discussed how we were tracking on the hours left: again, everyone was satisfied with the results. Finally, we spent five minutes comparing the low defect count on our project (with a high level of test automation), compared to some of the customer’s other projects (without unit tests), and everyone was satisfied with this too.
There wasn’t a single question about our approach, and ultimately no-one in the higher echelons of the customer’s business cared about the minutiae of our approach, nor were they interested in why we thought our approach was best practice.
They simply wanted to see the results of our approach.
In retrospect, this might seem obvious, but the best way to convince anyone that your approach to doing something is practical and pragmatic, is to do it and measure it against other approaches. People don’t care about dogma, or why you think something should be the best way. Only by showing people the numbers and measuring the effectiveness of your approach can you truly show that your practices are effective.
To conclude: After this meeting, the project was delivered successfully without any more concerns from the customer. We were one of several projects integrating with Oracle and we were the only project to deliver on time and under budget, with a very happy customer!
How do I manage changes to the Onyx Employee Portal UCW?
With Onyx CRM version 6.0 and Consona CCM 7.0, you have a great feature called UCW (UI Configuration Workbench). There are several benefits to using the UCW. The Onyx Employee Portal 6.0 Technical Guide lists the main ones as:
Ease of configuration: UCW provides WYSIWYG configuration of many areas in OEP, enabling you to configure, compile, and test your configurations, including changes to user navigation and form presentation and behavior.
Custom OEP pages for different teams: Using UCW and OEP Profiles, you can configure the same OEP page differently for different teams in your organization, enabling profile-based user navigation and page presentation and behavior. You can apply your UCW configurations to one or more custom UIs (accessed via the related OEP profiles) or to all custom UIs at once (using the baseline UI accessed with the Global profile).
Upgradeability: When you configure OEP using UCW, you ensure that your UI configurations will be upgraded to the next version of OEP without requiring you to rewrite or re-implement your modifications. Customizations that are implemented outside of UCW, however, are not automatically applied when OEP is upgraded.
However, while the technical documentation has some best practices and tips and tricks, what isn’t well-documented is how to work with the UCW so that you can more effectively manage your UI changes. This post will show you how to split your UI changes into layers.
Following the approach I am about to describe has the following benefits:
- Several developers can simultaneously work on different UI features at the same time (in different developer environments) without causing any dependency issues or needing to “check out” or lock files.
- Changes to one area of the UI can be deployed without worrying about changes in other areas.
- Splitting the changes into layers means that you can “throw away” or remove whole areas of customizations without needing to manually edit the global delta xml files or delete your changes through the UI.
How does this work?
It’s very simple. When you make changes in the Onyx / Consona UI, the UCW framework is tracking those changes and adding all of your actions to one file called global_delta.xml. This file is found here:
EmployeePortal\ucf\data\layers\active
By default, all of your changes live in this file, whether they are changes to the company edit screen, the incident edit page, or the powerpage. This is undesirable and means that all of your customizations have dependencies and only one person can work on UCW at a time, even if you have several development environments, so it’s best to break up the work into custom layers.
Before your start, please add your Onyx UI files to source control! There are many choices and a lot of them are free. We use Assembla’s hosted Subversion repositories.
To add a custom layer, follow these steps:
- Navigate to EmployeePortal\custom\ucf\data\layers.
- Create an empty folder with your layer name. For example, if you want to add a layer for the company powerpage, name this folder companypowerpage.
- Navigate to EmployeePortal\ucf\data\configuration.
- Add the path to your layer to the layers.xml file. Set the sequence number so that this comes before the active layer and after the onyxvalidation layer. Adjust the sequence number of the following layers. In the screenshot below, we have added two custom layers: one for the company powerpage and one for the company edit screen.

The first time you edit your new layer:
- Navigate to EmployeePortal\ucf\data\layers\active – ensure that this is empty!
- Make your changes to the layer you are configuring.
- Move (not copy) the global_delta.xml file that has been generated in the ucf\data\layers\active folder back to the folder you created within custom\ucf\data\layers
Each subsequent time you edit your new layer:
- Navigate to EmployeePortal\ucf\data\layers\active – ensure that this is empty!
- Move (not copy) the global_delta.xml file within custom\ucf\data\layers over to the ucf\data\layers\active folder
- Make your changes to the layer you are configuring.
- Move (not copy) the global_delta.xml file that has been modified in the ucf\data\layers\active folder back to the folder you created within custom\ucf\data\layers
That’s it! Now you can effectively separate all of your Onyx UI changes into a more manageable structure.
The Fuss about Test Driven Development
There has been a lot of debate about the benefits, or otherwise, of Test-Driven Development (TDD). In this short post, I will attempt to enumerate some of the benefits, and show that practicing TDD means that your code becomes an asset to the business, instead of a liability. I will also point you to a few resources that will help you get started with TDD.
What is Test Driven Development?
Most people have heard the term Test-Driven Development (or TDD), but not everyone seems to understand what it means, so we’ll start with a brief definition:
Test-driven development (TDD) is a software development technique that relies on the repetition of a very short development cycle: First the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.
The Four Rules of TDD
Robert C. Martin, wrote a famous blog post that defined the three rules of test driven development.
- You are not allowed to write any production code unless it is to make a failing unit test pass.
- You are not allowed to write any more of a unit test than is sufficient to fail.
- You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
While Bob mentions refactoring as part of the TDD cycle in his post, I think it’s important enough to be its own rule. So rule 4 reads:
4. You should refactor your code once the tests pass.
It’s a technique that needs to be witnessed and practiced to really be used effectively. The steps are very small, with each cycle lasting perhaps five minutes at most. This means that you make lots of tiny steps towards your goal throughout your day, but each step is a “mini-milestone”, because once you get to the Green bar (or to the step where all of your test are passing), your code is in a known good state. This makes it simpler to return to that good known state via the undo button if you take a wrong turn and can’t get the next test to pass. This is a really refreshing change from spending hours in the debugger trying to figure out where you went wrong!
There are many productivity benefits to TDD that outweigh the additional time taken to create the tests. These include working code, less time debugging and a suite of automated regression tests that can be ran at any time. In addition, the tests allow us to change, or refactor the code without fear of breaking it.
One final point before I move on to discuss how to get started: TDD generates unit tests, but unit testing is not the same as TDD! In TDD, the tests come first, before the code they are testing and are automated. In unit testing, the tests typically come after the code, and are not always automated.
Code Katas
Given all of these benefits, it should be a no-brainer to decide whether or not to adopt this practice. And yet, there have recently been some debates about its effectiveness. I’m not going to recount these debates here, as my philosophy is “just do it”. If you want to know if TDD works, but you are worried about the amount of time it would take to investigate, then follow the kata approach. Wikipedia defines a kata as:
Kata (型 or 形, literally: “form”) is a Japanese word describing detailed choreographed patterns of movements practised either solo or in pairs.
While katas are most often associated with martial arts, it has also become a popular phrase for working with code. Again, from Wikipedia:
Code Kata is a term coined by Dave Thomas… A code kata is an exercise in programming which helps hone your skills through practice and repetition.
If you are interested in learning about TDD and code katas, simply set aside a short amount of time each day and start to experiment. To get you started, here are a few resources:
- Dave Thomas has posted several katas on his Code Kata website.
- Some screencasts of katas from the Software Craftsmanship website.
- Robert C. Martin’s screencast of his Prime Factors kata in Ruby.
In addition, you should really beg, steal or borrow (or alternatively, just buy) these books:
- Test Driven Development: By Example by Kent Beck
- Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin
- Refactoring: Improving the Design of Existing Code by Martin Fowler
In the future, we’ll be posting articles about different unit testing frameworks and techniques; until then, good luck getting started with TDD!
Watts Humphrey, 1927 – 2010
I just read that Watts Humphrey has passed away at the age of 83. My thoughts are with the family and friends of this great man, who cared deeply about improving software engineering processes. He founded the Software Process Program at Carnegie Mellon University and wrote several books on understanding and improving the process of developing software.
There’s an obituary from the university here: http://www.cmu.edu/news/archive/2010/October/oct28_wattshumphreyobit.shtml
Rest in peace, sir.
The Waterfall approach to reading
I was chatting to my wife the other evening and started to discuss reading lists. I wondered aloud how many years I had to live (30? 40? 50?), and was thinking about how many more books I would be able to read in that time. A book a week for 40 years would mean I could read about 2,000 more books in my lifetime.
A quick search netted this wonderful article from the Guardian Online: 1000 novels everyone must read, so that was a great starting point.
I thought about how the task of building a reading list would look like if I approached the task like a software project.
The Waterfall Approach
- Use the Guardian article, Amazon reviews and recommendations to create the complete list of 2,000 books I am going to read.
- Prioritize the list.
- Buy all of the books in the list.
- Work through the list, reading the books in order.
Now deciding ahead of time what you are going to read for the next forty years is clearly ludicrous, as so much will change in that time. My interests and priorities will change. The world will change. The available books will change. Even the cost and technologies for delivering books will change. All of this means that making decisions now about events far in the future is a pointless and expensive exercise, as most of the books in the list would go unread.
The Agile Approach
- Decide how far ahead you want to plan – far enough to avoid running out of books to read, but not so far as to make change costly.
- Make a much shorter list of books to read.
- Prioritize the list.
- Buy the first few books in the list.
- Keep updating this shortlist as your interests change and new books are published.
This approach has the advantage of having less overhead to maintain (a few books instead of 2,000), cheaper (less cost and inventory up front) and more flexibility (the list can change more easily over time).
Don’t plan in detail too far ahead, but be prepared for change
On many software projects, we are asked to plan iterations and projects months and even years into the future. This is as foolish as planning your reading list far in advance.
Just as most of the 2,000 books in our waterfall reading list would probably go unread, by the time we get to the end of a long software project, we know so much more about what we need to do and so much has changed that a lot of the later detailed planning has to be completely redone as it is worthless and out of date.
I’m not saying it’s worthless to have high level plans – in fact this is really important. We need to know if certain things have to be lined up ahead of time (for example communicating release plans and outages, getting users trained, making sure other teams are ready for the downstream affects of our changes) and we need to know when the last responsible moment to make those decisions will be.
We also often need to provide our customers with a ballpark idea of the costs and schedule of a project (is it a week? a month? a year?) before the project begins, but we shouldn’t treat this as being cast in stone. The plan has to be flexible enough to change with the landscape. The cost and schedule estimates need to be improved and updated as time goes on, as uncertainties about the project are reduced (I’ll write more about this in another blog post).
While a high level plan is a good thing, what is foolish is detailed design, task planning, assignment and estimating for items far in the future of a project. While this may give the illusion of control and predictability, it is just that: an illusion. In fact it’s harmful to have that level of detail because the more design artifacts and task details that need to change in a project, the higher the overhead of maintaining these details and the more rigid the project will become.
Just like keeping your reading list short and easy to change, you should keep your iterations and detailed project plan short. This will give you a flexible plan that can adapt as the project progresses.
For more ideas about shrinking your iterations, see my recent blog post on the topic.
XPath Tool – Visual XPath
A while ago, one of my customers asked whether there was a visual tool where he could click into an XML document and see the XPath expression generated from navigating to that node, as well as being able to type in the node and have it point to the correct place in the document.
The best free tool I found to fulfill this requirement is Visual XPath:
http://cid-4bb423973bbcdc56.skydrive.live.com/self.aspx/Public/visualxpath.zip
This will be useful to you if you are new to XML and/or XPath. There are some pieces of syntax it doesn’t seem to like, but it supports the basics (and helped my customer who was learning XML and XPath to avoid case-sensitivity issues and typos).
Are there other free tools out there that are as good as this?
The shortest amount of time that could possibly work – shrinking your iterations
It’ll never work
It’s hard to believe this with my looks, but back in Liverpool I sang and played guitar in a band. One day, in rehearsal we were working on a new song, and I asked the guitarist to play an unusual arrangement.[1] His response was, “it’ll never work – the chords are going to clash together.”
Now bear in mind, at this point we are in a rehearsal room, with guitars strapped around our necks and plugged into amplifiers. It would have taken thirty seconds to try this out and see (or in this case, hear) whether or not it worked, but instead a long argument about music theory ensued. Eventually we played it, and it worked.[2]
In retrospect, to get the guitarist to try out the idea, what I should have done (instead of arguing about music theory), was to say, “you know, you might be right, but let’s try it – if it doesn’t work, we’ll know pretty quickly and we’ll try something else.”
A resistance to short iterations
One of the things I almost always find when working with customers is a reluctance to shorten their development cycles. Although they begin to adopt a lot of good development practices and are enthusiastic about the benefits of an agile approach, they’ve been conditioned over the years to think that there’s nothing achievable in a week or less, and they want to start out with iterations a month long or more.
This resistance to change was recently summed up by Mike “GeePaw” Hill as a case of the “Yabbits.”
Yabbitting is when people go through a sequence of resistance statements, where each statement begins with the words, “Yeah, but…”.
While Yabbits can be annoying, Mike goes on to state their value:
Yabbits don’t always, or even usually, represent real resistance to change. On the contrary, they are probes, whose intent is to test an idea’s prima facie validity.
A person who offers you yabbits is typically more open to an idea than a person who says nothing at all.
So when faced with this resistance, remember that these objections are often coming because people care and because they have real concerns. I should have been happy that the guitarist cared enough about how the song would sound, rather than just going along with my idea.
Often it is easy to show someone who is resistant to change a way forward by asking them to try something for a little while and show them that there is little risk in trying it out. This approach avoids getting embroiled in an argument about about some esoteric theory of agile software development (or music theory!) For some practices, the change may be perceived as risky, but for others, like shortening an iteration, or playing a new arrangement of a song, the risk is minimal.
The shortest amount of time that could possibly work
The problem with having long cycles (particularly when transitioning from a traditional approach to an agile one) is that the cycles tend to behave like mini waterfalls: most of the work gets done at the end of the cycle, the testers have most of the features dropped into their laps in the last few days of the cycle, and a lot of the real tools and practices needed for a sustainable pace (for example continuous integration, build automation, automated regression test suites and improved communication) often don’t happen early enough in the project for the team to get real benefit from them and ease their transition.
The benefits of a short iteration far outweigh the risks. The only real risk is that you won’t get much done in the iteration, and the overhead of setting
up the iteration will be high. However, shortening the cycle means that you will not waste time in high ceremony activities, and any pain points or roadblocks will become evident very quickly. In addition, the risk of not achieving much soon disappears as you become much better at slicing requirements down into small but valuable features. You will also improve several techniques that will help you work at a sustainable pace.
To summarize, you will see the following benefits:
- Risks and inefficiencies are exposed earlier.
- High overhead activities like long meetings that don’t get you closer to your goal of releasing a valuable feature are removed or reduced.
- The team will work together, swarming on a single feature until it is complete, rather than continuing to work across many features in the traditional manner.
- Improved communication between the team and the business owners is necessary to keep the work flowing.
- Automation becomes a necessity, rather than a nice to have.
- Less temptation and opportunity to revert to old practices and do mini waterfall.
So given all of these benefits, how short should an iteration be?
Ward Cunningham famously rephrased Occam’s razor when applied to software development as:
…ask yourself, “What’s the simplest thing that could possibly work?”
Let’s redefine an iteration in this way:
Ask yourself, “What’s the shortest amount of time that could possibly work?”
In other words, find the shortest time-frame in which you can get something of value to the business done.
How short is that? Almost certainly shorter than you think.
How do you get there? Luckily, several people smarter than me have some ideas.
The disappearing iteration meme
There has been a recent meme about shortening iterations, with several people blogging on the topic from different approaches.
Michael Feathers recently wrote about Zeno length iterations, where he proposes an experiment:
Suppose that you had an iteration of one week, followed by an iteration of 2 days, followed by an iteration of 1 day, followed by an iteration of one-half a day, and so on…
…you can deliver business value in shorter times than you can currently imagine.
From Michael’s perspective, one of the main benefits of short time boxes is that they force trade-offs and produce creative solutions. He concludes by saying:
Look at your product today. If you only had one day to develop and deploy some feature, before putting the product on ice and letting it generate revenue as is forever, what would it be?
While I think Michael’s experiment is a little abstract, the point he is making is that you can deliver value with very small chunks of code – smaller than you think today.
Kent Beck recently proposed a different experiment in extremely short iterations, for a different reason, continuous deployment immersion:
Get the whole team in a conference room Monday morning. Choose a feature you are going to add. Have one person come up to the one machine in the room. Write one line of code. Deploy.
If you can’t deploy, erase that line of code and write a different line of code first. Deploy.
Once the deployment is done, write another line of code. Deploy.
About this time some of the rest of the team is going to be bored watching all the manual steps in the deployment. Have them go off and automate the most tedious, boring, or error-prone step. Bring the automation back to the conference room and start using it.
Kent suggests that by doing this, you will start to automate your deployment, automate your tests and understand a lot more about slicing up your features into smaller chunks.
By Friday afternoon you may not have made much progress on your feature (but you may be pleasantly surprised), but you will understand deployment much better than you do now. You will also understand how to slice development more finely and rearrange the pieces. You will also understand the value of automation.
He also (with tongue in cheek) concludes that it’s a crazy idea, but in reality, there is also a lot of value here. Forcing everyone to think about where their pain points are and making the pain points happen often (due to shortening the cycle) means that the team will be motivated to remove and automate those pain points and ultimately work more efficiently.
James Shore and Arlo Belshee also recently gave a very entertaining talk at the Lean Software and Systems 2010 conference, entitled “Single-Piece Flow in Kanban: A How-To.”
In it they propose stripping down a lot of the complexity of Lean and only having two queues, On Deck, and In Progress.
Ideally, only one item (Minimum Marketable Feature, or MMF to use Lean terminology) would be in progress at any time. Instead of moving the MMF through the traditional production line of Kanban (for example, through requirements definition, story queue, development, testing and deployment), you instead create a detective’s blackboard by putting all of the information about the MMF onto the board. The name comes from detective TV shows, where all of the information about a crime is displayed on a blackboard. This information might translate to tasks or information about the feature.
The whole team swarms on this single feature until it’s completed and then it is removed from the board and the next item added from the On Deck queue. What is fascinating about this talk is that while Jim and Arlo disagree about some details and definitions (including their definitions of an MMF), they both agree that this is a more efficient way to build software.
Try it!
While there are several approaches to shortening the iteration, or taking a Lean approach and not having iterations at all[3], the best approach for you is the one that you try. Whether you take Michael Feathers’ approach of shortening the iteration length to find a workable minimum, Kent Beck’s approach of starting with a single line of code at a time, James Shore and Arlo Belshee’s Lean approach of swarming on a single feature, or some other means doesn’t really matter. What does matter is not being scared to shorten the cycle until things are a little uncomfortable and real work needs to be done to make efficiencies such as automation or continuous integration, or coming up with creative ways to solve problems and chunk up work.
Don’t get bogged down in figuring which way will be the best to shorten your iterations – that is like arguing about music theory when you have guitars in your hands. Instead, just pick an approach and try it.
You’ll soon arrive at the shortest iteration that works for your team, and it’s almost certainly shorter than you think.
And before you become a Yabbit and say “it’ll never work” ask yourself this: “what’s the risk?”
- For the music geeks amongst you, one guitarist would play the three chord trick in the chorus, and the other guitarist would play the relative minor chords at the same time [↩]
- We recorded the song some time later and I think that those chords played together still sound rather nice [↩]
- For more information on Lean and Kanban development, read Jeff Patton’s excellent post, Kanban development oversimplified [↩]
Is your consulting code an asset or a liability?
Overview
When you hire consultants to build software for you, how do you know if the code is worth the money you pay them?
Consulting code (indeed, any custom code) should be an asset to your business, but unfortunately, many times it’s quite the opposite.
Consulting code can become a liability. Lack of tests and poor quality, buggy code can leave you, your code and your pocket book in worse shape than before the consultants arrived (and usually with little to no recourse).
Untested code has no business value
Years ago at the Agile 2006 conference, one of the sessions was “Delivering flawless tested software every iteration”, delivered by Alex Pukinskis. The catchy name attracted a big audience and it was standing room only.
During this presentation, Alex made the following statement:[1]
Untested code has no business value
This struck a chord with me, because at the time I was working for a company that was trying to transition to agile, but many of our practices still hadn’t changed. We were (okay I was) still breaking the build and still expecting the QA team to find our bugs for us. We weren’t consistently doing TDD, we had no automation of the build acceptance and we were not practicing continuous integration. I could go on, but I’m sure you get the idea.
The “aha” moment for me was the concept that the quality of the code, and a lack of defects was my responsibility as a professional developer. It was my responsibility to ensure that no defects were passed to QA. Of course, I know that software cannot be perfect, and there will be defects, but my attitude towards defects changed after that talk. Defects should be unexpected. Defects should be unusual. Defects should be prevented, not found.
No Bugs
The attitude that defects should be prevented, not found, can be summarized in the “No Bugs” philosophy.
James Shore recently published the full text of the No Bugs section from his excellent Art of Agile book. He summarizes the text in 99 words:
Rather than fixing bugs, agile methods strive to prevent them.
Test-driven development structures work into easily-verifiable steps. Pair programming provides instant peer review, enhances brainpower, and maintains self-discipline. Energized work reduces silly mistakes. Coding standards and a “done done” checklist catch common errors.
On-site customers clarify requirements and discover misunderstandings. Customer tests communicate complicated domain rules. Iteration demos allow stakeholders to correct the team’s course.
Simple design, refactoring, slack, collective code ownership, and fixing bugs early eliminates bug breeding grounds. Exploratory testing discovers teams’ blind spots, and root-cause analysis allows teams to eliminate them.
Asking the right questions
Now you are probably expecting some sales pitch from me at this point to say that you should hire us because we’re great. Well that’s not the point of this post (although you should, and we are). The point of this post is that the next time you are talking to a consulting firm or hiring a developer[2], ask them about their definition of code quality and how they ensure it. By simply asking a couple of questions you should be able to determine whether they are all “smoke and mirrors” or if they will add value to your business. For example, you might ask:
- What is your definition of quality code?
- How do you ensure your code is bug free?
The answer to the first question should mention practices like the Law of Demeter, coding standards, refactoring and adherence to the SOLID principles.
Although unsettling, it is okay if the answer to the second question is “I‘m never 100% sure my code is bug free” (particularly if they mention Gödel’s proofs). However, they should quickly follow up with, “I make bugs less likely by practicing test driven development, peer reviews (or pair programming), automated acceptance tests and adherence to coding standards and good design principles.”
If they can answer those two questions to your satisfaction (and follow through by demonstrating these practices when building the code) then they might know what they are talking about, and actually give you value for your money.
- I’m not sure whether Alex was quoting someone, but googling that precise phrase returned zero results, so I’m attributing it to him [↩]
- For more information on hiring developer team members, read http://jamesshore.com/Blog/Alternatives-to-Certifications.html [↩]

