3 ms·
Well, this is basically what types are :)
by pka 11y ago
Well, this is basically what types are :)
- nickpsecurity 11y agoNo, not imperative types. Tests run specific data through one or more functions for a variety of reasons. Each run will have some successful or flawed effect. Different values of the same type of data can have different results. So, generating test values from specs and types automatically is different from merely typing the data or functions. And, again, I'm talking traditional types like in Java or C++ rather than dependent types and other esoteric stuff.
- pka 11y agoOh, yeah - something like QuickCheck [0] is great! There are Java and C++ implementations as well, though I haven't tried them. Definitely a nice alternative to traditional unit testing whenever possible. I don't know how well it mixes with unrestricted IO like in Java etc though. [0] https://en.wikipedia.org/wiki/QuickCheck https://en.wikipedia.org/wiki/QuickCheck
- nickpsecurity 11y agoNow you're getting the idea. QuickCheck is a good example. I was going to drop an example from safety-critical industry but there's too many now for me to find it lol. Anyway, thanks to our discussion, I did find this great page with links to surveys, list of strategies, and listings of tools: http://mit.bme.hu/~micskeiz/pages/code_based_test_generation.html http://mit.bme.hu/~micskeiz/pages/code_based_test_generation... Enjoy!
- pka 11y agoLooks great, thanks!