Which End of the Horse?

This content is syndicated from xProgramming.com by Ron Jeffries. To view the original post in full, click here.

“Why don’t you believe in testing?” said Lanette Creamer, the Testy Redhead. Ah, but I do. I care about what, when, and at which end of the horse.

It’s really hard to get one’s ideas into 140 characters, but these twitter conversations can help to crystallize things. Here’s what I’ve got right now …

Some programmers don’t appreciate some testers, sometimes, and I suppose that some don’t appreciate testers ever. There are some good reasons for that, and good things to do about it.

Don’t Nobody Bring Me No Bad News

This wonderful line from The Wiz pretty much summarizes how most programmers feel about bug reports. They busted their brain trying to make something work, tested it in that way that they have, and after a while some tester comes back with bug reports on their work. And the tester probably couldn’t have programmed the thing at all. Frankly, it’s bloody irritating.

Ron Jeffries: Some people take everything personally.
Ann Anderson: I do not!

Sometimes we get confused between our craft and ourselves, especially if we have worked hard to be as good as we are, and yet have some inner fear that we are not good enough. And in programming, we always have that fear. As hard as we try, we seem often to write bugs, and every time we succeed, they bring us something harder to do.

The result is that a bug report hits us where we live. It’s always evidence of something we should have thought about, noticed, tested for. It’s always evidence that we aren’t all that good at what we do. Here are two things I do about that:

1. Accept That I Fail

As long as I let myself live in the fantasy world where I am the all-conquering software hero with lightning crackling from my fingertips[1], it’s going to be hard to deal with the real world whacking me upside the head with bug reports.

For myself, I try to notice every mistake I make, and I look at it ruefully but not in sorrow. It’s evidence that I’m human, but by noticing each and every one, it is also evidence that I am paying attention, open-minded, and a very snappy dresser. The better I face my own reality, the better I’m going to be able to make the real world like my fantasy one.

2. Try to Put the Tester Out of Business[0]

OK, even snappy dressing realist that I am, I still don’t like those perpetual gleeful interruptions from my testers saying “Look! I found another flaw in your world view! Nanner, nanner!”

OK, I know they don’t actually say that. That’s what I hear, however. So since I don’t like this bad news, I do things to reduce the opportunity for them to come tell me about problems. The only way I know to do that is to send them fewer problems: they’re way too good at finding them.

I think of this as trying to put the tester out of business. I try to write code that works so well that they tear their lovely red locks out of their head, crying out in frustration: “Won’t this guy ever write a bug? What shall I ever do???”

I hasten to say that I’ve never managed this. But we try. By trying never to ship a bug, I have managed to reduce my bug count profoundly, with the result that the things the red-headed demon finds are at least more interesting, and often enlighten me rather than just make me feel stupid.

I work on this in a few ways. Technical: Test-Driven Development and Automated Acceptance Tests Checks[2]. Process: Root Cause Analysis. We won’t go into those deeply here, as we’re looking at a larger picture. However,

Test-Driven Development requires me to write all the code, and only the code, that is needed to pass tests, which I write first. This discipline helps me focus on what the code must do before I focus on how it would do it, and it results in code which is simple and quite testable. TDD is not a rote, stupid practice. It is, instead, an almost meditative way of keeping my mind focused on what’s going on. It reduces my defects a lot, and my tension even more.

Automated Acceptance Checks amount to automated examples, checking whether the program does what the customer has asked me to do. I ask the customer for examples, code them up in some acceptance checking tool, verify that they are what is wanted. Then, since I am no fool, despite reports to the contrary, I run these checks as I develop. Since they are automated, this isn’t much of a burden, and when they run correctly, I am confident that my program does everything the customer and I agreed to.

These two practices profoundly reduce the bugs that I ship downstream. The result is that when my tester does find something, it’s much more likely to be something that no one thought of.  But here’s the clincher:

Root Cause Analysis means that whenever the Ginger Marauder does show up with a bug, we all talk about what permitted that issue to slip through our net of question asking, example making, automation of checks, and micro-tests.  We actually learn something, and usually it’s not all about me, but about how we ask about features, and how we create examples.

This brings us to the horse. I knew there had to be a pony in here somewhere.

Come to the Front of the Horse, Tester!

Lanette told of a time when, after she told a programmer how she planned to test something, the programmer changed his design. Damn betcha! If I knew how my code was going to be tested, I’d make sure that it would pass. Therefore …

When the customer gives us a feature, let’s involve our testers right away. Let’s have them help make up the examples they’re going to use to check the program, and we’ll use them to build the code. Let’s automate them, and save us both some time in checking things. If they’re up to it, they can help automate the tests. And as we work through the examples, we’ll have someone to ask when we find an example confusing. We can keep ourselves all in alignment about what we’re doing, even if as we go, our understanding changes a bit.

I Love a Parade …

I like to think of this in parade terms. When you’re working a parade, it is better to march in front of the horses, rather than behind them, sweeping up. Worse yet, what if they are elephants?[3]

When testers work behind the horse (save the elephant remarks, thanks), mostly they find defects that could have been prevented earlier. This takes up much of their time, and annoys the pig[4]. It slows down the project and means that neither testers, nor anyone else, has time to look at the really important and interesting things that a good tester can find.

So now we see why I say “Try to Put the tester out of business.” It would be better to say “Try to put the checker out of business,” and by golly I’m going to say that from now on.  I’ll start right now.

Try to Put the Tester Checker Out of Business

When teams move their testers to the front of the horse, allowing them to help create the examples that will be used to check whether the feature basically works, good things happen:

  1. We get a better understanding, and a common understanding, of what needs to be done.
  2. Programmers use the examples to ensure their code works, especially if the examples are automated.
  3. Naturally, our testers still move behind the horse. When they do, though, they aren’t doing as much checking. They aren’t just sweeping up crap. Because of the up-front checks, they can keep their eye on the bigger picture. They can use stronger and deeper testing skills to find things that are both more interesting, and more valuable, to the team.

Bottom Line

For me, there are benefits to all three of the steps here.

TDD helps me write code that is better in every way, while reducing my stress. It also reminds me that I’m fallible, which I might otherwise forget.

Examples help me understand what my customer wants, and automated examples help me make sure I’ve done it, without a lot of extra work.

Moving testers in front of the horse makes my work go better, and reduces the amount of rote checking they must do. This makes them and their work more valuable.

Move testers to the front of the horse, to create more understanding and better examples. Automate to make it easier for everyone to check the examples. Code with TDD. Leave time for true testing, not just checking. Better software, sooner, with less pain.

What’s not to like? Do it.


[0] I’ve added “Try to”, to emphasize that as much as we try never to ship a simple defect, we’ll always have some. We can, however, reduce dumb mistakes by one or even two orders of magnitude.
[1] Thanks to Kent Beck for this delightful phrase.
[2] My good nemesis Michael Bolton makes the distinction between “checks”, which are pretty mindless automated, well, checks, and “sapient testing”, which is testing done by an actual human with eyes and mind wide open.
[3] Stop me if you’ve heard this. Guy works in the circus, shoveling up elephant do after the elephants do their business.
Friend asks him: “Why don’t you quit that awful job?”
Guy replies: “What, and leave show business??”
[4] Apologies for sudden shift of animal metaphor. Something about teaching a pig to sing. Never mind. As you were.

Leave a Reply

What is 3 + 4 ?
Please leave these two fields as-is:
Please do this simple sum so I know you are human:)

There are 101 ways to approach anything.
To find the best way, sometimes you need expert help

What People Say

“Kelly revolutionised the way our digital department operated. A true advocate of agile principles, he quickly improved internal communication within our teams and our internal clients by aligning our business and creating a much enhanced sense of transparency in the decisions the business was making. Kelly also introduced a higher sense of empowerment to the development teams...”

PETER SILVA-JANKOWSKI
IPC MEDIA

“Kelly’s a leading program director with the ability to take charge from day one and keep strong momentum at both a program and project level driving prioritisation, resourcing and budgeting agendas. Kelly operates with an easy-going style and possesses a strong facilitation skill set. From my 5 months experience working with Kelly, I would recommend Kelly to program manage large scale, complex, cross company change programs both from a business and IT perspective.”

LUKE SHARKEY /STRATEGY & IMPLEMENTATION LEADER
SUNCORP

“Kelly is an extremely talented and visionary leader. As such he manages to inspire all around him to achieve their best. He is passionate about agile and has a wealth of experience to bring to bear in this area. If you're 'lucky' he might even tell you all about his agile blog. Above all this, Kelly is great fun to work with. He is always relaxed and never gets stressed - and trust me, he had plenty of opportunity here! If you get the chance to work with Kelly, don't pass it up.”

GILES BENTLEY, DEVELOPMENT & OPERATIONS DIRECTOR
TIME INC

“Kelly is an Agile heavy-weight. He came in to assess my multi-million $ Agile development program which wasn’t delivering the right throughput. He interviewed most of the team and made some key recommendations that, when implemented, showed immediate results. I couldn’t ask for more than that except he’s a really nice guy as well.”

DAN PULHAM, DIGITAL DIRECTOR
TELSTRA

“Kelly and I worked together on a very large project trying to secure a new Insurer client. Kelly had fantastic commercial awareness as well as his technical expertise. Without him I would never had secured this client so I owe a lot to him. He is also a really great guy!”

GINA MILLARD
GLASS'S INFORMATION SERVICES

“Kelly came to the department and has really made a huge impact on how the department communicates, collaborates and generally gets things done. We were already developing in an agile way, but Kelly has brought us even more into alignment with agile and scrum best practices, being eager to share information and willing to work with us to change our processes rather than dictate how things must be done. He is highly knowledgable about agile development (as his active blog proves) but his blog won't show what a friendly and knowledgeable guy he is. I highly recommend Kelly to anyone looking for a CTO or a seminar on agile/scrum practices - you won't be disappointed!”

ANDY JEFFRIES/TECHNICAL LEAD
IPC MEDIA

“Kelly was a great colleague to work with - highly competent, trustworthy and generally a nice bloke.”

HANNAH JOYCE
GLASS'S INFORMATION SERVICES

“Kelly was engaged as a Program Director on a complex business and technology transformation program for Suncorp Commercial Insurance. Kelly drew on his key capabilities and depth of experience to bring together disparate parties in a harmonised way, ensuring the initiate and concept phases of the program were understood and well formulated. Excellent outcome in a very short time frame. ”

BRUCE WEIR/EGM
SUNCORP

“I worked with Kelly on many projects at IPC and I was always impressed with his approach to all of them, always ensuring the most commercially viable route was taken. He is great at managing relationships and it was always a pleasure working with him.”

BEATRIZ MONTOYA/CONSUMER MARKETING DIRECTOR
IPC MEDIA

“I worked with Kelly whilst at Thoughtworks and found him to be a most inspiring individual, his common-sense approach coupled with a deep understanding of Agile and business makes him an invaluable asset to any organisation. I can't recommend Kelly enough.”

PETER THATCHER, SENIOR ACCOUNT DIRECTOR
ThoughtWorks

“Kelly was a brilliant CTO and a great support to me in the time we worked together. I owe Kelly a great deal in terms of direction and how to get things done under sometimes difficult circumstances. Thanks Kelly.”

JULIE PEEL
GLASS'S INFORMATION SERVICES