News for hackers. Stuff that matters.
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.