SWC2013TDD » History » Version 3

Version 2 (Chris Cannam, 2013-02-05 06:55 PM) → Version 3/19 (Chris Cannam, 2013-02-05 07:57 PM)

h1. Test-driven development outline

We assume that the "intro to Python" section has at least introduced how you would run a Python program and compare the output against an external source of "correct" results; also that the NumPy/audiofile section has shown how to suck in an entire (mono) audio file as a NumPy array.

We'll refer first back to the "intro to Python" example, with the text file of dates and observations.

<pre>
Date,Species,Count
2012.04.28,marlin,2
2012.04.28,turtle,1
2012.04.28,shark,3
# I think it was a Marlin... luis
2012.04.27,marlin,4
</pre>

We have our program that prints out the number of marlin.

<pre>
$ python count-marlin.py
4
$
</pre>