company logo

Making use of data inheritance

Test data maintenance becomes a problem, when a new software version requires new test data, actions or expected data has to be changed. When each test case provides its own data, this may result in a lot of test data updates. Sometimes, this can be done automatically, but often this has to be done manually. In order to reduce the amount of test data (actions, data, expected), test data may be inherited from test suite. All test data provided in actions, data and expected directory of the upper test suite is available for all test cases belonging to the test suite. In case that files that are provided for test suite and for a test case, test data from the test case is used, i.e. test case test data overwrites test data provided in the test suite.

The same way as test cases may share test data provided in the upper test suite, test suites may also share test data stored in the next higher test suite. Thus, test data may be reduced by storing it in the right place. Typically, actions are shared between test suites and test cases. Sometimes, also data is shared. Sharing expected data is, however, a rare case.

Before executing a test, actions, data and expected files are collected for each test case along the parent test suite hierarchy are collected and copied to actions, data and expected sub directory of the work_area. The disadvantage is, that test data stored in the file system is not transparent anymore, since one has to check the complete hierarchy in order to find out, what kind of test data is really involved in test. A work around is provided with the action SetupWorkArea, which creates the work area for the required test case. TestBrowser a.so shows "merged collections", which contain the test data as being merged from test case and parent directories.