So I've done a fair bit of hobby development, but never done anything beyond look furtively at any remotely formal testing. I 'check things work' and not much more. I've tried to do differently for my current project, partly because it's towards a dissertation and the assessment considers it, but also because the failure modes are sufficiently involved that it's a terrible idea not to.
How are tests normally structured? I wrote tests for components either beforehand or at least alongside, but I usually replaced these with functional code afterwards. So I suppose my regression testing is pretty limited, but the components are sufficiently orthogonal that I've been more-or-less able to write and debug them then leave alone. I have some Octave scripts that generate test cases for some elements. Do I just have a 'make tests' which runs those scripts to generate the test data files and swaps in an alternative main.cpp?
Also, how do I test e.g. stochastic model-fitting code? So far I've checked by eye that it looks sensible, but do I want to have some code which compares the fitted model to ground truth and checks it's within some tolerance, maybe with some sort of 'voting' system to account for the element of randomness?
TheUnbelieverMember Since 19 Mar 2005
Offline Last Active Feb 28 2013 04:45 PM
- Group Members
- Active Posts 1,650
- Profile Views 2,698
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown