Re: Testing
[email protected] Wed, 16 May 2018 23:52:39 -0400
| Newsgroups | gmane.comp.audio.supercollider.devel |
|---|---|
| Message-ID | <[email protected]> |
Responses inline: > El 15 may 2018, a las 18:48, [email protected] escribió: > For the purpose of community discussion, can someone please define or give examples of "specs"? This is a nebulous term to me and since I'm not the one using/asking for it, I can't really talk about the suggestion until there's some clarification. My biggest question is - is it different than documentation? How/why? I can't really think of anything that is a specification that shouldn't also be documentation, unless you're also considering implementation details. > (In addition to James' points) To draw an analogy, here's a toy example and then a more real-world example. Hopefully my connection between the two is clear: - Toy example: if we were writing a spec for Array.reverse, we could specify a property that must always hold: {|a| a.reverse.reverse == a} And then to property test we just blast it with 100 random arrays and check that the property always holds - A more real-world example, that I think we all wish we'd written a spec for: there's the whole Impulse.ar(0) annoyance, where we didn't really define whether f(-1) == f(0), or f(-1) == 0 or what. If we had written a formal spec of some sort: a) We'd be more likely to have noticed we hadn't thought of that case b) If we _had_ come up with a rule (e.g. let's say we had settled on the f(-1) == f(0) "rule"), then we'd have something to test against and make sure all UGens conform to > For example, I wrote the test suite for the lexer and parser and compiler because I wanted to make a number of improvements there. I also wrote a ton of tests for inter-process communication between server and sclang because I knew there was a desire to fix that in future work, and I didn't want the lack of tests or the burden of manual testing to get in the way of that. > 🙏 Tom _______________________________________________ sc-dev mailing list info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/ search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/