Software testers are responsible for creating test data. They can do it manually or using testing tools, but it is their responsibility. Here we explain the concept of self-verifying data. The post is aligned with the Black Box Software Testing Foundations course (BBST) designed by Rebecca Fiedler, Cem Kaner, and James Bach.
Self-verifying test data is any data that contains the correct answer of function or feature that we test. An example is the IBAN number calculation feature. Inputs are country code, bank identifier, account number, and we know that check number must have the value of twelve (above picture). We put that number as part of the customer name. Doing that, by observing the result of the calculation, we know what the correct answer by just observing the input data is. We do not need to consult some requirements documents or do the calculation (we had already done it).
Counterstrings are another example of self-verifying data.
Advantages are obvious:
- we do not need to consult the external document
- allows post-test analysis
- verification is based on contents of the message, not the user interface
- can generate and verify a large amount of test data
- check is not based on the user interface, but on the logical calculation
- the tester must know how to calculate self-verifying data
- when calculation logic changes, test data must be changed
- we miss bugs if this is the only test technique that we use.