Which End of the Horse?

“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.

2 Responses to “Which End of the Horse?”

Lanette

December 25, 2010

11:52 am

permalink

Very well written article, Ron! Thank you for explaining more what 140 characters cuts out.

There is still a point that we disagree on. First, I believe everyone is responsible for quality on the team. If no one ever checks behind the horse, we risk them crapping all over our customers. That is what I see happening in real life right now as teams are over trusting their agile process and automated checks. When indeed the path behind the horses is clear for some time, and we are confident enough to stand behind the horse ourselves in our finest attire, then, and only then should there be no one on horse output duty. I envision collaboration in all areas of quality, including on the horse, behind it, and hopefully no one trampled under the hooves.

My experience is that even a small amount of early dev/tester pairing leads to a major reduction in bugs. At this point, nearly every experienced tester codes enough to understand a code walk through in most languages, and every GOOD tester I know if they are lost on a part of it can understand psuedo code and explain how they would test that. This doesn’t take long. Last year we got this done in 30 minutes a week most weeks. The half day sessions were just because we were having fun and learning, so I stayed there. Sometimes we each were working on something different a little bit. Me on my automated checks. Him making some changes based on the tests we talked about or even stuff he found that he wanted to improve in his own code.

The days of working around testers who don’t understand the challenges of writing excellent code are more and more rare. Most testers are responsible for maintaining automation at least, if not for designing and implementing it.

I’m a tester because I’m actually excited about my profession. I don’t want to be a developer. I will write code because it solves testing problems, but that isn’t what I’m passionate about. It is a means to an end. It is emotionally difficult to face the truth, that many developers do not value testing or even think that it is particularly interesting. I realize that there are many who’ve had bad experiences with testers, but the solution isn’t to make everyone a developer who checks their own code. Better code is a win for everyone, ESPECIALLY a talented tester. The interesting areas to test are not in the code itself. They are the larger questions of the impacts of integration, usability, performance, security, and even cohesiveness. Without stable working code, we can’t test for these things. Without solid checks behind us, we can’t dive into the questions being created by the new features, new code, and new customer information. Maintaining old code, and testing it is boring to everyone. We all want to be involved with the creative and innovative stuff. I just believe we also need the humility to walk together behind the horse. Because ultimately, better us than the customers who sign our checks. When the pavement is clean and shiny, or all that’s coming out of the pony is glitter and rainbows, then we can all dance in the parade. Until then, I’ll keep my boots on. :)

Lanette

December 26, 2010

11:29 pm

permalink

Ahh. The rewording makes your intent far more clear. I think we agree here, although I got the wrong impression of neglect behind the horse, I now see that isn’t the intent.

Thanks for taking the time to explain.

Recent Articles

Codea Calculator II

Ignatz and Jmv38 on the Codea forums commented on the previous article. I had hoped to do more anyway so here's the next one.

Codea Calculator

Based on a simple example on the codea.io forums, I decided to write an article showing all the stuff I might do on a production calculator project. Wow.