Successful software testing is all about knowing how, where and what to test. This can be relatively straightforward when you have ample documentation to work with, however, when you don’t, you need to provide a little structure and direction yourself. Heuristics offer a fast, simple and effective alternative to testing blind and just hoping for the best; here we will take a closer look at what heuristics are and the important role they play in software testing.
What are heuristics?
Heuristics have been described as everything from a rule of thumb to a mental shortcut to an educated guess, but regardless of what you call them, a heuristic is essentially a simple strategy that helps you make decisions and find solutions quickly. Rather than provide the answer itself, heuristics suggest key elements to consider, often by way of an acronym, a few words or even a phrase that directs your attention to details that are likely to matter most. The word heuristic comes from the Greek heurisko, which loosely translates to mean I find.
Using heuristics in software testing
Heuristics in software testing provide a simple framework based on past data and probability that help you test your programs most effectively. By highlighting core elements of the software and places where bugs are most likely to be found, heuristics ensure that all your most crucial bases will be covered, regardless of how little you may know about the program itself. The following mnemonic from James Bach is a fantastic example of a software testing heuristic.
Only by understanding the environment you are dealing with can you conjure up the optimal testing strategy – SFDPO can help. Sometimes referred to as San Francisco Depot, this popular heuristic stands for Structure, Function, Data, Platform and Operations and it reminds testers to consider these central aspects of the software (and all their related elements) before drawing up their testing strategy.
Structure – What is it?
Function – What does it do?
Data – What does it process?
Platform – What does it depend upon?
Operations – How will it be used?
For more examples of heuristics applied to software testing, we recommend the following resources: Test Insane’s Heuristic Test Strategy Model by James Bach and Quality Tree Software’s Test Heuristics cheatsheet.
While heuristics can’t tell you where all those bugs will be found, they provide a fantastic tool with which to focus your efforts and therefore should be part of every tester’s arsenal. Regardless of the type of testing you do, there is no shortage of useful heuristics to employ and you should create your own as well. Remember to use heuristics as a guide, not as a rule, as their purpose is to spark ideas rather than dictate what you should do.