[PD-dev] signal object test template for automated unit testing

Hans-Christoph Steiner hans at at.or.at
Mon Oct 24 19:35:37 CEST 2011


That looks really good on many levels. :)  I like the layout, I hadn't  
thought of standard deviation, that makes sense as long as we can  
specify "exact" as a possibility.  My guess is that some of this stuff  
should produce the same bit sequence every time, but I could be wrong  
there.

Perhaps the subpatches should be abstractions as part of a 'test'  
library.  If there was a bug or a new feature needed in any of those  
subpatches, it would be rough to have to modify all of the tests.

About the sample rate, it should be possible to have each patch set  
the sample rate it needs.  You can see hcs/get-audio-dialog-help.pd or  
the mediasettings library for ways to do that.  I think we'll want to  
test at different sample rates some day, but if its easier for now, we  
can stick to 44100.

.hc

On Oct 24, 2011, at 6:30 AM, katja wrote:

> Hello dev list,
>
> Inspired by the intentions to set up an automated unit test procedure
> for Pd-extended, we propose a template for testing signal objects.
> "We" is Fred Jan Kraan and me, we've been puzzling on this together
> last weekend.
>
> As far as we could see, there is no way to generate test patches for
> all signal objects with a 'one-size-fits-all' content and where you
> could replace the object under test using a simple script. Conditions
> are just too different per object. Instead, we opted for a template
> where you manually put the object under test, together with requisites
> like test signal, 'set' messages etc. Aspects of the template:
>
> - compares signal under test with reference which is stored with the
> patch (512 points)
> - reference array can be recorded in the patch using a Pd known to
> work well (release build for example)
> - visual representation of signal under test, reference signal and  
> diff
> - standard deviation is calculated
> - maximum tolerated standard deviation can be set (tolerance)
> - test result is reported as a function of found standard deviation
> and tolerance ('tested OK' or 'ERROR: deviation ....')
> - test result is printed to Pd window and stdout
> - test is automatically executed when patch is loaded
> - samplerate 44100 is considered the norm, error is reported when
> other samplerate is detected at patch load
>
> The template is intended towards automated unit testing. Test patches
> based on the template could be included in a setup like the
> 'load-every-help' test.
>
> Attached is a .zip with the template and two examples. Please comment
> on it if you have suggestions.
>
>
> Katja
> <template~test.zip>_______________________________________________
> Pd-dev mailing list
> Pd-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev





----------------------------------------------------------------------------

Programs should be written for people to read, and only incidentally  
for machines to execute.
  - from Structure and Interpretation of Computer Programs




More information about the Pd-dev mailing list