39 ms·
I wonder if a similar approach could be used to help discover common programming errors and their solutions, i.e. data mine bug hindsight. It would work someth
by adrianmonk 8y ago
I wonder if a similar approach could be used to help discover common programming errors and their solutions, i.e. data mine bug hindsight.
It would work something like:
1. Go through a repo's history and look at commits.
2. Using text classification of commit messages and/or cross-referencing with a bug tracker database (and limiting to issues that are really defects, not feature requests), identify commits that fix bugs.
3. Now you have before and after code. Try to discover the salient part of what changed, perhaps by parsing them both and comparing ASTs, or by diffing the text. Or run the unit test (that you added with the fix) through the old code and the new code while tracing execution to see differences in the dynamic behavior of the code.
4. Correlate this with descriptions of what the method is trying to do.
Perhaps you might be able to generate statements like "when fixing bugs related to create a daemon, programmers often add calls to close() or add calls to umask()".