Hello again. As you can probably guess, I'm setting up for what looks like quite a few months of development (though I already have a nice 2-way driver for the Frontier Tranzport http://www.frontierdesign.com/Products/TranzPort,
a truly fantastic and cheap little wireless unit, which I intend to contribute in the next few weeks...)
I realize that I'm deeply suspicious of any code I write that does not have unit tests, that I frankly don't believe it works.
I also have issues with breakage in general; I find I make "tiny" changes to a patch and some other patch somewhere else breaks. Of course, this is due to my mistaken perception of what "tiny" really is but if I had testing I could make a small change, verify it, commit my work, and continue.
My thoughts are as follows.
* There need to be two levels of unit testing, one at the C/C++ level, one at the Max level.
* The C++ unit testing depends on the C++ framework for development. I downloaded the Max 4.6 SDK (any ETA for the Mac 5 SDK?) and will peruse it. I'm favourably impressed with the simplicity and clarify of its documentation so far; on the other hand, I have nothing yet to test.
* C++ unit testing I can work out: but how to unit test Max objects?
1. Create two well-known send/receive (s/r) pairs called UnitTest and UnitTestResult
2. Patches that need to be tested need to add one or more "unit test patches" to a single central unit test patch ("main test") for the project.
3. A unit test patch for a patch can be that patch, its .maxhelp, or some new patch.
4. A unit test patch must receive UnitTest and send to UnitTestResult in at least one place.
5. A unit test patch has a name that must be unique over all unit tests in the same main test.
6. To start the test, the main test sends a start message to UnitTest.
7. Each unit test must first reply with a message to UnitTestResult:
8. Each unit test must subsequently send exactly one of two other messages to UnitTestResult
9. A unit test that has sent a start message to UnitTestResult but hasn't sent an ok or fail message is said to be "stalled".
10. On the original page, our unit test indicator is red if any fail message has been received since the last start was sent, yellow if some tests are stalled or green if all tests that were started had replied "OK".
* Creating mocks appears to be impossible.
* Testing user interfaces appears difficult or impossible.
* Simulating time (so unit tests don't run in real time) seems difficult or impossible.
* This appears to be best for testing logic or edge cases.
* However, most of my bugs at least are logic bugs or edge cases.