allan kelly

Unit testing (from objectives)

Still responding to the questions posted in response to my TDD and objectives entry. The question was about how to do TDD, specifically UI and also about what happens when the general consistency fails.

Well the UI question is easy: You can’t really do TDD for user interfaces.  You can, but you have to jump through hoops to get your test framework to push buttons.  Of course there are tools which will do this for you but these usually fall into the realm of ATDD (Acceptance TDD) and system testing.

But, what TDD can help you with is the logic behind the UI.  We all know we should separate program and business logic from the UI but we also all know it has a habit of getting in there.  Well if you are practising TDD you separate the two (as you know you should) and you can TDD the logic and leave the UI as a lot more trivial. (And testable with other tools.)

The other way of doing it is to test the output.  Increasingly application emit XML or HTML to generate their user interfaces and you can test that.  You can test small segments of XML to see if it contains the expected data.

For me the secret of TDD is that it is a Design technique, thats what the second D stands for after all.  It is about designing your code with tests rather than UML, or flow charts or what ever.  You do it before you write the code, it forces you to think about what you are about to write and that is design.

Second part of the question: general consistency.  Well, true, a little change might break a lot of tests, but actually you want that to happen.  If someone removed operator== then you want your tests to break because it highlights the change. 

A good set of tests round your code ensures that any unexpected changes are found quickly.

Of course, when you make a significant change in your code you might find a lot of tests broken, and you end up having to fix lots of tests but:

  • Firstly a major change should product major breakage so you can get it right
  • Second a well structured, properly separated design, will be less prone to breaking.  Writing tests is itself an engineering exercise.

All in all TDD promotes a lot of good practises which we know are good but somehow forget to do.

 

Unit testing (from objectives) Read More »

Objectives again

I don’t normally respond to comments on my blog.  Most of them don’t actually require anything more to be said but on this occasion I thought I should respond.  And keeping to my one entry one comment policy I’ll take them both separately.

So, the question was: Am I changing my view on objectives?

And my answer is: It depends; in this case I’ll wait and see what happens.

I think it is worth knowing what you are aiming for.  I think setting your own objectives is worth while and can help improve your performance.  And I think they are a good way of communicating priorities to and from management.

I also think that if you are going to have explicit objectives it helps if they can be more objective than subjective.  So, the SMART rules make sense.  But… well, there are problems….

Not everything you want to aim for can be specific or measured.  Quite often we operate with ambiguity.  A lot of my work is ill defined, trying to make it better defined can be useful but it can also be counter productive because things will change.  I’m not really sure what my goal is or should be, I just kind of know the general direction.

There is also a problem with the achievable and realistic part of the rule; in a word setting realistic goals encouraged people to satisfice.  If your promotion, pay rise or bonus depends on meeting an objective then there will always be a tendency to aim slightly lower, for something that is more achievable.

As much as they can improve communication between management and workers they can also be the source of misunderstanding; when they are imposed on people, when management sets the objective and forgets about them for a year, or when management sets them and then abdicates all responsibility for helping someone meet them.

So I stick by my answer: it depends.  I’m in favour of objectives when they are used appropriately.

Objectives again Read More »

TDD, Objective setting and doing the obvious

I’ve been doing a round of objective setting for my client recently. When it was first announced the company wanted to go down this path I groaned. “Arhh” I thought, “I hate objectives, I hate people setting them, I hate all the baggage that comes along with them.” Neither was I impressed by the way my client’s HR department presented the idea or the proposal for implementation.

I’m a past master at criticising management by objective, it is quite easy really, just look at the side effects and read Goodhart’s Law. Anyway, its not turning out like that at all, little bit of imaginative thinking and things are looking good. Sure we are only in the objective setting phase so far so it is too early to say, much could happen but….

First I have rigorously applied the SMART approach – objectives need to be Specific, Measurable, Achievable, Realistic and Time boxed. Second I added an extra criteria “V” – call it the SMART+V formula. “V” stands for Value-add. (Only I now realise it should be V+SMART, if you can’t show value don’t continue.)

Next was the realisation that the development team all did pretty much the same job. Therefore one could expect them to have pretty similar objectives. And if they all had similar objectives it would aid team work.

Finally, I think I realised how to use this to my advantage. The team have not been doing code reviews or Test Driven Development (automated unit testing if you prefer) but everyone is willing to do both. So, its now turning out that most of the team have objectives around these area. Not everyone, and individual goals might have a slightly different take but they all build.

Half way through and this approach seems obvious. If a manager wants his team to do TDD then why not just set it as an objective? Surely this is the way it is meant to work: manager decides, manager aligns team, team does what manager wants.

If it is this obvious why bother with all the TDD evangelising, training, coaching and calls to do it. Why both with fancy change ideas. Just set it as a target and do it. Could it be so easy?

Of course it isn’t going to be that easy. For a start just because it is set as an objective doesn’t mean it is going to be met. Just because people want to do something doesn’t give them the knowledge to do it; at the start people don’t know how to do it. Then there are the usual problems like time pressures and people who will think “it won’t work here.”

Having set it as an objective I’m still going to have to work hard at giving people as much support, training, coaching and other assistance as I can.

One real danger to this approach is that the managers who set these kind of objectives might just believe that setting an objective is all that is required. As I just said: setting it as an objective doesn’t mean it will happen. Objectives are a two way street and managers need to help people meet theirs. Thats why I’m thinking of setting my own objective as: “Team reaches 80% of objectives.”

If this approach is so obvious why haven’t I done it before? Well apart from the problems I just outlined this particular tool has not been available to me in the past. Sometimes management wasn’t bought in to TDD, sometimes objectives weren’t in use and sometimes I wasn’t in a position to set the objectives.

At the moment it feels good and I think its going to work. I’ll report back…

TDD, Objective setting and doing the obvious Read More »

Introducing: Software Inside

I’m going through some notes from the ACCU conference in April and note I made after a conversation with someone – I forget who so sorry for not crediting you properly but I want to capture these thought….

We write software but we seldom write software for the sake of it. We write software as part of something else. Perhaps we write embedded software for a mobile phone, or we write an enterprise application for an account department – you get the idea.

The thing the software goes into – devices, process, etc. – is itself a system. A mobile phone is an electronics system, which is part of the cellular communications system; an accounts ledger is part of a business systems which tracks accounts.

Increasingly it is software that makes all of these systems possible. You could do a lot of this in hardware, albeit specialist hardware but doing it in software is easier and cheaper. Despite all the problems with writing a software application to manage a cell phone it is still a lot simpler, cheaper and faster than creating dedicated hardware.

Software allows you to use commodity hardware, commodity manufacturing and commodity infrastructure to create your product. The truly unique bit rests in the software. While you can copy the binary code or application for virtually nothing the creation of that software is unique. Knowledge is embedded within the software.

Ultimately all software systems are simply part of a bigger system. Systems have software inside.

This idea isn’t new. I’ve said it myself before, what is new is the term: Software Inside. I guess we can credit Intel with providing the inspiration for the term – thanks Intel!

This term allows us to focus not so much on the software but on the greater system: the phone, the accounts system, the car, the washing machine, the moon-landing, etc. The fact that we know about software can take us (the software developers) into many different and strange domains.

And once in them we ourselves, the software experts, need to adapt and learn these new domains. We need to be soft ourselves. Software developers need to be cameleons.

Introducing: Software Inside Read More »

Post-Agile

I’ve written before about the Agile backlash I see coming. But what I’ve been wondering is: what comes next?

One idea comes from James Noble and others who have suggested Post-Modern Programming. I like the idea, it helps us understand the world better and it helps reposition our view of software development but it doesn’t tell us to do anything differently. Post-Modern programming is more a philosophical understanding than a prescription.

Myself I’m a big proponent of Learning Based Software Development. While this changes the emphasis on in software development I’ve yet to develop the ideas into a proposal for anything more than … well ideas.

Actually Learning Based Software Development (yes I just invented the term so lets invent the abbreviation LBSD) can be seen as a software specific version of Knowledge Based Product Development. (Sorry, one of the entries with messed up formatting.)

This week I stumbled across a blog by Jason Gorman in which he discusses Post-Agile. This is the first time I’ve heard the term and it seems I’m a little late to the party. (Also a sign that I need to get to XTC a bit more regularly.)

It appears from what Jason says that opinion is divided on what “Post Agile” means yet but one possible explanation is: Being informed by the Agile/Lean movement but not following any prescribed methodology. If that is what it means than good, it could be what I’m looking for.

But boy, Post-Agile is such a pretentious title.

Post-Agile Read More »

Chance favours the prepared mind

First an apology: I’ve been very busy the last few weeks so I’ve not been blogging so much. Naturally the creation and launch of Software Strategy has kept me busy and so has the company’s first client where I am far busier than I have been for a long time. Add to this friends and family visiting from abroad and a few things have had to give….

Despite this I wanted to capture a quote I read this week which I think is very wise.

Last weeks Economist carried a profile of Gerald Grinstein, no I hadn’t heard of him before either. Turns out he is the boss of Delta Airlines and what he said was this:

“Chance favours the prepared mind”

Which when you think about it is so true. If you spend time thinking about where you are, what needs doing, what options are available and how things might unfold then when chance occurs you know whether to grasp it or not.

This is what worries me about being so very busy. When I’m busy busy, and when see companies who are busy “doing stuff” I find so often that opportunities are missed and much of the stuff that gets done isn’t necessarily the right stuff.

For example: I often advise people to keep a work diary (or journal as some would call it.) Writing a journal is not really about recording what happened but thinking about what the implications are and what might happen next. As such it is an act of reflection. I find that when I get busy my journal (and blogging!) get squeezed, but when this happens I loose direction and although I’m busy I am less effective.

So this is a reminder that in the middle of this very busy period I still need to find time to think and prepare my mind.

Chance favours the prepared mind Read More »

More Agile failure modes

A couple of weeks ago I raised the topic of How Agile Teams fail. Well in recent conversations and observations I’ve been reminded of two more modes of Agile failure. (Maybe reminded is the wrong word, maybe I could say I’ve spotted patterns, having one or two cases logged in my mind some more examples have focused my thoughts.)

One mode is where the developers simply state they are doing Agile. We can call this Fake-Agile. By simply stating they are Agile the team can then ignore documentation, avoid project management, and generally hack.

Frankly this isn’t Agile and it gives Agile a bad name. I’m sure some examples of this are genuine attempts to become Agile but without real understanding or experience it is difficult.

The lesson here is: Simply stating you are Agile does not make you Agile.

I’ve also been reminded of this by recent TDD experiences. A team I am working with has decided they want to start doing Test First Development. However nobody has done it before and three weeks after voting to do this there is little sign of it being done. This isn’t necessarily the team’s fault, although they want to do it they don’t really know how.

Think about it. When I decided I wanted to drive a car I hard to learn to do it. The same with skiing, wine tasting, and lots of academic subjects. Sure I can pick some of it up by just doing it, and if I’m really clever, lucky or something else I might just succeed – like the way I first learned to programme.

But generally, wanting to do something isn’t enough to actually do it. You need help and advice.

y solution is to arrange some training and coaching for the team to help them start doing TDD. Once we have that in place I expect things will change.

The second Agile failure mode is a bit more complicated. I’ve seen it a couple of times now and I suspect its behind many Agile failure. It happens like this…

A team are trying to adopt Agile, but they are also working with new technology. The new technology could be technology new to the team, it could be technology new on the market (perhaps a beta release from a vendor) or it could be newly introduced technology. Whatever, the team need to learn the technology.

So we have New Process and New Technology.

The first sign is exploding cards. Teams write cards to represent the work they are doing to do at the start of the iteration but when the iteration gets underway it turns out the cards were vast understatements, both in terms of the time required and the work required.

(By the way, you need a card and board system to spot exploding cards, a software tool will simply hide the problem.)

In some cases progress is slow and few, if any cards are complete. Perhaps people say things like “the card is 80% complete.” In Agile iterations 80% counts as zero. It is either done or it is not done.

In other cases, where teams recognise the extra work involved they may write more cards – hence the expression exploding cards. Here developers start work on a card and realise/find there is far more work than they anticipated. They break this down into several smaller tasks and the number of cards multiply. In one case I saw developers took to folding the cards in half to fit them on the white board.

There are techniques for dealing with this situation. Writing cards to represent the extra work is one, and you may need to add more frequent re-prioritisation.

Another technique is time-boxing: where developers have to guillotine their activities at some point and just go with the best they know so far.

And another is investigation: where an investigation task (probably time-boxed) is conducted before the actual work itself. This can help split tasks down.

But, all these extra techniques for dealing with this situation are relatively advanced. An advanced Agile team may simply take these problems in their stride. For a team new to Agile this situation can be off putting, some people may take it as evidence that Agile does not work and it may even lead to project collapse.

Such projects were probably going to end up in a mess whether they are run Agile or not. Because of the new technology the project is uncharted waters and the amount of learning and investigation needed is very high. Therefore, even with traditional project management techniques the project will probably hit problems.

Here the advantage of Agile is that you know the problems are happening much earlier and not just at the end. But, if they team is new to Agile then you may loose the project and the Agile practices too.

The solution here… Not sure I know one. Some projects will always slip and even fail no matter how well you try to manage them.

If there is a solution it lies in seeking help, involving people who have done these things before – either Agile or the technology. Training and coaching can help too, whether in the new technology or new process.

What is the lesson from all of this? Well if there is one it is simply that Agile Software Development may look easy but it isn’t. Getting to be Agile is not simply a case of reading one book, it is a case of reading many books, talking to many people, working with experienced practitioners, having training, coaching and trying again when things don’t work out.

It isn’t easy being Agile.

More Agile failure modes Read More »

Another discovery at ACCU conference "Bicycle repair workshop"

Something else I discovered at the ACCU conference: Bicycle Repair Workshop.  Should I name to originator?  Or should I let her live in quite anonymity?  Perhaps I should actually seek permission to talk about this here, but then was it not Picasso who said “great artists steal.”  (No I did ask permission.)

First the name: its a straight take from Monty Python.

What it is, is a forum where software developers at the company can gather and talk about the problems they are currently encountering.  The originator envisaged a forum for people to talk about process issues, and specifically Agile practices but its free form enough to let people take in what they want.

The workshop takes up an hour or so on a regular basis, I can’t recall it it is weekly, bi-weekly.  There is a bit of fun (cakes supplied) and people turn up only if they have something to contribute – so a self selecting group.

Like the book groups and Tech-Talks that I’ve created in the past the forum gives people the opportunity to talk about the issues they face.  By exposing, explaining and naming the problem/issue/challenge/opportunity it becomes more manageable.  By explaining it people are forced to make some sense of it to themselves and then to other people.  And when other people see it they can help.

In one of his books Gerry Weinberg (Secrets of Consulting I think) compared problems in companies to moss.  In the dark, moss grows and becomes bigger.  Exposed to light moss dies.  Problems are the same, when you hide them they become worse, expose them and it becomes easier to deal with.

I see this happening when people gather in a pub or coffee bar, or stand around the water cooler and moan about things in their work place.  They know what is wrong but they feel helpless to act.  So bar and water cooler conversations don’t result in much action.  Often these problems don’t get talked about in official forums either:

  • because these problems shouldn’t exist, e.g. the according to the official process manual these things shouldn’t happen
  • because office politics gets in the way, e.g. everyone knows that X needs to change but nobody feels they can say it
  • because somethings we can’t talk about, e.g. Fred under performs and needs to be let go
  • because solving the problem needs resources and we all know the company won’t spend money
  • because we are embarrassed to admit to our own problems

The advantage of the semi-official forum, like Bicycle Repair Workshops and book groups is that people are freed of these constrains and can talk more freely.  For managers this posses a problem: too much support and involvement with the forum will make it official and kill it, too little support and it will turn into another moaning shop and nothing will happen.

By creating a forum people are allowed to talk about a problem and expose it to the light.  The advantage of the Bicycle Repair Workshop is that it is directly asking for and discussing these issues.  I occasionally facilitated a Tech Talk into such a forum, and the books we studied in book group lead to discussions about problems bit I never tackled the issues head on, on a regular basis.

Of course it mights be possible to have too many forums.  All of these activities take time and commitment.  A company running bicycle repair workshops, book groups, Tech Talks and what ever else may over tax people.

These three types of forum share another thing in common.  They can be created through bottom-up action.  You don’t need to be a manager to create them, you can just do it.

On the other hand, if you are a manager then then can create other types of forums. I’m working with a company now to help them revise their development process and become more Agile.  One of these things I’m doing it running twice monthly improvement meetings, kind of reverse-retrospectives.  These are more official so have a different flavour.

In all these cases the real problem is turning information and learning into action.

Another discovery at ACCU conference "Bicycle repair workshop" Read More »

Failures in Agile process?

One of the questions that was posed at ACCU conference was “What are the downsides of Agile development?” – and “What does Agile failure look like?”

I have tried to answer the first question before but failed myself.  One downside is that the Product Owner role – typically filled by a Business Analyst, Product Manager, Customer or other proxy-customer – is given an immense work load.  This is a subject James Noble has done some work on.

What happens is that Product Owners have to keep doing their original job and service the needs of an Agile team.  As the Agile team becomes more productive they ask more and more of the owner.  Consequently the owner gets maxed out and themselves becomes unproductive.

However when I thought about this I don’t think the failure is a failure of Agile, I think it is a failure of the business.  Put it this way: for years “the business” has been complaining that software teams do not deliver what they want.  Now along comes Agile and says “we will deliver exactly what you want” but “you need to tell us exactly what you want.” 

It is no longer enough to set half a dozen developers working on a problem and expect them to come up with the right thing.  If customers want what they ask for then they need to tell the developers exactly what they want in detail.

The second question, “What does Agile failure look like?” is hard to answer because we don’t have many case studies of failed projects.  This isn’t just true of Agile projects, it is true of many IT projects.  Companies don’t like to talk about failure. 

Still I can see several failure modes for Agile:

  • Teams fall back to the old way of doing things: I’ve only heard about this not seen it myself.  Typically it occurs when you bring in a lot of consultants to make your team and process Agile.  Things work when the consultants are there but when they leave teams fall back to the old way of doing things.  Unit test break and aren’t fixed, planning meeting are missed, quality slips and deadlines are missed.  The presence of consultants gives the team a backbone but knowledge is not really transfered to the existing team.
  • Failure to get management buy in: Agile is often introduced at the bottom of the hierarchy, by developers at the code face.  Eventually there comes a point when managers need to support it or stop it.  This doesn’t happen and the development process is left in a random state.
  • Failure to get developer buy in: this occurs when management buy into Agile but developers don’t.  They don’t want to write tests, do code reviews or pair, believe in technology over visual planning, etc.  Again the process is left in a random state.  I expect to hear more about these types of failure in future.

The common theme here is not that Agile fails, after all IT projects and processes fail all the time so there is nothing new or special here.  Failure of an Agile project looks a lot like the failure of a Waterfall or RUP project.

Rather Agile fails when you fail to see the benefits of the new approach.  So when you do a little bit but not enough to improve quality, improve delivery dates, and make things predictable.

Both questions are good questions and deserve more attention.

Failures in Agile process? Read More »

Waste from the ACCU conference (Testing)

As I mentioned last time, I came back from the ACCU conference with a bunch of notes and a lot of thoughts.  Recording them in this blog seems like a good way of remembering and sharing these thoughts.

Last time I referred to the Great TDD debate.  At the conference Mary Poppendieck reminded us of the key principle behind TDD and other forms of unit (especially automated) testing when she quoted from one of the original Toyota sources:

  • Testing to find defects is waste: the defects should not be there in the first place so any attempt to find them is waste.
  • Testing to prevent defects is essential: defects slip in, we should catch them as soon as possible so create systems with tests that prevent defects.

Hopefully it should be obvious were TDD fits it: TDD is there to prevent defects and reduce waste.  However, testing later in the cycle, e.g. system test, is waste and although it may be necessary right now we want to get away from faults, testing and waste.

On the face of it this is bad news for software testers.  If we start testing to prevent waste rather than find waste then they are out of a job.  Well I have three reassuring thoughts for software testers, they will not be unemployed anytime soon because:

  • Few organizations can actually implement this principle, some will always need testers.
  • We have a lot of code out there where nobody prevented the defeats and therefore needs testing.
  • Testing itself is an activity that can add value to products –  as Oracle considered last year.

Also, most of the software test managers I have ever worked with have been keen to point out that they would rather conduct Quality Assurance than Test.  Too often these activities are lumped together but when you think about it they are very different.

So, in the short term testers have plenty of work, in the long term their future is in quality assurance – a more value add activity.

Now at this point a lot of people tell me I’m an idealist.  After all, everyone knows software is buggy, has always been buggy, and always will be buggy.  I remember being taught at University how every piece of software contained an infinite number of bugs.

I asked Mary Poppendieck about this, her answer was basically: you get what you expect, if you expect to get bugs then you will.

Well, maybe I am an idealist.  But what is wrong with wanting software without bugs?  What is wrong with setting my sights higher?

Waste from the ACCU conference (Testing) Read More »