Einstein had a pretty amazing mind. He came up with some mind blowing theories about how light, time and the universe works, and from what I understand, he did much of this just by thinking about it rather than by measuring it in physical experiments. You have to agree that’s pretty impressive. The name given to this kind of work is a “thought experiment”. You perform a theoretical experiment by thinking it through rather than by actually performing the physical experiment.
When I hear the term “thought experiment” it’s Einstein who jumps to my mind; however the more famous examples of the term come from some other scientists, for example Schrödinger’s Cat http://en.wikipedia.org/wiki/Schr%C3%B6dinger%27s_cat
and Maxwell’s Demon http://en.wikipedia.org/wiki/Maxwell%27s_demon
I worked with a very experienced and talented tester over the last few years and one thing I noticed is that he would frequently discover bugs and help the development team to fix them without executing a test at all. When he was learning about the new function (perhaps from the specification or by talking to the development team about it) he would think through interesting test scenarios that might expose flaws in the software’s design. He would then present his test ideas to the development team and not infrequently there might be expressions such as “hmmmmm…Oh dear…” or “Ah, no, that’s not going to work is it…” There can be lots of value in just thinking through possible tests scenarios, which you then might execute later, or not at all. It struck me that this approach has some parallels to this kind of thought experiments that Einstein, Schrödinger and Maxwell did.
Testing is a form of scientific experiment. You (often) make some kind of implicit or explicit hypothesis and then perform some kind of experiment and observe the results. Based on the results you update your understanding of the behaviour of the system and if this doesn’t match the desired model then you might well have a bug to fix. Just as it’s possible to do thought experiments in Physics, so it’s possible to think of test scenarios and gain some value from them before you execute them. In my experience there are two big positives from this.
- By helping the developers to spot bugs before you try to execute the tests you can get earlier fixes and make the subsequent testing more efficient. Ideally you’d help the developer to think through these test scenarios when they’re still at the design phase and help them to avoid writing the bug in the first place!
- Some test scenarios might be prohibitively expensive to set up and run. By performing the thought experiment you can get some of the value for a tiny fraction of the cost. Of course it won’t be as good as actually running the test but it’s probably better than nothing.
Two other small points to finish. Firstly this is just one tool in our tool box as testers. I’m not suggesting you don’t need to actually using the system under test any-more! Secondly, the tester I mentioned above who showed me how effective this was doesn’t really like the term I’ve tried to coin for it – “Einsteinian testing” He says it’s just testing and doing it earlier in the process is just a normal part of doing it well. And of course, he is absolutely right!