Our system under test is a GUI application. It appears beneficial to have test cases isolated, i.e. their execution does not depend on each other. For example, a later test case should not rely on objects created in a prior test case. By isolating them, there are no implicit dependencies and it becomes easier to maintain them (rearrange them, rewrite them, etc.).
The following options to implement isolation come to my mind:
- objects created during a test case are deleted explicitly at the end of it; global settings that were changed are restored to their defaults explicitly
- restart the SUT and reset it to its defaults by deleting the application's data store (e.g. directory in Windows' %appdata%)
- if your application allows the import of settings, import a defined settings file (e.g. the defaults after installation) at the beginning of a test case
Are there other options? Do you know of any literature? Or is isolation not so important, or even undesireable?