3 ms·
I had a thought along the following lines: if I have test cases for a feature, it would be really cool if I have an engine which can figure out code to satisfy
by joubert 16y ago
I had a thought along the following lines: if I have test cases for a feature, it would be really cool if I have an engine which can figure out code to satisfy thoses tests. I.e. I define the contract; the computer figures out how to solve. Kinda like Simonyi's intentional programming. Is anybody working on something in this area?
- GeoffWozniak 16y agoI did a thesis that explored aspects of generating code that passed tests, but it was limited to deriving adequate structural representations based on behavioural specifications. Two approaches were shown: changing data structure representations to meet requirements and generating class structure/hierarchy. The thesis showed that it is possible to do this and how to do it, but it is a huge topic. If you're interested, I'll put more effort into making my thesis available online in HTML format. In the meantime, you can get it in a variety of places. http://duckduckgo.com/?q=Structuring%20Data%20via%20Behavioural%20Synthesis http://duckduckgo.com/?q=Structuring%20Data%20via%20Behaviou... Incidentally, generating behavioural elements (like entire functions) to pass tests would be very difficult although I have been toying with ways to try it out.
- gjm11 16y agoI don't know about that (it seems like doing it in general would be impossible, but some easy cases might be manageable), but there's a nice converse: QuickCheck (http://www.cs.chalmers.se/~rjmh/QuickCheck/ http://www.cs.chalmers.se/~rjmh/QuickCheck/) takes Haskell programs with contracts and effectively generates its own test suites.