Friday, 3 April 2015

Scrum Team Composition

Last week we saw how important it was to get the size of a Scrum team right. This time I will look at another issue that is just as important - team composition or who to put on which team.

Of course, if you only have enough people for a single team this blog may not be relevant to you. However, there are things of interest such as a look at personalities of team members and how that affects collaboration. [Late note: I have split off the bit about collaboration into my next post, so I only cover it briefly here.]

Personalities

The biggest problem I have found with the successful adoption of Scrum is team members who seem incapable of working effectively together. This can mostly be put down to personalities. First, different people sometimes just don't get along, for no obvious reason. This is why a bit of consultation, judgement and experimentation may be required when composing teams.


Typical developer personality profile
(provided by DISC Personality Testing)
More significant is that most developers generally have a personality type that rails against the collaboration inherent in Agile methodologies. If you are familiar with the DISC system of personality classification and assessment you may already be aware that software professionals are generally of the S personality type something like in the diagram. Importantly, for our discussion, it means they prefer to work alone. (However, I believe this is, at least partially, a learnt or conditioned behavior, as I discuss next week.)

This causes the sorts of problems you have probably seen, such as continual disagreement about approaches to technical problems. Less obvious is the developer who is uncooperative with Scrum practices or other areas of their work that they are unhappy with - they may be ostensibly open and helpful, and may not even be aware of their behavior and how it causes problems. Most important is how personality affects collaboration between team members.

Many companies adopting Scrum attempt to hire developers of the desired personality. This is why a lot of job ads emphasize the "team player" aspect. Some companies go as far as performing personality testing (such as DISC) on job candidates. I think this is the wrong approach as most developers can be encouraged to be collaborative given the right environment which I discuss next week.

Team Structure

I already talked about the different skills required (and not required) in an Agile development environment - see Agile Roles. What I did not cover is how to structure the teams, basically which people to put together in the same team. The basic rule is that you need all the skills in a team required to complete the tasks in the backlog of that team. I will elaborate on this below but first we look at why it is important.

Coordination

A major consideration when composing teams is to reduce the costs of communication by putting those people on the same team that need to work closely together.
Component vs Feature Teams   

In Succeeding with Agile, Mike Cohn calls teams structured around the architectural design of the software Component Teams. He contrasts this with teams structured according to customer requirements which he calls Feature Teams.

See Succeeding with Agile [ISBN-13: 978-0-321-57936-2] pages 183-188.
The simplistic way to do this is to group people working on the same sorts of things - so you might have an analysis team, an architecture team, coding, testing, installation and support teams, etc.

The developers too are split into sub-teams based on different parts of the software they work on, Examples I have seen are a database team, services layer team, display engine, AI, comms, backend server, web interface, etc. In Agile jargon these are called Component Teams (see note at right).

Component Teams do not work well in an Agile environment, as we will see, but even in a traditional non-Agile project they cause problems like:
  • silo syndrome (see Production Line Mentality)
  • unnecessarily complex designs (see below)
  • contorted designs due to changes made in the wrong place
  • modules with unneeded features due to perceived future needs
  • over-specialization
  • uneven workload
  • dependence on multiple teams to meet a deadline
  • code ownership problems (see below)
  • narrow focus on a specific task/module
  • lack of focus on delivering what the customer wants
  • isolating people who often need to communicate
  • need for lots of "interface" documentation
  • a lot of integration testing work
  • requires a lot more planning
An alternative is to be customer-oriented when composing teams. Each team can focus on one or more aspects of delivering something useful to the customer - ie, Feature Teams. Feature teams are focused on completing tasks on the product backlog. Typically these would be about different aspects of the user-interface, but other things may be important to the customer, such as data-compatibility with their systems.

Software Design

Talking about software design may seem completely off topic here, but the design of a piece of software is closely linked to how the people creating it interact. Some say that organizational structure determines software architecture. It could be the other way around. In either case it is important for those involved in the system architecture to also be involved in the creation of the teams.

Interestingly, this relationship might also explain why the Layer Anti-pattern is so common. I have noticed the tendency of organizations with many layers of management to also develop software with lots of layers. The Layer Anti-pattern demonstrates poor or unnecessary separation of concerns which interferes with the ability of modules to communicate and adds to the complexity of the software. Analogously, a layered organizational structure interferes with collaboration. Both are examples of how a simplistic layered approach can work against the DIRE.

DIRE

This whole discussion can also benefit from a consideration of the DIRE principle. Conventional thinking is that people doing the same things should be on the same team - a Component Team. Using the DIRE principle we compose teams in such a way that people who need to work closely together are on the same team. (In this case the team members are the "related entities" - see DIRE for more info.)

Further, this is a result of the Agile emphasis is on delivering useful features to the customer, by performing the tasks for a particular feature at once (or as close in time as possible). This is also an example of DIRE - in this case DIRE stands for "Don't Isolate Related Events".

Component Teams

Before we look at feature teams in detail let's cover how component teams work. Many of the deficiencies of component teams are due to developers employing "silo" thinking. See Production Line Mentality and Silo Syndrome for more on this -- but here I just discuss problems specific to software development.

Note that even teams that deal directly with the user interface may still be component teams. For example, the "GUI" team in the diagram below is a component team (as, of course, are the other two teams) since the development of most features would typically involve at least one other team.

Component Teams
In the following discussion I will discuss a theoretical component team with one or more dependent teams -- such as the Math Team in the diagram, which has the Services Team and the "GUI" team as dependent teams.

Complexity

Using component teams tends to lead a project towards the dark side called BDUF (big design up front), which I hope you are aware is very bad and the antithesis of the Agile approach -- if not see Agile Design. Components developed like this are always overly complex, with many unneeded facilities. This makes the code harder to understand, harder to verify, and makes it less amenable to modifications. In my experience, the worst thing is that it's harder for the users of the component (ie, dependent teams) to understand how to use it (see Gas Factory Anti-Pattern).

premature decoupling
is a common problem
The Agile approach is to develop the bare minimum that is required to allow the customer to use the software. The very first usable version of a program may be ready in just a few days and have no discernible components. It will later be refactored by decoupling different parts of the design when necessary, and, significantly, when it is more obvious how to best do so. Premature decoupling is a common problem even in Agile development.

If the team is certain of the best way to decouple (and that decoupling is even necessary) then it can be useful to create a simple component early in the evolution of the software. This simple component will initially be very small (perhaps only a few lines of code) but will be added to and refactored over time, as backlog items dictate.

Over time, components tend to be "owned" by one team (or even one individual). If other teams need changes to the component then they depend on the owner to deliver those changes. The component team then tries to anticipate what dependent teams will require to avoid the dependencies interfering with sprint commitments. As I have mentioned in the past, lots of other unnecessary stuff creeps in when the "owner" is focused on the component and not the backlog - eg: things that are "trivial to add and nice to have", "will definitely be needed eventually", etc. Moreover, these "bonus" features add to the debugging, testing, and planning burden, but most of all they make it harder to refactor the code and make the changes that are actually needed.

components tend
to be owned
by one team
Apart from BDUF, there is the problem that component teams naturally tend to focus just on the component, instead of the backlog items (ie, what the customer actually wants). They will have an idealized picture of what the component should do that is out of tune with what is really needed. They need to focus on customer requirements not component capabilities.

One consequence is that the dependent team(s) often have to make do with a component that is not really suited for what the customer needs. This results in a misshapen design which inevitably leads to bugs, complexity, and difficult to maintain software. This is a major reason why software degrades over time and has to be written from scratch (see Why Good Programs Go Bad).

CASE STUDY 1

I once worked for a company which had developed a world-leading piece of software that was heavily reliant on the display and manipulation of 2-D graphical objects. The company had developed a remarkably useful library for 2-d computational geometry. They had the good fortune to have a team of mathematicians who were also good C++ programmers who had created this component.

One of the most powerful features of the software was the display and manipulation of text. Among the text options was the ability to display text on many different base-lines: straight lines, lines at any angle, along a Beziere curve, etc. One of the base-line options was the ability to place the text on the inside or outside of a circle or ellipse. Of course, the geometry library provided an ellipse class which was used for many things and was the obvious thing to use for this type of base-line.

Like all the graphical objects you could apply an affine transformation to the ellipse class - for example, to move, rotate, enlarge, etc. The problem with using an ellipse as the base-line for text was that when it was transformed it was impossible to determine how it had been transformed. Even if you knew the before and after you could not determine what transformation had been applied. For example, an ellipse that was elongated in the X direction could be transformed into an ellipse elongated in the Y direction either by rotating it 90 degrees (or 270 degrees) or by reducing the X scaling and increasing the Y scaling.

In order to transform the text to match the base-line you had to know where each point on the ellipse had moved to. This was impossible to do if you only had the before and after ellipses to work with.

Unfortunately, the "geometry" component team were unwilling to modify their perfect ellipse class to facilitate its use as a base-line. The result was a kludge at a higher level in the code which caused bugs and maintenance problems.

Code Ownership

Component teams can become very protective of their work. I have seen some go as far as not making the source code available outside the team. Even if they do release the source, it may be strictly forbidden for anyone outside the team to make changes to the component, or even submit code to be included in the component. Change requests often need to be submitted in writing and can take months to be considered, approved and (if you're lucky) implemented.

As you can imagine, and may have even experienced, this can be very frustrating to a dependent team dealing with a customer who expects responsive changes. The component team may be unavailable, too busy, or simply not interested in making the change. A common problem is that the component team is unwilling to corrupt the purity of their component by acceding to the whims of the customer! Does this sound familiar?

One of the principles of XP (the guiding light in these areas of Agile development) is that there should be no code ownership (see Collective Code Ownership). Any team should be able to make changes to any of the code that is available to them. Of course, that is not possible with third party components without source code - but that is just another argument for the use of open-source libraries.

The key thing is that, if modifying the component requires specialist knowledge then each team needs at least one developer (even if shared) with that knowledge, or needs to acquire the knowledge. (Of course, the need for lots of specialists is symptomatic of a non-Agile environment as I discuss below.)

CASE STUDY 2

There was once a company with a software product that dominated it's market throughout the world. It was used by some of the largest companies. Most of these clients required a high degree of customization of the software to suit local markets, regulations, etc.

This was a large piece of software based around the template design pattern - essentially a "core" system with many extension points. The "core" component was tightly controlled by the main development team at the head office of the company. Several on-site customer teams used the extension points to customise the software to individual customer requirements.

* This configurability came at a large cost. The main problem was that it added a great deal of complexity making it hard to understand and modify the system. This also had knock-on effects such as poor performance.
However, despite it's immense configurability* there were many customer requirements which could not be accommodated, and required (or should have required) core changes. As you can imagine, it was extremely difficult to get timely changes made to the core system, if they were done at all. Scheduling conflicts meant that requests for changes needed to be submitted many months in advance. The teams at client sites found the core team arrogant and uncompromising. The core team were upset at the barrage of stupid and conflicting requests.

Inevitably the integrity of design became compromised. Many facilities were simply tacked on to client systems rather than being properly implemented in the core. This contorted the design and created maintenance problems. Moreover, the same thing was often implemented by different client teams in different ways - an obvious violation of DRY.

Planning

Component teams require a lot of coordination and planning to ensure that the components work well together and the development of all components is on schedule. (A great advantage of Scrum is that it requires much less planning work.)

Integrating components and integration testing is also required, but if coordination (and documentation - see below) between teams is inadequate then integration tasks can blow out enormously.

Using component teams also makes it far more likely that deadlines will be missed. It only takes one team to be late for the whole project to be delayed.

Component teams are also more likely to suffer from uneven workload. Sometimes they have little to do; other times they are overloaded due to different dependent teams waiting for critical functionality. Component teams will invent work if they have none, which can be good if it is refactoring the code to improve its quality (maintainability, efficiency, etc), but it is often unrelated to any current customer requirements.

A common scenario with highly-specialized component teams is that they are formed near the start of a project then quickly complete most of the required functionality, whence the team needs to be down-sized or even disbanded. This can lead to valued developers leaving the organization because it seems that their work is complete and they have nothing much of interest to hold them. Alternatively, the organization will start inventing work for the component team - but this work tends to become less and less customer-focused.

A project using component teams often needs to be reorganized which is counter-productive. The truth is, it's hard to build a good team that works well together - at least partly due to personalities (see above). Once you have a well-functioning team you don't want to change personnel too often. Many Agile teams can go unchanged for years, pumping out quality software.

Agile teams can
go unchanged
for years
A big problem for a Scrum team working in a large organization is "external dependencies". Scrum teams will strive to finish their sprint backlog by the end of the sprint but are continually frustrated by being dependent on people outside the team. If you have this problem then it indicates that the teams are not really feature teams.

Documentation

Component teams tend to produce lots of documentation, since they need to explain the interfaces so that other teams can use their component(s). Of course, as you know, Agile favors "working code over documentation". We all know the problem of documents (time-consuming to create, difficult to understand, incorrect, out of date, etc), so how can we avoid this problem?

Another Agile principle, continuous integration, means there is far less need for documentation. If the component and the code that uses it are developed at the same time (by the same team) then this avoids the need for documentation, hand-overs, integration testing, etc. Continuous integration works far better with feature teams than component teams.

Continuous integration and feature teams work together to reduce the need for large amounts of documentation.

Feature Teams

Feature teams are a different way to structure a project. Here we try to avoid having a team that is dependent on any outside person or team in order to complete their backlog items. After all it's only the members of the Scrum team who are completely focused on meeting the sprint objectives.

feature teams
can and
should specialize
Note that there is some dispute about what constitutes a feature team. This is caused by some people insisting that feature teams do not specialize. The fact is that feature teams can and often should specialize.

For example, a common definition of a feature team (which I believe is inadequate) goes something like this:

A cross-functional team that has all the skills required to complete items from the product backlog.

This definition implies that all feature teams are equivalent since they must be able to complete many or all items from the product backlog. It assumes that the product backlog has, and always will have, items of a similar nature.


Feature Teams
The problem is that real-world projects have backlog items of amazing variety. Consequently, different feature teams can, and probably should have different capabilities. I discuss this below under Specialist Feature Teams.

The diagram at left takes the members of the three component teams (in the component teams diagram above) and creates three feature teams. Note that there is a specialist "Charts" feature team which is the only team that requires developers with knowledge of the geometry library and the charting component.

Specialist Feature Teams

A feature team can specialize as long as it specializes in things that are important to the customer. As an example you might have a feature team that does not deal with the user interface; instead it handles interfacing with other client systems since it may be critical for the customer to get up-to-date information (eg, inventory levels). A team concentrating on this area of the software would have specialist knowledge very different to that of feature teams dealing with the GUI.

teams
should be
long lived
Of course, even such a specialist feature team should not be so specialized that they can't work on other general backlog items.

We also need to keep in mind that feature teams should be long lived. Before creating a specialist team it should be fairly certain that they would have an ongoing supply of high-priority backlog items to suit their speciality.

Scrum Jargon       

Product Backlog: prioritized list of tasks for the project

Backlog item (PBI): a single task on the product backlog
General item: a backlog item that can be taken by any feature team
Special item: a backlog item to be taken by a particular feature team
Team Backlog: Subset of product backlog allocated to a specific team
Sprint backlog: the items that a team commits to complete in a sprint
Specialist team: preferred team to deal with special items

Collaboration

Feature teams are a great example of DIRE. They promote collaboration by getting people who are responsible for a feature to work closely together.

This collaboration has the advantage that the team members are all focused on a common goal rather than their own small area of interest. Moreover this focus (on high-priority backlog items) is of direct relevance to the customer.

This sort of collaboration helps avoid the Silo Syndrome (see Silo Syndrome in Production Line Mentality) and over-specialization (see below). It also addresses coordination overhead by greatly reducing the need for written documentation, etc.

Evolutionary Design

The basic Agile approach is that changes are made in small increments, so that the software gradually evolves into what the customer wants. By taking "small nibbles", slow but steady progress is made. The overhead of large hand-overs is dramatically reduced and integration problems eliminated. Further, the customer is happier because they can see what is happening. (There may even be a perception that the development took less time than it actually did.)

evolutionary design
is easier
using feature teams
The only advantage to taking "large bites" instead of "small nibbles" is from economies of scale. However, (as I already discussed in Agile Design) this is far outweighed by other problems like reduced visibility. To continue the analogy, there is a tendency to bite off more than one can chew.

However, each small nibble may possibly involve changes in many different areas of the code. Hence a team requires all the skills to make the changes. That is, evolutionary design is easier using feature teams.

Specialists

A big problem with a lot of software, especially much legacy software, is that it can only be modified by a small group of specialists. Whether this happens intentionally or not, it works as a form of job preservation for them. Due to a poor design and a lack of documentation only the "gurus" who understand how it works can modify it; these are usually those who wrote the software in the first place. (Note that by "poor design" I may simply mean that it is unnecessarily complex, though typical legacy applications have many other problems.)

These specialists are only required due to the complexity of the design. It's usually not that the component is performing an inherently difficult process; it is simply the way it has been designed and built (and not documented).

Feature teams are far less likely to create such components since there is no code ownership. An underrated advantage of feature teams is that they reduce dependency on these "specialists".

Finally, consider the worst case scenario. This is where somebody (usually an existing component team) decides to build an in-house component, rather than use a perfectly adequate off-the-shelf or open-source one. Typically the project must then deal with an expensive-to-implement, poorly-documented, hard-to-use component for little, if any, advantage. A feature team is focused on giving the customer what they want, as simply as possible, so is much more likely to go with the open-source solution.

Feature Team Problems

Using feature teams does increase the likelihood of conflicting code changes, but this is not a major problem especially if you take my advice and allow some team specialization. Often conflicting changes can be merged with little or no problem. Sometimes it may require a few team members from different teams to get together and work out how to combine the features. Occasionally the teams may need to go back to the PO(s) to point out conflicting requirements.

One thing that worries many people is that they think chaos will ensue if all developers can modify any of the code - the fear is that the quality of the code will rapidly degrade. This simply does not happen as long if there is someone on the team with the skills needed to do a proper job. (If a team member must make changes outside their area of expertise then it should be carefully reviewed by the relevant expert.)

One problem is if there are not enough specialists for all the teams. In this case specialists should be shared between teams, and encouraged to pass on their knowledge. (But remember, as I discussed above, feature teams do not tend to create components that require specialists anyway.)

Task Allocation

Once you have multiple feature teams the next problem is how to assign tasks to the different teams. This depends on your PO(s) (product owners). If you have a single product owner for all the teams then you need a single product backlog from which all teams derive their own team backlogs.


Even with multiple PO's it is beneficial to maintain a single product backlog for the project. Of course, this requires the PO's to meet to work out the relative priorities of all items and assign them to different teams. (This can be difficult with vastly different items, like comparing apples and oranges.) As an example, the diagram above shows a product backlog split between three teams.

In doing this it is important to carefully consider the task assignments, depending on the work-load and experience of the teams. For example, the same team should probably perform related items from the same Epic. In the diagram you can see that the Charting Team has enough high-priority Charting Tasks, but if they didn't they would need to work on other tasks like the General items. The PO(s) should ensure that each team has enough tasks in their backlog for at least two sprints (based on rough estimates given in grooming).

One obvious, but important point, is to ensure two teams do not accidentally end up working on the same task.

CASE STUDY 3

This case study concerns a Scrum team (one of several) in a large company, tasked with supporting and maintaining a legacy application running in thousands of locations. The software was highly configurable (and regularly configured). Apart from the PO and SM the team members were:
  • 5 testers
  • 4 configuration experts
  • 3 developers (coding in 3 different languages)
  • 2 business analysts
Most of the PBIs (product backlog items) were configuration changes - requiring configuration experts, testers and often a business analyst, but no developers. Apart from config. PBIs there were also PBIs for small software changes and occasionally large developments - mainly requiring coding but with possible involvement from anyone in the team. Even if there were no software enhancements in the product backlog there were always low-priority (usually historical) bugs to fix.

The product backlog typically contained mostly configuration and general tasks with a few low-priority bug fixes (see Typical Product Backlog in the diagram). For a fortnightly sprint the sprint backlog would be composed of the highest priority tasks (mainly config) plus a few development tasks to give the coders something to do.


However, there were sometimes high-priority developments, in which case the product backlog would look very different (see "Development" Backlog in the diagram).

The major problem that the team experienced was due to the mix of tasks. Most of the time the high priority tasks were configuration and of little or no consequence to developers. Sometimes there was a major development that was of no interest to most of the configuration experts. In most meetings (planning, standup, grooming) there was a lot of discussion that was only understood by a subset of the team, which meant there was a huge amount of time being wasted by people in meetings that were not important to what they were focused on.

Component Teams
There were other problems such as many tasks being highly dependent on external people - indicating that this was not really a feature team. Another thing was that the configuration guys preferred to have a standup at 8:30am, while the developers preferred 10:00am. It was also demoralizing for the developers to be continually handed low-priority "scraps".

It was obvious (not just because the team was too big) that the team should be split into multiple teams. So how would you split up the team?

It was suggested to use a team structure of Testing, Configuration and Development teams.  This was similar to the teams that existed before we adopted Scrum. See the Component Teams diagram above.

Feature Teams
A better approach would be to create two (or even three) feature teams to deal with the types of backlog items that were commonly encountered. The approach I recommended was to have a Configuration Team that dealt with configuration backlog items and a Development team that would deal with programming tasks (and other tasks if there was not enough development). See the Feature Teams diagram at right.

Each team would have their own backlog derived from the product backlog (see diagram below) and would not have to deal with meetings and discussions about tasks that they did not need to focus on. (Of course, that did not mean whatsoever that communication between the teams was discouraged, when necessary.)



Conclusion

An important part of implementing Scrum is to carefully choose the composition of teams.

First, it is important to consider personalities when building teams. This requires good judgement and a measure of luck to get right. Don't be afraid to experiment and change teams around if things are not working.

From an Agile standpoint it is also important to get the skill mix right. Scrum teams should be formed around customer needs not around the software architecture -ie, use feature teams not component teams. One of the most frustrating things for a Scrum team is repeatedly failing to complete sprints due to external dependencies.

As well as creating external dependencies, component teams also:
  • need more planning and coordination effort
  • tend to produce overly complex designs
  • create and depend too much on specialists
  • focus on their own small world instead of the big picture
In contrast, feature teams encourage collaboration and avoid the problems of component teams. Amongst their advantages are such diverse elements as:
  • keeping all team members focused on the customer
  • making specialization less likely (see Production Line Mentality)
  • putting together team members that need to work together (see DIRE)
  • allowing teams to work without being frustrated by external dependencies
  • focusing on only delivering what is required now (see Fifth Element)
In brief the rules/attributes for feature teams are:
  • the team has all the skills to tackle tasks on their backlog
  • every team member could make a contribution to each backlog task
  • specialist teams are useful if the backlog has different classes of PBIs
  • you anticipate enough special items to justify creation of a specialist team
  • feature teams are stable and long-lived
  • feature teams are highly collaborative and focused on the customer
Next week I will look at personalities and why teams do not collaborate.

6 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Thank you for submitting this post. I found it quite interesting as I am a team leader and I lead the team of scrum specialists. Also, I appreciate the value of documentation in the process of software development. I'm aware of the fact that it's amount might be a bit overwhelming and it's good to know how to deal with its management so as not to get swamped with it.

    ReplyDelete
  3. Thanks - I hope your specialists are not too specialized, or at least not too focused on their specialization but rather what the customer needs.

    Also, since you mention documentation, you should check out my Sept 2015 post.

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete