Open BrechtDeMan opened 8 years ago
Some functions could be quite easily unit tested, assuming the platform that performs the test supports it (some research will be needed).
Others however will be harder to achieve since they interlink with complex objects (such as the page checks and interface building).
As recent commits (on developer branch) have broken a bit of functionality, it should be made easier to check some rudimentary functionality (e.g. before committing or before merging with the master branch) other than to try the examples and spot errors manually.
I'm not quite sure how to go about this.
I think mainly every function should be called with a few input parameters and check if the output is as expected; and then a bit more high-level as well e.g. running a test and seeing whether the different elements are present, whether the number of pages is correct, whether a certain survey answer triggers the right error, and so on.
Perhaps from now on every new function should come with a couple of unit tests.
Thoughts appreciated.