To understand how a system should behave, in order to test it, I naturally build mental models. I sometimes make use of informal models such as mind maps, or more formal models such as state transition diagrams.
Iāve been thinking recently, about I might be able to build tests that exercise a system, and heuristically assert that some generalised rules apply. I want to do this without explicitly following known steps and looking for eact outcomes.
This got me thinking about Domain Models, and how some behaviour is fairly universal or part of an external standard, some are generally expected within a wider industry domain, while the rest are very specific to a given application and itās current implementation.
Behaviour from external standards or guidelines
A good example of an external standard are the Web Content Accessibility Guidelines. These are well known, external, and versioned. So much so, that I need not create my own tools or design my own tests, as great tooling already exists.
Behaviour from industry norms
Next come industry norms, things we can expect because the type of application is well known. For example in an E-commerce site I can expect it will have a shopping cart or basket, and I can expect I can add items as I shop. I can also expect there will be page where I can view what is currently in the basket, remove items, change the quantity of items. Iām sure there are many other generalised assumptions I could make, that would be true for a majority of such sites.
Domain specific behaviour
Then we come to the domain specific behaviours, the business rules that are unique to your system under test. Itās these behaviours that are most interesting to identify when building our models. An example could be, how to determine the next question to asked when checking symptoms, or when to throw a roadblock if a user enters a very serious symptom and they should be directed to emergency care immediately. Other domain specific rules could be easier to programmatically test for with a heuristic, like compliance to a style guide states all headings should be a shocking pink.
So, while I havenāt yet experimented creating a heuristic, rules based test, Iāve not got some ideas where such rules might come from, and I can already predict that working with Domain specific rules might pose a bigger challenge and be less reusable.