Re:Automatically fixing bugs in C programs with Genetic Algo...
by Havoc on Monday July 25, 2011 @01:31PM
(#2803614)
Is it just me or is this a horrible idea? Surely the GA will evolve in ways that fix the problem but introduce some new problems that you haven't even considered/tested for?
[ Parent
| on HN ]
Re:Automatically fixing bugs in C programs with Genetic Algo...
by breckinloggins on Monday July 25, 2011 @01:49PM
(#2803696)
Sure, if you intend to just run the algorithm and check in the changes proudly proclaiming "it's fixed!"
A better use for it would be as an assistant to help you track down the root cause of stubborn bugs.
It's kind of like git-bisect in reverse.
Re:Automatically fixing bugs in C programs with Genetic Algo...
by dkubb on Monday July 25, 2011 @11:24PM
(#2805847)
I've used a similar technique to this called Mutation Testing to find code that wasn't tested by a unit test.
It doesn't use a GA, but it's still pretty neat. It parses the code into an AST and then mutates each node in the AST, rerunning the tests to see if they pass or fail. They are supposed to fail; if they continue to pass, it means a state isn't being tested.
The computer acts as my assistant tracking down cases I forgot to test, so that I can write the test to catch the mutation. Sometimes it even finds sections of code that are impossible to reach normally, allowing me to remove the dead code paths that I might otherwise have missed.
Re:Automatically fixing bugs in C programs with Genetic Algo...
by aidenn0 on Monday July 25, 2011 @05:00PM
(#2804591)
On the other-hand a sizable percentage of developers already use this technique, informally, for bugfixing. My intuition is that replacing those developers with this algorithm would only improve code quality.