Bindings, Platforms, and Innovation
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
Tracking change and innovation in the enterprise software development community
Posted by Mark Levison on Jan 05, 2009 03:00 AM
I've encountered a number of teams in our organization struggling to adopt Test Driven Development (TDD) [1]. Occasionally one or two developers succeed without help but most don't. To better understand the problem I surveyed team members and found that even after classroom training much needed to be done. This comprehensive strategy was designed to help anyone introducing TDD into an organization, though some of the problems and ideas will only be applicable to medium and large size companies.
Agile Development: A Manager's Roadmap for Success
Ebook: Scaling Agile with C/ALM
Ensuring Code Quality in Multi-threaded Applications
The Agile Business Analyst: Skills and Techniques needed for Agile
My survey of team members (all of whom had received training) revealed these blockages:
With all these symptoms, what are the underlying problems?
Test Driven Development can be very hard to learn. The learning phase (the time during which it becomes a deeply ingrained habit) typically lasts from two to four months, during which productivity is reduced [2]. Eventually the benefits will be obvious and the technique is usually self-sustaining, but the question is: how to get there? Many developers give up after only a few days.
Most adoption strategies I've seen focus on classroom training (or e-learning) and one-on-one mentoring. Done well, these are excellent tools and can be part of the solution, but I think more is required.
Classroom training suffers from two key problems: the examples are too easy and don't relate to real problems; and not enough chance to practice.
Online training (both Object Mentor and Industrial Logic, among others, have offerings), has the advantage of going into more depth. However there still isn't enough chance to practice. In addition these courses are normally done without interaction with other students. Hearing questions from your classmates and colleagues can often help trigger understanding.
One-on-one mentoring doesn't scale beyond a few members of one team. This is especially difficult in large corporate environment where there are only a few experts and hundreds or thousands of people needing help.
Books are an excellent option but few developers like to read books about their trade craft, and even those who do find learning TDD this way to be a tough slog. Like the online courses, the problem is learning on one's own.
Finally: legacy code makes an already difficult problem harder. Developers rightly ask the question: "How do I test these tightly coupled objects? This code is complicated, how do I test this algorithm?"
So what works? The previous approaches suffer from two key problems: a lack of depth and no collaboration. A complete strategy will instead appeal to multiple modes of learning and have many elements.
At the core of this plan is: creating conversations and increasing collaboration around TDD. Three of these strategies are focused in this area: Pair Programming, Coding Dojo and a Reading Workshop.
The Coding Dojo (using the Randori Format) is an event where a small group of people (max 15), solve a problem using TDD (adapted from Danilo Sato):
From experience I recommend that you choose very small problems to start.
For the Reading Workshops there are a number of books that make good choices:
Typically teams try to cover one to two chapters a session. The pace is slow enough that people can read outside of work without it becoming a burden. In addition, it allows enough time for in-depth discussion of a few items in the chapter.
Both workshops should have pizza (or a healthier lunch option) supplied - you're asking people to spend their personal time doing something work related, they need a suitable incentive. The two workshops can alternate weeks so that people don't feel that they're getting stuck in a rut. Finally don't expect the same group members in every session.
Workshops and communities are an improvement over self-directed learning because team members are engaged in conversation and collaboration. As a result we learn about things we wouldn't otherwise have considered.
In summary, here are the keys I've identified to create a successful adoption strategy:
This approach is already in use, working to improve adoption of TDD inside one large corporation.
Thanks to Lasse Koskela, Nat Pryce, Dave Nicolette and Dave Rooney for taking the time to review drafts of this article.
[1] For the purposes of this article TDD is the habit of writing the tests before the code and working in small increments. It is not producing a large number of Unit tests after the code is written.
[2] http://tech.groups.yahoo.com/
[3] Perceived productivity will go down - i.e. the number of stories delivered in an iteration will reduced. However since the quality will improve right from the start the slowdown isn't what it seems.
Mark Levison is the principal consultant with Pure Agile Consulting, an Agile and Lean consulting company that focuses on helping its customers to deliver working software every two weeks. Mark has been an Agile practitioner since 2001, introducing Agile methods one practice at a time inside a small team. In the past three years, as an employee of a large ISV, he's been responsible for introducing Scrum to the organization and coaching a number of teams - including the design of a Test Driven Development strategy and introduction of a number of practices to support it. Mark is an Agile Editor at InfoQ and has written dozens of articles on Agile topics. He also publishes a blog - Notes from a Tool User. When not in front of a computer, Mark spends his time with his wife and two daughters.
Good post, Mark. I think the big point in here is the "slowdown". Non-TDD developers will experience a time of reduced productivity, but this obviously is a sacrifice that has to be made to improve output quality. This is a pretty obvious point for TDD heads, but it's difficult to explain this to non-technical folk. For example, give me a 3 month period of reduced output and hopefully in 6 months, quality & defect counts will improve. That's a leap of faith! Necessary, but a hard sell.
Thanks David. We're in agreement "slowdown" is a key message to both Developers and Management.
But this is only a temporary slowdown... TDD will result in better and cleaner desing, so it's easier (read: faster) to maintain the product later on and you also get issues solved faster as it's then a matter of improving some tests that you already have and go for a solution instead of rethinking everything from scrach with each defect found in the system. So it's not only the initial slowdown to get better quality but also a higher speed after few weeks.
Marcin - thanks for the comment. I think that we're all clear that its a temporary slowdown. For some like yourself it was only a few weeks. For others longer. The key however is communicating this expectation to management and team members so they don't panic when they see it happen. Also I can tell you in a large corporate env it seemed to slow us down a bit longer. Maybe because of the crufty nature of the existing code or maybe because we'd all become old and stiff.
Good article! A few other considerations for a TDD-champion: - FIRST, understand the reluctances and adopt the same point of view. This will give you a common understanding and baseline for discussions. In order to convince the skeptics, you need to fully understand where they stand and why they are standing there. - Test data is a very real and complex problem. It falls in the category of things that are not addressed in "examples of using TDD are too simple and do not reflect real life problems". How to maintain test data that is relevant and exhaustive enough for tests to be meaningful and cover real life cases, while keeping maintenance/refactoring costs down? Until your team has figured this out for themselves, it's doubtful that they will "enjoy" developing automated integration tests. - Focus on quick wins first (easy to implement, providing real benefits). Have testers and developers sit together for a while to work on designing tests first. Developers should appreciate that, hoping it will reduce the numbers of bugs found later. - print out and distribute the most relevant chapters on TDD from Agile leaders. - if things are not looking good -and before reluctance has built up to the point of no return!- design and agree on TDD standards for your team and *DO* impose a 3-month mandatory-no-exceptions-do-TDD period to the whole team. After this period, discuss the findings, and hopefully by then they should all be convinced (with some subtle guidance, coaching and assistance on the way!). If a justification is required in order to avoid a revolt, then show them the talk by Ken Schwaber (on Google Video, entitled "Scrum et al."). Explain to them that they have nothing to loose (this will require understanding and support from management), but everything to gain from having one more tool in their toolbox.
Excelent article to ramp up for adopting the TDD, what about the existng frameworks either NUnit, Microsoft... etc do they allow to implement TDD in a easy way from developers stand point, could those frameworks the reasons of developers just does not get it, what are differences?. One point is to know the theory other is how to use those frameworks to take over the TDD. Regards.
Of course, the irony is that every large organisation I've been in has had a steady stream of initiatives and reorganisations, each of which has cost time and effort with the promise of future benefits. We need to tap into some of that, um, optimism.
I've been interested in TDD for sometime now and I've used it in a couple of situations. My advice is, you need to try it and stick with it, no matter how frustrating it is at the beginning, you will love the results. I do have a problem and I am looking for some advice. I am now on this project where the coding is almost "complete" but there is not a single test written for the code!! Has anyone ever implemented TDD into a project that has already been "completed"? What would be the best approach for this? What was your experience? Should we just start writing test as the bugs start coming in? The team is not experienced at all in TDD and the project is close to deployment. My fear is that as bugs come in and being that the team is not experienced in TDD, its going to take a longer time to fix the bugs, possibly causing the client to get upset. Any stories on this issue?
I wouldn't say a story so much as an entire book. Micheal Feathers wrote the book "Working Effectively with Legacy Code", its probably the best place to start. In addition helping people out of these holes is part of my business. I can be reached mark at pure agile dot com
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.
This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.
This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.
This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.
After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.
IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.
Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.
9 comments
Watch Thread Reply