Hacker News new | ask | show | jobs
by nickpsecurity 3800 days ago
What about tech that generated tests automatically from code and annotations? How do you think that would affect your work?
1 comments

Well, this is basically what types are :)
No, 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.

Oh, 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

Now 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...

Enjoy!

Looks great, thanks!