BrechtDeMan / WebAudioEvaluationTool

A tool based on the HTML5 Web Audio API to perform perceptual audio evaluation tests locally or on remote machines over the web.
https://code.soundsoftware.ac.uk/projects/webaudioevaluationtool
GNU General Public License v3.0
114 stars 37 forks source link

Elementary unit tests #113

Open BrechtDeMan opened 8 years ago

BrechtDeMan commented 8 years ago

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.

nickjillings commented 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).