97

Automatically generate unit tests for all the code I write.

Comments
  • 3
    How would you generate tests, when you write your tests before coding?
  • 0
    This is an amazeballs power.
  • 0
    @plusgut well it's basically like having all the specs for the code, but in unit test form (as a good unit test site should be). In true TDD style.
  • 0
    Actually to some extend this is possible. In my seminar I study various techniques to achieve this ;)
  • 1
    @burnaut teach me
  • 0
    I share same sentiments mate, I really need this lol
  • 0
    @burnaut please, for the love of God, enlighten me!
  • 0
    Well you could create a grammar of the input your program takes and then use this grammar to generate fuzzing inputs and check, whether your program is able to handle those. Clearly there are more advanced approaches and improvements, but this one is basic. If you do not want to create the grammar by hand you could also generate this too. However you would then need to check by hand for inputs on which your program crashes, whether those are valid or not, as the generated grammar could also be wrong.

    This would only result in test input sets, but obviously you can create/generate unit tests out of this.
Add Comment