Skip to main content

The gamification of Software Testing

A while back, I sat in on a planning meeting. Many planning meetings slide awkwardly into a sort of ad-hoc technical analysis discussion, and this was no exception. With a little prompting, the team started to draw up what they wanted to build on a whiteboard.

The picture spoke its thousand words, and I could feel that the team now understood what needed to be done. The right questions were being asked, and initial development guesstimates were approaching common sense levels.

The discussion came around to testing, skipping over how they might test the feature, the team focused immediately on how long testing would take.

When probed as to how the testing would be performed? How we might find out what the team did wrong? Confused faces stared back at me. During our ensuing chat, I realised that they had been using BDD scenarios [only] as a metric of what testing needs to be done and when they are ready to ship. (Now I knew why I was hired to help)



There is nothing wrong with checking that the critical behaviour works (Whatever that means for them) and doing that before continuing is generally a good idea. But, after talking through their recent successes and failures, it dawned on me. They are gaming, with the best of intentions, they want to get 100% green stars/ticks from their 5 latest Cucumber scenarios for level sprint 5.

Their game had a goal, a feedback/points scoring system and a simple set of rules. But most importantly, like all good games, it was voluntary.

The Goal? Get an all green set of ticks on their Continuous Integration display.

The Feedback? The list of Scenarios they had to 'automate,' as they change from red to green, provide a progress report to the player's team.

Rules? The rules vary depending on the team, but I've known them to include:

  • All 'tests' have to be written using formal sounding phrases. A sort of simplified legalese. 
  • A test isn't valid if it can't be 'fully automated.'
  • Coverage must adhere to the pyramid/triangle (name your polygon) school of test coverage distribution.
  • All tests must use tool X.
  • Each test must only test one 'thing.'
  • Each test must test as many 'things' as possible.
  • Etc.

Philosopher Bernard Suits spoke of games when he said they were:
the voluntary attempt to overcome unnecessary obstacles. 
That describes much of the gaming approach to software testing. Eschewing the difficult task of testing for unknown issues in software, we seek a more relaxed game. We choose to do that instead and to replace the arduous task of discovering new truths about our software. We set our own more easily defined obstacles.

These obstacles are usually the ones we can defend most readily to those unfamiliar with software testing. They follow a simple process, whereby some simple criteria are translated into the rubric of Given, When & Then.

In another apt quote Bernard Suits states:

To play a game is to attempt to achieve a specific state of affairs [prelusory goal], using only means permitted by rules [lusory means], where the rules prohibit use of more efficient in favour of less efficient means [constitutive rules], and where the rules are accepted just because they make possible such activity [lusory attitude].

The use of a more complex, less efficient way of working is essential to the game. We just wouldn't be playing correctly if we didn't follow the rules. A direct and efficient approach is avoided, the goal of finding out what the software does and whether that is good is displaced by a less suitable means to a different end. The new goal is to encode a simplification the system's behaviour while adhering to the rules.

The game provides cover, protection from the culture of blame common in software development. If I played by the rules, and have the evidence to show I played every card dealt - then I am not to blame. (right?)

The loser here is the quality of the application and important factors such as time to market and reputation. An unreliable product that is received poorly and criticised etc. Or an app that gets 'stuck' pre-release and slips deadlines.

Playing the game is a form of goal displacement. To remember what testing is and to do it well is difficult. To test a complicated application often takes code, tools, intelligence, experience and an inquisitive mind (to name but a few). But there isn't a simple game that can weave those skills together for into a simple script. Just as there isn't a simple script for writing the code in the first place, Fortunately, we exist, and it's our role to help our clients find the truth about what their products are actually doing.

I propose a new game. A game based on polite and friendly one-upmanship. Team members continually try to outdo one another. The game develops a virtuous circle of behaviour to everyone's benefit. Providing the team with challenging and exciting work, a quality product and a good reputation.

For example, let us say Alice is working as a lead developer of a new feature. She can win by avoiding the usual bugs, and also by pre-empting those the testers might find. Alice uses all the tools and skills at her disposal, in the limited time, she has to outfox the testers. The testers will not even be able to whinge (let's be honest we do moan a bit) about testability. This is because Alice learned in a previous round about the testers 'get out of jail' card: poor testability. She has included a full array of test hooks, giving them no excuse!

Beverley, our tester has been busy preparing for Alice's next iteration. She investigates and questions the requirements. She frequently consults with the Product Owner. Not afraid to think that she might not know it all, she looks at rival companies versions of the feature. From experience, she knows that there may be details of bugs that might also occur in Alice's new code.

Knowing that Alice is pretty thorough, Beverley knows she can't just run her test automation and walk away. Alice will have caught all the obvious issues with her comprehensive unit tests. As well as automating the relevant checks and updating her tools she spends time thinking laterally and consulting with Alice directly to see if any areas are already being missed. She spends as much time as she can investigating the new feature and the whole system - as soon as she can. She is consistently in search of an angle of attack to find a new layer of bugs. For example, She suspects Alice isn't thinking about the performance implications of her new feature...

This ongoing Tester-Developer arms race leads to a skilled and well-tooled team, who progressively improve how and what they deliver. The team becomes both lean and flexible, without unnecessary or bloated processes. They have to focus on quality and how to adapt quickly to new and higher standards because that is how they win their game.

Comments

Popular posts from this blog

Betting in Testing

“I’ve completed my testing of this feature, and I think it's ready to ship” “Are you willing to bet on that?” No, Don't worry, I’m not going to list various ways you could test the feature better or things you might have forgotten. Instead, I recommend you to ask yourself that question next time you believe you are finished.  Why? It might cause you to analyse your belief more critically. We arrive at a decision usually by means of a mixture of emotion, convention and reason. Considering the question of whether the feature and the app are good enough as a bet is likely to make you use a more evidence-based approach. Testing is gambling with your time to find information about the app. Why do I think I am done here? Would I bet money/reputation on it? I have a checklist stuck to one of my screens, that I read and contemplate when I get to this point. When you have considered the options, you may decide to check some more things or ship the app

Test Engineers, counsel for... all of the above!

Sometimes people discuss test engineers and QA as if they were a sort of police force, patrolling the streets of code looking for offences and offenders. While I can see the parallels, the investigation, checking the veracity of claims and a belief that we are making things safer. The simile soon falls down. But testers are not on the other side of the problem, we work alongside core developers, we often write code and follow all the same procedures (pull requests, planning, requirements analysis etc) they do. We also have the same goals, the delivery of working software that fulfills the team’s/company's goals and avoids harm. "A few good men" a great courtroom drama, all about finding the truth. Software quality, whatever that means for you and your company is helped by Test Engineers. Test Engineers approach the problem from another vantage point. We are the lawyers (& their investigators) in the court-room, sifting the evidence, questioning the facts and viewing t

XSS and Open Redirect on Telegraph.co.uk Authentication pages

I recently found a couple of security issues with the Telegraph.co.uk website. The site contained an Open redirect as well as an XSS vulnerability. These issues were in the authentication section of the website, https://auth.telegraph.co.uk/ . The flaws could provide an easy means to phish customer details and passwords from unsuspecting users. I informed the telegraph's technical management, as part of a responsible disclosure process. The telegraph management forwarded the issue report and thanked me the same day. (12th May 2014) The fix went live between the 11th and 14th of July, 2 months after the issue was reported. The details: The code served via auth.telegraph.co.uk appeared to have 2 vulnerabilities, an open redirect and a reflected Cross Site Scripting (XSS) vulnerability. Both types of vulnerabilty are in the OWASP Top 10 and can be used to manipulate and phish users of a website. As well has potentially hijack a user's session. Compromised URLs, that exp