Thursday, 15 October 2015

Is Eliminating Cross Team Handoffs Possible?

No.

Well, not completely anyway. But just because you can't achieve something doesn't mean you shouldn't strive for it.

Lots of advice floating around in the Agile space tells you that handoffs from one team to another are expensive and inefficient: The DevOps movement has given way to the Anti-DevOps movement, suggesting that the development team should do their own Ops; I've written about The Vicious Cycle of Support whereby the development team should support their own output; separating business teams from technical teams can lead to an unpleasant client-supplier relationship where neither side can work effectively.
So do we just need one huge team with everyone in it?

Well, yes. Except for the "huge" bit.

It's been a core concept of most Agile doctrines that you keep your team small, and your immediate scope small. And the people in that team don't just stick to one role - they chip in and help out wherever it's needed.
I've said before that I think the optimum set up is two developers and a product person. That assumes, however, that all those people are very experienced, and are willing to cover off between them the jobs that we typically divide up into the separate roles of Business, UX, Design, Coding, Testing, Release, Support and so on. That may sound ambitious, but consider the benefits:


  • No communication overhead. Everyone knows exactly what's going on, and everyone is working from the same assumptions.
  • Focus. There's no way you're going to be able to juggle 5 projects at the same time like bigger teams are often expected to do.
  • A sense that you really are a team, and that you own this deliverable end to end. This is the same reason that startups are such exciting and dynamic places to work, and often take the market by storm. 
  • You wake up and feel motivated to come to work! It's fun. And when people have fun doing their jobs, all sorts of virtuous cycles develop. Talented people want to come and work for you. People feel inspired to come up with genuinely new and exciting ideas.
  • Everyone in that small group is forced to understand all the domains end to end, which were previously kept separate. And when people understand things end to end, your quality shoots up because there are no unexpected implications from decisions made in isolation; there are no lost opportunities ("if I'd known that was something we'd want to do, I'd have built it differently!")
  • The team can be autonomous. No more waiting. No more chopping and changing at the whim of far-removed senior management or marketing teams. With clear goals, and empowerment, it's pretty amazing what three people can achieve.

(In case you're wondering why handoffs are bad, see Pawel Brodzinski's blog post on it)

The Vicious Cycle of Support

Developers who don't have to support their code in Production unsurprisingly don't consider all the implications of their changes.
Logging, monitoring and alerting are afterthoughts. Questions like "What happens when the network fails?", or "What if we run out of disk space?" aren't at the forefront of people's minds.
The difficult test scenarios get ignored because "We should probably test those things, but the test environments are rubbish and besides, this is how we've always done it."

But the result isn't just that a particular feature going live drags some poor guy out of bed at 3am (the traditional time that hypothetical production issues take place). And it isn't just that the metrics on number of live incidents rises over time. It goes much deeper than that.

When Support teams are separate to Development teams, developers don't understand the domain of Support, and vice versa.

The problem with the former is that systems that weren't designed to be supported are hard to support. The cost of that support effort grows over time.

The problem with the latter is that if Support people make fixes, they do so without understanding the domain fully. This causes further instability and technical debt, and also creates a system which neither developers nor support people understand.
Of course, developers continue to build on these foundations, which compounds the problem still further.

Still, you shouldn't be downhearted as a developer in this kind of company. At least you don't have to support it!

Death By a Thousand Incomplete Refactorings

Start with a fairly new IT system. The lead developers built it with a Shining Vision of the perfect architecture, and that vision has been realised. The team has put most of the finishing touches on it, the initial waves of bugs have been exterminated. We're proud of it. We even spend some time refactoring a couple of bits we rushed.

The lead developers feel like heroes. They stick around for a couple of years basking in the glory of being the people who understand the system inside and out.
And then, gradually, the realisation dawns that there's some technical debt which needs addressing. Possibly it's been there all along, it's just that the system scaled or was extended in ways we didn't anticipate. Possibly it's caused by developers building stuff without understanding the Shining Vision. Possibly it's down to The Vicious Cycle of Support.





Whatever it is, the Make it Shiny Again project is born. One of the original veteran lead developers spends all day every day telling people about how the Shining Vision got lost, and now enough senior people have listened. Troops are mobilised.

The big refactoring goes well at first. Everyone is behind it. Update emails go out gleefully reporting the excellent progress. Demos happen. Meetings show high level progress and sing the praises of the Make it Shiny Again project. It will destroy disease in the third world. It will bring peace to the Middle East. It'll even increase our unit test coverage.




But, inevitably, as the project stretches on and the full scale of the task becomes apparent, people begin to lose energy. It looks like the timescales are moving out. Fewer and fewer people are extolling the virtues of it. Even the veteran lead developer has got distracted by a new even shinier way of doing things. The project joins the ranks of other tedious long term projects with no sense of urgency, gathering dust at the bottom of the project plans. (In some companies, "long term project" means years. In some it means weeks. Either way, energy attrition occurs).




Eventually something goes live. It may feel like a pyrrhic victory, but it delivers value. One part of the system has been refactored, and is running successfully alongside the old system. No one has the energy to celebrate.

Some conscientious members of the team ask when we'll move on to the next phase of refactoring. Tumble weeds drift across the office floor. Strangely, no one fancies descending back into that dark chapter of their lives.

The final solution, once all functionality had been refactored, meant the switching off of the old system:



However, what the Make It Shiny Again project actually achieved was this:




Now drill deeper and look at the code. Many many incomplete refactorings of different things have happened. Everyone touching the code has either not understood that particular area's Shining Vision, or has sought to impose their own.
Now look at it from 30,000 feet. Whole swathes of the architecture (and the organisation) have undergone incomplete refactorings.
If you squint a bit, the architecture is a fractal. It looks like spaghetti at any level.


No wonder it all feels like such a mess. The solution? 
Let me unveil my Shining Vision. We'll finish it this time, honestly we will.


Less bleak footnote
This can be avoided. Some technical debt is inevitable1, but Death By a Thousand Incomplete Refactorings is not:
- Don't bite off more than you can chew.
- Deliver in small increments. If it's going to fail, make sure it fails early.
- Celebrate each small success. 
- Swap people in and out - keep it fresh. Let everyone be involved.
- Recognise the risk of an incomplete refactoring!




1 See Martin Fowler's TechnicalDebtQuadrant↩

Thursday, 8 May 2014

Bend Over Backwards. Now Stay There.

High staff turnover is a bad thing. Pretty much everyone would agree on that - especially for a development team where knowledge of the system is essential.
In fact surely keeping staff happy - retaining the best talent - is a priority for all managers.

But when the pressure's on, IT managers will end up cascading the misery to their team for the simple reason that all managers are primarily judged on and therefore incentivised by meeting project deadlines.

Meeting deadlines means meeting budgets and delivering ROI. In other words, it means making money - and this is the only priority of any company anywhere regardless of what their website says about CSR, diversity or people development. Money is all they care about - make no mistake.

So what does this mean for you as a developer? It means that the only person you can rely on to look out for you is yourself. If you regularly bend over backwards to meet deadlines then that becomes the norm. If you join the Working Late Gang, you give them strength in numbers - it becomes the culture. The unrealistic expectations, the flawed process, the poor planning - all of it is hidden or condoned by you picking up the strain and making it happen.

Stop.

Thursday, 27 February 2014

Lazy developers?

Everyone wants to get an IT project finished on time. Why would they want anything else? There's no fun in being part of a "zombie project" that never dies - developers want to move on to new challenges, new cool things.
And yet there's often an unspoken assumption that the reason things weren't done on time is that developers are basically lazy.

Here's one of the main reasons why I think that.

Developers come up with an estimate for a piece of work which they believe is realistic. Depending on their experience and personality they might be overly optimistic or pessimistic. But at the end of the day they are the technical expert whose specific responsibility it is to estimate, design and build software. (Of course, it should always be the person who's responsible for building a thing that should provide the estimate for it).

And still, if the manager or business stakeholder who hears the estimate believes it's too high, they will usually squeeze it, despite the fact that they're neither responsible nor qualified to specify estimates. This squeezing can be overt, or surreptitious. Often it will take the form of putting pressure on the developer ("But are you really sure that piece will take 10 days? It's just config isn't it?"), or, even worse, it will be done without the developer even being consulted, by a coven of project managers, pressured into finding "creative solutions" to meeting the dates the business had in mind, convincing themselves that things can be parallelised, done more efficiently, or done by "just copying" something done previously. 
"Pete said a maximum of 4 people could work on this, but there's bound to be stuff we could get one of the Indian guys to work on. And this user story says 10 days - but it's pretty much what we did last time. If we said it was only 6 days we pretty much meet the deadline, as long as no issues come out of test."

The problem, in a nutshell, is that people don't believe that the developers have thought "creatively" enough about how to meet the deadline; on some level they're trying to give themselves an easy ride.
It doesn't seem to occur to them that they could simply go back to whoever demanded an earlier deadline and say "No I'm afraid we can't do that. I've worked it through with Pete, and we don't think it's achievable."

I got a bit of a thrill saying that. Let me try some more things that rarely get said by project managers:


  • "I'd need to consult with Pete, it's not my remit to say whether or not we can add more people to that."
  • "It'd be best if we didn't distract Pete right now to ask him for estimates on this. He's maxed out."
  • "The team as a whole has had 5 distractions this sprint already, and that's our stipulated maximum, sorry."
  • "No, Pete said 10 days. He might turn out to be wrong because it's just an estimate, but he's the most qualified person to provide that estimate and we have to go with that."
  • "No we can't commit to that date. We don't know if it's achievable or not. But we can commit to delivering the stuff you said was highest value first, and involving you all the way."
  • "We could try and achieve that, but the team's been flat out on this stuff for months, and are having a pretty tough time. We need to try and find a sustainable pace for everyone's sanity."

But those things pretty much never get said, especially the last one.

Wednesday, 21 November 2012

Designers onshore, coders offshore?

Like many companies, we operate the "offshore model" whereby the bulk of our development team is comprised of developers contracted to us from abroad where relative currency strength works in our favour. India is the most common choice. This model makes a lot of sense for two reasons:

1. As work waxes and wanes, or if times get hard and the team needs to be downsized, the number of people offshore can be increased or reduced easily, and without recruiting or losing permanent members of staff.

2. It's cheap.

However, for me, this model poses two fundamental problems as well; one directly, and one indirectly.

1. Working with developers who aren't in the same office as you is hard. Working with people who aren't in the same time zone as you is even harder. And collaborating with people whose first language isn't English (often on a poor phone line) makes it harder still.
I believe that the impact on productivity [1] caused by these things risks outweighing the financial benefit.

2. Usually there's not much of a recruitment process involved; rarely even a coding test or technical interview. Managers ask the offshore company for another 5 "resources", and on Monday morning there they are on the end of the crackly phone line. However, the offshore team you accrue often have less than a year or two's development experience.
Now don't misunderstand me, I have no issue with junior developers (I was one after all), but I believe that junior developers need support and development - precisely the sort that is usually denied to offshore contractors: training, educational sessions, mentoring and so on. They are often denied access to the business and therefore an understanding of the problem domain and context they're working within.
Considering all of the above, it should come as no surprise that the quality of their output isn't always up to scratch.

However it does come as a surprise to managers when code quality decreases, and team efficiency and morale slowly decays. They never say: "perhaps it's the fact that a large number of the team [perhaps even the majority] are geographically disconnected and not very experienced".

Why not?

The answer lies in one of the great myths of software development: Your team should consist of Designers and Coders.

This is how the myth goes:

The Designers are the permanent, onshore, team. They have the knowledge of the business, and are usually more experienced and (hopefully) have time and money invested in their development. They're the "intellectual capital". They may even be flattered into thinking that they should move away from the daily grind of actually cutting code as that's beneath them. After all, they do Design with a capital D.

The Coders on the other hand are ten a penny, and can be less skilled - after all, all they do is write the code, and implement the design which the Designer came up with. Practically anyone could do that.

Right?

Well my opinion is: Wrong. Absolutely wrong. And here's why: Coding is design. [2]

Almost every line of code I write involves a design decision: Do I use an instance variable or a local variable? Do I make this component request-scoped or globally-scoped? Do I hold this data in a Map or a List?
All these decisions add up to create code which is more or less extensible, performant, resilient, secure, maintainable and so on - and almost all of these decisions are too detailed to be made by the Designer. (Having said that, every now and then you do meet a Designer - who may also call himself an Architect - who creates designs to this level of detail. In my experience these designs are almost as large as the code itself, unwieldy*, and probably full of oversights and mistakes which only become apparent when you actually cut the code).

(* As Martin Fowler [3] points out: For diagrams, comprehensiveness is the enemy of comprehensibility.)

So what does this mean?

It means you should get your experienced developers to write code. They should be both Designer and Coder - with no distinction drawn between the roles.

Let me give you a scenario I've experienced, and seen, many many times.
Working as the Designer, I produce a documented design and go through it with the Coders. The Coders are fairly junior, so this process takes a while.
A few days later I ask to see the code, or I get a code review request. When I look at it, I see that their interpretation of the design isn't exactly how I imagined it.
For some things I can clearly explain to them why the way they've done it is problematic, and I ask them to change it.
But some things are less easy to justify. I know it's not how I would have done it, but it's getting late in the project to refactor things. It seems to work okay - so I say "you know what, just leave it as it is - it's probably fine."

When a production issue occurs three weeks later I realise why it should have been done the way I instinctively thought it should be done.

Sometimes it's not a production issue, but we suddenly need to extend the functionality in a new way which the implementation makes more difficult - but funnily enough if it had been implemented the way I would have done it - had I been the Coder and not just the Designer - it would have been easy to extend in this new way.

A variation on the above is that the experienced developer (the Designer) is so thinly spread that she actually finds she doesn't have time to review all the code the junior developers (the Coders) have produced. This makes issues with the low level design even more likely - and when the production issue occurs, the Designer looks at the code and exclaims "WTF!?" (which means What Terrible Foolishness!)

So on the off-chance you're a manager with the authority to control how your development team is managed and resourced, try giving quality a fighting chance. Abandon the offshore model and give your permanent team everything they need to do their jobs well.
You'll be amazed at the difference it makes.



References:

[1] Zenun et al: The Effects of Teams' Co-location on Project Performance http://extras.springer.com/2007/978-1-84628-975-0/col/dpi.inpe.br/ce@80/2007/01.22.18.46/doc/paper.pdf

[2] The reader who can tell me who first said this wins a Cadbury's Fudge, because I can't find this reference anywhere. It was probably Kent Beck, Ken Auer or Roy Miller.

[3] Fowler, Martin: Is Design Dead?, http://martinfowler.com/articles/designDead.html














Tuesday, 24 July 2012

The Meeting

The automated voice of the teleconference lady announces: "Now joining... Name not recorded".
The meeting has started late, and the latecomers are still arriving. This is mainly because everyone has so many meetings to attend, they're still trying to make it from the last late-running meeting to this one. The host starts a pre-amble.
"Okay everyone, first of all sorry we've started a bit late! Can I just - "
The automaton interrupts him: "Now joining... Name not recorded".
"...can I just check - "
"Now joining... Name not recorded".
"...who's on the call?"
There is silence.
"Do we have Jack?"

"Kathy?"

"What about Brad?"

While we wait, I look around the room and take in the cast of characters on our end of the phone.

First there's the Meeting Nomad who, although a project manager by job title, in reality drifts from meeting to meeting and sets up camp behind his laptop where he does other work, without listening to or participating in the meeting he is currently inhabiting. Consequently he learns nothing and adds no value to the proceedings.

Next is Loudmouth whose role is to assert his superiority in all situations, never allowing his complete lack of understanding to become an obstacle to this. He will have to be managed if there is to be a useful outcome, but sadly the ineffective host has none of the required skills to do this.

Next round the table, and sat next to me, is the Junior Developer who has the deepest understanding out of all of us of the issues about to be discussed, but whose lowly rank relative to Loudmouth will necessitate his silence.

To the other side of me are Network Guy 1 and Network Guy 2, invited because most of what we'll be discussing will involve computers, and computers connect to networks. They also will say nothing throughout.

Finally there is the aforementioned Inept Meeting Host who, having ascertained who is on the call, is now having problems with his laptop and is swearing under his breath as he tries to bring up the document we were going to discuss. This regular occurrence surprises only him.

That leaves me. My mission, should I choose to accept it, is to attempt to come away with specific actions and decisions which will be of use to the Junior Developer who has 2 weeks to complete the work.

The Inept Meeting Host has now managed to bring up the document, but has failed to circulate it. He decides to email it round, but unfortunately his laptop claims never to have heard of our WiFi network. There ensues a lengthy period during which time Loudmouth and one of the Network Guys huddle round his laptop and join in with a Random American on the phone in offering suggestions.
(The Random American, incidentally, is only random because I have never heard of him, but from his authoritative tone I assume he is some kind of manager in the vast and bewildering hierarchy of managers there seems to be).
I lean across to the Meeting Nomad.
"Do you know if anyone from Test is coming?" I ask.
He looks up from his laptop and blinks as his eyes adjust to the real world. "Test?" he asks, as if he hasn't heard of this team before. I consider the possibility that perhaps he hasn't.
"You know, Adrian's team. We need someone to test this stuff don't we!"
He frowns slightly. "Do we? No-one mentioned that to me."
I sit back.

Eventually they manage to connect to the Internet, but for some reason Outlook cannot connect.

The Inept Host is now, at someone's suggestion, setting up a Webex in order to share his screen and is in the process of requesting a password reset email since he has forgotten his password, and Network Guy 1 had told him to clear his cookies. No-one has remembered that he is unable to access his email so will be unable to receive the new password.

20 minutes into the hour-long meeting the laptop remembers that it in fact does know the WiFi network, the document is circulated, and we begin.

There is no agenda, but minutes for this meeting (were anyone taking minutes) could read something like this:
- Tedious walk-through of a document which everyone was supposed to have already read.
- Heated discussion around a minor point which Loudmouth knows a lot about. Action: Junior Developer has to ensure code correlates with an obscure standard, presumably in case we decide that this [2 week ill-conceived, poorly-thought-through hack inspired by short-term thinkers in the business with a dismal record in shrewd decisions] is such a good piece of software we may one day decide to put our logo on it and take it to market as an off-the-shelf product.
- Back Office Guy [who arrived, grinning, 46 minutes in] raised the fact that the proposed global solution won't work in the back office in the APAC region [despite his team being invited to all previous meetings, and invited to collaborate on and review all the documents]. Action: Meeting Nomad to "assess the impact" of this [even though we already understand the impact. But this gives him something to do in his next meeting.]
- All agreed that we should organise another meeting for next week to "review the actions from this meeting", and "see where we are" [which will be the same place we are now, but a week closer to the deadline].

As I leave the meeting I speculate on how I might transition to the role of Inept Meeting Host, or Loudmouth and save myself the stress of trying to do a good job. Perhaps there's a work shadowing programme?

Oh wait, I'm late for my next meeting.