

Ask HN: Feedback on project idea (automated regression test generation) - sysk

I&#x27;ve noticed that when I write Javascript tests (and am in a rush), I often just call a bunch of functions with  (semi-)randomly chosen arguments, check what return values &#x2F; changed state I get and codify that in a test suite using asserts so that when I want to refactor later I can catch some bugs. It&#x27;s obviously not the ideal way to write tests but it&#x27;s better than nothing.<p>I was wondering if I could automate the process by writing a tool that would extract all exported functions from a module, call them with randomly generated arguments and save return values and&#x2F;or changed state. The tool could then generate a test suite using that information. The tool could also be used to quickly add tests to third party libraries.<p>Of course this tool would generate &quot;dumb&quot; tests with raw data but the intent here is not to offer an alternative to human written tests but rather to offer an alternative to no tests at all.<p>The concept could be applied to other languages as well.<p>Does such a tool already exist?<p>Am I overlooking some critical issue?<p>Do you think such a tool would be useful?
======
S4M
There is something called quick_check.js [0] that looks similar to what you
want. It's inspired by Haskell's QuickCheck library [1].

[0]
[https://github.com/gampleman/quick_check.js](https://github.com/gampleman/quick_check.js)

[1]
[https://wiki.haskell.org/Introduction_to_QuickCheck1](https://wiki.haskell.org/Introduction_to_QuickCheck1)

