Creating Your Own Heuristics and Oracles in Software Testing

In most software testing interviews today, one trend stands out: coding questions. While you may not be a coder, companies are increasingly looking for testers who can write code to build automation frameworks. It’s no secret that automation plays a vital role in modern software testing, but there’s something many hiring managers seem to overlook: the immense value of experience.

Yes, coding skills are useful, especially in environments that rely heavily on automation, but experience is what brings a deeper level of insight, intuition, and understanding to testing. In fact, I would argue that experience is what makes the difference between a good tester and a great one.


In software testing, we often face complex and unpredictable challenges. This is where heuristics and oracles come in—helping testers make decisions and evaluate results in uncertain situations. Heuristics provide guiding principles, while oracles help us determine whether a test has passed or failed. This article will explore how you can create your own heuristics and oracles to improve your testing process, drawing inspiration from the work of James Bach and Michael Bolton.

What Are Heuristics?

Heuristics are essentially mental shortcuts that help us navigate complex testing scenarios. In the world of software testing, they provide quick, experience-based guidelines that can simplify decision-making and problem-solving.

Example of a Heuristic:
“If a feature is complex, break it down into smaller testable components.”

Heuristics aren’t rigid rules but flexible principles that adapt to different contexts. For example, in mobile testing, you might use the heuristic: “Test performance on different devices after every update,” knowing that device fragmentation often leads to performance issues.


How to Develop Your Own Heuristics

  1. Learn from Experience:
    The best heuristics often come from your own experiences. Pay attention to patterns you’ve observed in previous projects. For instance, if you’ve noticed that every major feature release causes minor bugs in the login system, you can develop a heuristic like: “Always test the login system after new feature deployments.”
  2. Use Heuristic Models:
    James Bach’s Heuristic Test Strategy Model (HTSM) is a great tool to inspire your thinking. It breaks testing down into several categories—functionality, performance, usability, etc.—and helps you focus your efforts. You can take these categories and develop custom heuristics for each. For example, for usability testing, you might create: “Focus on testing for edge cases that a first-time user might encounter.”
  3. Tailor to Your Context:
    Heuristics should be adapted to the specific project or product you’re working on. In a startup environment where changes happen quickly, you might rely on heuristics like: “Prioritize testing features that directly affect the user experience” or “Test integrations after every sprint.”

What Are Oracles?

An oracle in testing is the mechanism by which you determine whether the system under test has passed or failed a given test. In other words, an oracle tells you whether the observed result matches the expected result.

Example of an Oracle:
“If the output of the function matches the behavior described in the documentation, the test has passed.”

But in many real-world scenarios, specifications aren’t always clear, or there may be no documentation at all. This is where oracles shine—allowing testers to infer correctness based on various factors like consistency, user expectations, or even comparisons to similar systems.


How to Develop Your Own Oracles

  1. Use Multiple Sources of Information:
    Oracles can come from a variety of sources: specifications, user manuals, or even industry standards. But they can also come from your own knowledge and judgment. For example, if you’re testing a financial app and the numbers don’t add up, that’s a clear indication that something is wrong, even if there’s no exact specification guiding you.
  2. Consistency Oracles:
    If the software behaves differently in similar scenarios, you’ve likely found a bug. This is the core idea behind consistency oracles. For example, if a web app behaves one way on Chrome but differently on Firefox, you can use this inconsistency as your oracle to report a problem.
  3. Learn From Real-World Cases:
    Many of your most effective oracles will come from your own experience. Think back to bugs you’ve encountered in past projects. How did you know something was wrong? Perhaps a login process behaved differently for certain users, or a feature worked on staging but failed in production. These experiences help you form oracles that you can apply to future tests.

Putting It Into Practice: Heuristics and Oracles Working Together

Let’s say you’re performing exploratory testing on a new e-commerce website. One of your heuristics could be: “Focus on testing the shopping cart functionality because it directly impacts user satisfaction.” As you explore, you use consistency oracles to check if the cart behaves the same way when adding and removing items across different browsers.

Or, in regression testing, you might use the heuristic: “Always retest critical user flows after bug fixes.” Here, your oracles could be customer feedback, logs, or comparisons to previous versions to determine whether the fix has indeed worked.


Conclusion: Building Confidence in Your Testing

Creating your own heuristics and oracles doesn’t just improve your testing—it empowers you to navigate ambiguity with confidence. By reflecting on your own experiences, leveraging models, and adapting your approach to the specific project, you can become more efficient and effective in your testing efforts.

The key takeaway? Heuristics guide your testing approach, while oracles help you evaluate results. Together, they help you make informed decisions in an ever-evolving software landscape.

Leave a comment