Discovery vs. Confirmation
When I hear debates about scripted vs. exploratory testing... or even debates such as "automate all tests" vs. "you can't automate all tests"... I don't think I'm hearing the real debate.
I think the debate that I'm hearing is "testing is about confirmation" vs. "testing is about discovery".
This distinction in the underlying intent of a given approach seems to not be emphasised in these discussions.
In simple terms, I think of the intent behind testing as having two facets:
- Confirmation - Does the system do what we anticipated it should do?
- Discovery - Does the system do (or not do) anything we did not anticipate it would (or should do)?
Confirmation
The goal of scripted tests that are written for repeatability (be they manual or automated) is confirmation.
We are trying to confirm that the system does what we have anticipated it should do. The important word there is 'anticipate', because we have to anticipate a test for it to be scripted or automated. How we anticipate the test is another issue and will vary depending on what process you are using.
Indeed, we may discover where the system doesn't do what we expect it to (e.g. during regression tests) but the emphasis in such tests is on confirmation.
Discovery
Inspective exploratory testing (and ad-hoc testing) where we are not robotically executing pre-defined tests but designing the test in the instant before we execute it - emphasises discovery over confirmation.
We are trying to discover where the system does things we didn't anticipate that it would do - and find things that the system doesn't do (or doesn't do very well). In essence we are seeking tests-worth-repeating - such as tests that find bugs.
Indeed, in the course of performing exploratory testing we might construct an hypothesis and perform tests that are designed to confirm that hypothesis but nonetheless the over-arching intent is discovery.
How does this manifest itself in practice?
Let me explain how this relates to areas of interest to me...
In Test-Driven Development (TDD) and Acceptance Test Driven Development (ATDD) - whilst we are deciding what test is next and indeed while we are trying to write it, we are trying to 'discover' what the item under development should do. Once the test is written we are saying that is what we currently believe the system should do and the automated test's purpose is then to 'confirm' when the item under development actually does it. This automated test then continues to confirm that the system actually does it.
During an iteration, all the tests we anticipate may then be running and passing... now it's time to 'discover' the tests we didn't anticipate. I would employ exploratory testing for this purpose. As we attempt test after test (that we'd previously not anticipated) - we might find a bug.... or maybe just a 'gap in our original thinking'. That is now a test-worth-repeating. This might be captured in a bug-tracking system or, for me, more often captured as an automated test (probably done after the exploratory testing session). This test might be best applied as a unit test or as an acceptance test... it tends to depend (what it depends on is beyond the scope of this blog post).
Some closing thoughts
Some processes don't try to anticipate tests and rely more on exploratory testing (i.e. discovery-oriented). Some processes do try to anticipate tests but not in a way that is practical (resulting in scripted or automated tests being deprecated) - again, relying more on exploratory testing. In such cases, we are simply relying on discovery-oriented-testing to drive the identification of confirmation-oriented-tests. Confirmation-oriented tests might be manual (in a test-script or bug-report) or automated... I believe test-driven methods allow a balanced application of both discovery and confirmatory testing.
Next time you find yourself in a debate about scripted vs. exploratory or automate-everything vs. automate-some-tests stop and think for a moment - is that what we are really debating here? You may just have two very different perspectives on the intent of the testing you are most concerned with... it might be that you are actually debating confirmation vs. discovery when perhaps your conversation would better serve your project if you discussed how to exploit both confirmation and discovery oriented approaches to testing.
