Sunday, November 22, 2009

Planning Time and Sprint Duration

While having lunch with a friend of mine he mentioned that his team had frequently changing priorities and how the team tried having short (1 week) sprints to be able to adapt to business changes. He discussed how the team felt like the overhead of planning for a 1 week sprint was too high, so the team decided to abandon a sprint model. This conversation reminded me that this kind of question comes up a lot, especially with teams transitioning  to agile.

It makes a lot of sense to tune your sprint length to the rate at which requirements change and the rate at which the team can deliver functionality. Adding work as you go makes it difficult to make commitments and to measure progress, and new "high-priority" work can disrupt flow. If your sprints are 4 weeks long, then there is a greater temptation to add work mid-stream. If a sprint is 1 week long, then it's easier for a Product Owner to be comfortable slotting work into the next sprint.

A sprint isn't just the time spent coding. The planning and review are also important. So, what's a good ratio of planning to "coding" time in a short sprint? In a canonical 4 week sprint, such as described in Agile Project Management with Scrum the team spends 1 day on planning, and about 1 day on review and retrospective. This adds up to 2 days out of 20, or 10%. For a one week sprint, this same ratio gives us 1/2 day for review and planning.

Given the overhead of getting people together, and the dynamics of meetings, the calculation probably isn't linear. But I have worked on teams where we could do a reasonable job planning and reviewing in 1/2 day. This seems like reasonable overhead if:
  • The backlog is well defined by the product owners in advance of the planning meeting so that we can quickly estimate.  
  • Daily scrums start on time, stay focused, and fit within the time box that the team expects (typically 15 minutes)
  • The number of features is small enough that it is possible to have a focused review meeting in an hour or so, with 30 minutes allocated to "retrospective" discussions.
  • There is adequate interaction with a product owner during the sprint so that small issues can be resolved quickly and outside of the review.
This is my experience with planning for 1 week sprints. What are your experiences? How long do you spend in planning and reviewing? Is it enough? What are the prerequisites for an effective 1-week sprint? Please comment!

Tuesday, November 10, 2009

Doing Less to Get Things Done

Have you ever been in a situation where someone walks into the room and announces that they just got off the phone with a customer you need to add some functionality, described in very specific terms. As described the feature could take a lot of work, so you bounce around some ideas about how to do what the customer asked for. Along the way you realize that maybe, perhaps, there is another way that you can add a similar feature that meets the needs at much lower cost. But no one asked the customer what problem they wanted to solve. So what do you do now?

Some options are:
  1. Saying, sorry, we don't really know what the requirement is, so come back when you have more to say.
  2. Spend the next couple of hours discussing how to implement all of the options you think of, and planning how to get them done in detail
  3. List some options for what the customer might really mean, then delegate someone to fine out more, using your options as a basis for conversation.
Option 1 sounds appealing, but doesn't actually help you solve the problem of efficiently building (eventually) what the customer wants. While option 2 has you thinking about the problem and solutions, at some point you're making the solution more expensive than the customer probably wants it to be. This is an easy scenario to fall into since people, and engineers in particular want to solve problems. But a long conversation without data doesn't solve this problem and keeps you away from making progress on other problems that you know enough to solve.

Option third option is a good compromise. Spend some time discussing what problems the customer might want to solve focusing on the problem, not the solution (implementation). Then spend a few minutes figuring out how you might implement each proposed option so that you can attach a cost to each. Then delegate someone to have a follow up conversation with the customer using your options as a starting point. Three options is a good rule of thumb.

It's very easy to get caught up in solving problems without asking if you're solving the right problem. Whenever you're asked to to build something very specific, ask yourself if you really understand the problem. By taking a step back you can save time, and in the end have happier customers.

(For more on figuring out what the problem really is see the appropriately named book: Are Your Lights On?: How to Figure Out What the Problem Really Is)

Sunday, November 8, 2009

Fail, To Succeed

I was listening to a commentary on NPR about a pre-school graduation which mentioned a comment from an education expert Leon Botstein that "we should be rewarding: Curiosity. Creativity. Taking risks. Taking the subjects that you're afraid you might fail. Working hard in those subjects, even if you do fail. We should reward children when they show joy in learning."

This led me to thinking about a reason that some teams struggle with being agile. Agile teams are good at making corrections based on feedback. For this to work you need to be willing to honestly evaluate your progress against a plan, and be willing to revise the plan (and how you work) based on this feedback. This is a hard thing to do if you're used to the idea that any feedback other than "you're doing OK" is bad. (I have more to say about this in a contribution to the 97 Things Every Programmer Should Know project.)

Agile methods help you create an environment where it's safer to try things by providing for feedback at such an interval that things can't go that wrong. By making small steps and evaluating the results, you can take small risks that you believe will be for the better. And if it didn't work out, you haven't lost that much.

This process is visible at all scales in an agile project.

Sprint Reviews give the team a chance to evaluate features every sprint. It happens that, based on review feedback that features are removed as well as added or enhanced. And that's fine because the team only spent a week or two. In other environments such decisions might not be made til it was far too late to change course and either implement something new or avoid embarrassment.

Integration builds give the team rapid feedback when a code change causes an integration problem (even when the developer thought that it was adequately tested).

Unit Tests give you a chance to understand the impact of a refactor before you commit a change. You can see a problem before anyone else is affected. And you can decide to abort a change with unintended consequences.

Frequent commits to a a version management system allow you to recover from changes that become more involved than you thought.

Being willing to fail allows you to improve as long as the failures are small and easily identified. Being agile means being willing to take small risks.

Sunday, October 25, 2009

The 2009 Software Test and Performance Conference

Last week I gave a class on SCM for Agile Teams at the 2009 Software Test and Performance Conference in Cambridge, MA. The conference had a focus on Agile software development. Good SCM is essential to agile (and any) software development, though it's an oft ignored topic, so I applaud the organizers for considering the topic worth a session. And I thank them for inviting me to give the class.

At the risk of making sweeping generalizations, I like testers, and I tend to find that the way good testers think is very well aligned with the way that I think. Maybe this is part of the reason that I enjoy agile software development so much: testing and automation are very closely tied to the development process. One of the messages in my talk on SCM for Agile Teams is that testing is an essential part of the configuration management process. If you have good automated testing, you have to worry less about branching for isolation, and you save the overhead that (unnecessary) branching adds to your process.

If you have testing established as part of everyone's (including the developers) job, the tester's job becomes far more interesting. Rather than executing scripts and reporting "simple" bugs, a tester can explore the product and find interesting edge cases, driving software quality and starting conversations about what functionality the product needs. And testers and developers can collaborate on automation.

My class was during the last session of the last day, and I was happy to have the small number of people in attendance who were there. I hope that they learned something useful, and I hope that I addressed the concerns of the testers and test managers at the session. I know that I learned a lot from sessions that I went to lead by Michael Bolton and Scott Barber, among others.

If you're interested in more about the kinds of topics that were covered at the conference, look at the STP Collaborative. (And if you want to know more about SCM for Agile Teams than is covered in the talk, you can always read my book: Software Configuration Management Patterns: Effective Teamwork, Practical Integration
:) )

Saturday, October 24, 2009

Information, Interaction, and Scrum

A Scrum team that has dependencies on another group often struggles with how to integrate the other group's deliverables into their sprints. Since the other group hasn't signed up for the sprint commitment, and also has commitments to other teams, the Scrum team has the problem of how to commit to a delivery when they depend on someone outside of the team.

One way to manage dependencies is to list them as roadblocks. However, while that's a good start, it's not the whole answer. A few years ago I was working in the IT department of a large (not-a-software) company. My team was building a tool to archive a class of instant messages. We used Scrum, and consistently followed "the three questions" : what I did yesterday, what I plan to do today, roadblocks. A couple of items relating to the operations group were on the roadblock board for quite a while. While we had a designated contact in that group, he had many other commitments, and our requirements kept getting bumped.

After a while I asked the project manager if we could have our operations contact come to our daily Scrum. We promised that it would only be 15 minutes, and that this would be the only time that we asked him about the issues. After attending Scrum reluctantly for a few days, our ops contact started to be more enthusiastic, and our dependencies got done quickly, and the project moved smoothly from then on.

While I don't really know what our operations contact was thinking, it seemed to me that his presence in the Scrum helped him to understand how important his contribution to the project was. We were people he was working for, not just another issue in his work queue. Perhaps being in the Scrum helped him see himself as part of the team; people can commit to a team more readily than to a random issue.

Sometimes people suggest that, in the interest of efficiency, the best way to interact with external organizations is to generate a list of detailed requirements. The challenge with this approach is that by delivering a list of things you need rather than having a conversation of problems that you want to solve, you many end up with the wrong answer. This, combined with the teamwork aspects of having someone in the Scrum, lead me to believe that having someone join the Scrum as soon as roadblock items pile up is something to try sooner than later.

Agile works well because it focuses on individuals and interactions as a path to finding the information you need. While you need to be mindful of having too many people in every Scrum, if you find yourself wanting to pass a spec around rather than inviting someone you need to a Scrum, remember that sometimes interaction is more valuable than information.

Monday, October 19, 2009

Continuous Integration as Metaphor for Agile Methods

Build and SCM practices are essential for agile teams to deliver working software on a periodic basis. Continuous integration is an essential practice for agile teams, as described in the XP book: Extreme Programming Explained: Embrace Change, and Paul Duvall's excellent book: Continuous Integration: Improving Software Quality and Reducing Risk.

For those not familiar with the continuous integration (CI), it's a practice where a team has an automated build that monitors the source code repository for changes and builds and tests the software periodically. CI allows the team to monitor the state of the project and detect mistakes and integration errors quickly, minimizing the risk of someone on the team being stuck because they checked out broken code, and thus enabling the team to deliver quickly.

Continuous integration is also a good metaphor for agile software development not just because it's about providing feedback and enabling change, but because of the way that CI tools work.

While the concept is called "continuous" integration, most, if not all, CI tools work in "sprints." CI tools can be configured to check the repository using two parameters:
  • A polling interval: How often to check the repository
  • A quiet period: How much time should elapse between changes before a build starts.
There are a couple of reasons for not building after every commit. The first is that people can sometimes be undisciplined about committing change sets. You may forget a file and check it in minutes later. In this case the quiet period saves you from failed builds that are "false negatives."

The other reason for the quiet period is that, even if all the developers were perfectly disciplined about committing atomic change sets, the build system might not be able to keep up with the work of the team if it built after every change. Building after a couple of closely related changes gives you the information you need to keep the codeline healthy. Building more frequently could put you at risk of getting more feedback in a less timely manner.

While the "keeping up with the developers" problem can be fixed with technology, the idea of working efficiently by not building more often than necessary also describes how agile teams work. Teams periodically check to see what work there is, and once requirements are "stable enough" they plan and execute. This approach is valuable because chaotic change can lead to churn and reduced productivity. For example, a Sprint starts with a fixed backlog that the team plans and quickly executes. If the requirements change too much during the Sprint, the Sprint is supposed to be terminated and re-planned. In practice many teams allow for some changes to requirements, changing direction too often can waste energy.

Agile is about embracing change, but being agile is not the same as being chaotic. We configure our tools to work effectively to give the feedback we need; we can do the same with our teams.

Thursday, October 1, 2009

Enabling Change

I'm starting to gather my thoughts for the October issues of CM Crossroads which has a theme of "Overcoming Resistance to Change." Some of my favorite books on the topic of enabling change are:
While I can't possibly cover all of the ground that these books do, I can share some observations I've made while trying to help teams to do things differently, such as adopting Scrum or developing a more agile release management approach.

A common reason people resist change is because they follow "rules" that they don't understand no longer apply. When these "rules" are embedded in the culture of an organization the challend to change is greater, since its often more pardonable to fail when you've followed the established practices, than failing when trying something new. This is a big challenge to overcome, and there is no easy answer to addressing this challenge, other than to be aware that this behavior may be happening. But there are a couple of things that help make enable change:
  • Leading by example. Often others just don't understand that other ways are possible.
  • Gather (visible) data. Often others ignore uncomfortable facts.
As an example of the first point, I've been on teams where unit testing was dismissed as simply too hard to do, or a waste of time. By a small group adopting the practice in small cases (and refactoring the more difficult code to enable unit testing), they can demonstrate how the presence of the tests helps improve quality and speed of delivery. In this way a small group of enthusiasts can lead the way for the more timid. (Really Dumb Tests discusses a similar point.)

In other cases, the team isn't aware of a problem. A colleague of mine recently said "you can't change what you can't measure," and gathering data is essential to making a team aware of a need to change. Once you have the data, you then have the ability to make decisions, and then measure whether those decisions have the desired effect.

To make this concrete, imagine a team that is estimating tasks based on a 7 hour ideal day (and an 88hour work day). At the end of each 2 week sprint the team either isn't meeting its goals or is feeling overworked, yet none of the tasks seemed more complicated than expected. One possibly is that that the teams days aren't really 7-hours. To measure this you could keep a chart on the wall, measuring team and organization meetings, adding marks to a bar chart after each activity that seems unrelated to coding. If at the end of a two week sprint this number is much higher than 10 hours (10 days*(8hours@work-7hours-coding)), then you have some options to consider:
  • Run meetings more effectively
  • Decide if all of the meetings add value
  • Decide to estimate based on a shorter ideal day
  • Decide that the work day needs to be longer than 8 hours.
  • (etc)
It's important that:
  • The data collection be lightweight and that everyone understand that the data need not be entirely scientific to be useful. Too much effort to gather data can derail a change effort because of perceived cost.
  • The data be visible and incremental. A hand drawn chart on a wall can be more effective than spreadsheet data that lives on someone's laptop. (But electronic data can also be made visible in the right context)
  • The team evaluates the data with a goal of improving, not blaming. Maybe the extra time was spent in meetings was well-intentioned, or even necessary.
  • The team consider a number of options to change the situation. (See Finding and Evaluating Options for more on evaluating options.)
What's useful about data is that it avoids arguments about who has the most accurate memory. Collecting data may not solve the problem; the data may leave you with more questions than answers, but without data you'll have no good way to decide what to try changing, and if the change had the desired effect.

Change is hard often because people often don't understand the need for change, or the possible changes. By demonstrating the alternatives and their value, and by gathering data to evaluate current practices, you can start the process.

Lessons in Change from the Classroom

This is adapted from a story I shared at the Fearless Change Campfire on 22 Sep 2023 I’ve always been someone to ask questions about id...