If you’d asked me that question last week, I’d have said no, of course not. Actually, I’d probably have laughed at you and then said no, of course not. But today, I’m not so sure. So what’s changed? Simple really, last Wednesday I went to my son’s parent’s evening at the local Army Cadet Force Detachment, where he’s a member. There’s an obvious connection there, right? Well no, there’s not, and it took the lesson a few days to congeal in my mind. Let me tell you what I saw and why it made me form the question in the title:
Army Cadet Force – The Way it Was
First let me set the scene for you. I was a member of the ACF for 4 years, between 1984 and 1988, rising to the rank of Company Sergeant Major. At that time the assault course was completed by teams of cadets, against the clock and wearing battle order webbing. It featured in every military skills competition I ever competed in. The assault course at Barry Buddon, our weekend training area, is a third of a mile long and is a severe test of physical strength, endurance and team work. It is one of the longest and most demanding assault courses in the UK. No matter how introverted a cadet might be, you could always tell his character by the way he tackled the assault course.
The Modern Army Cadet Force
Fast forward 20 years and things have changed. A “risk aware” culture now permeates the ACF. The first thing that went was the battle order webbing, cadets are no longer allowed to wear it whilst crossing the assault course, I mean if you fell it could trap you in one of the water obstacles, couldn’t it? Next the name, assault course is a little “war-like” isn’t it? It should be changed to something a little more soft and cuddly, and so it is now an “obstacle course”. Then helmets. Helmet should definitely be worn, cadets might bump their heads whilst going through the tunnels or be hit in the head by a returning rope on the rope swing. Next the clock was removed. Cadets are no longer allowed to race across the assault course. Trying to beat a time, may cause them to take unacceptable risks. Finally, all of the water obstacles should be drained of water down to just below knee height, anymore and a cadet might drown if they couldn’t regain the edge. There is even talk of cadets having to wear safety harnesses and have a safety rope when completing the high obstacles. I haven’t been to the assault course since I left the cadets. On Wednesday night, I eyed the beast of yesterday, only to find that it’d had it’s teeth pulled and it’s claws blunted. It was a little sad to see if I’m honest.
Diminishing Returns on Health And Safety
Still, you have to balance that with the safety of the cadets, and they are much less likely to hurt themselves now, right? Well, no actually. In the 4 years that I was a cadet, I didn’t see a single bad accident on the assault course. In fact, I saw no accidents whatsoever, excluding the odd grazed knee and the like. But on Wednesday, there were a couple of cadets who hurt themselves quite badly, despite the ridiculous health and safety measures. Why? Simple, the cadets of today have no respect for the assault course. They are used to operating in an environment where every danger has been removed or blunted that they fail to take even the most basic precautions for themselves.
In my day, apart from the odd shout of encouragement or instruction, there wasn’t a word uttered – everyone was concentrating on their role in the team, squeezing out every wasted second, everyone was giving every ounce of strength they had to finish in a fast time. Not now. Cadets were strolling along, exchanging the gossip of the day, totally oblivious to the dangers that might still lurk – because it is impossible to remove every danger from an environment. Consequently, a couple of the cadets took a tumble and hurt themselves, one of them pretty badly.
You see, it’s clear to me that there is a diminishing return on health and safety measures. When helmets were introduced, I’m sure there was a reduction in the number of head injuries sustained. Now that number wasn’t big to begin with, because we were all aware of the danger, but reducing that small number was certainly a good thing. However, as each successive layer of health and safety was added there was a diminishing return because for every one person you protected, another was injured because they had become oblivious to the danger. On Wednesday night I saw more cadets injured taking a leisurely stroll across the assault course, than I saw during the whole of my cadet career.
The Danger of Working in an Over-Tested Environment
It occurred to me that this was not a function of something that the Army Cadet Force was doing, but instead it was a function of human nature. The more safe an environment is perceived to be, the less careful we humans are. Naturally then, this scenario is applicable to software engineering. With the current focus on TDD and automated unit testing, it stands to reason that the modern generation of engineer perceives him or herself to be working in a safe environment. I mean all the tests pass, so the code must be okay, right?
Unfortunately, as the above shows, that is not the case. Just as the ACF can't remove all of the dangers from the assault course - so each cadet must take responsibility for their own safety whilst completing it - so tests can’t verify that your code works under every possible execution scenario. As a programmer, you must take responsibility for your own code’s safe execution. Before the fashion for TDD and automated unit testing, programmers were adept at writing defensive code, just as my generation of cadets were adept at ducking when they saw a heavy rope coming. The newest generation of programmers must not allow the presence of unit tests to lull them into a false sense that their code operates in a “safe” environment. If that happens, if they rely only on tests and do not learn how to code defensively, then the answer to the question posed in the title of this blog post will be yes, testing does make you a bad programmer.