Re:Less thinking. More testing.
by joubert on Sunday May 23, 2010 @04:25PM
(#1372926)
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?
[ Parent
| on HN ]
Re:Less thinking. More testing.
by GeoffWozniak on Sunday May 23, 2010 @04:55PM
(#1372993)
I 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%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.
I 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/) takes Haskell programs with contracts and effectively generates its own test suites.