3 ms·
I wonder how much of this can be applied to code - to fix bugs, for example.
by andreyf 18y ago
I wonder how much of this can be applied to code - to fix bugs, for example.
- jimbokun 18y agoIf you have a training corpus that consists of code with bugs and the same code with the bug fixed, I imagine you can get rather far. The biggest challenge with any statistical or machine learning techniques is getting a good data set. If all you have is a lot of code but the code with bugs in it is not annotated, then you need unsupervised techniques which require better algorithms and more data (as I understand it).
- alextp 18y agoWell, you probably sort-of can do that with open source projects that integrate version control and bug tracking. In these repositories you will find lots of commits names "Fixes #42". The problem, I think, is that making a statistical n-gram model of a programming language doesn't look like it can produce encouraging results (think locally balanced-like, but globally unbalanced parenthesis, which should pop up often in ngrams for parentheses more than n tokens apart). The upper side is that you can get a tokenizer "for free" using the language's own grammar.
- jibiki 18y agoMaybe what you want is not a Markov model, but a stochastic context-free grammar: http://en.wikipedia.org/wiki/Stochastic_context-free_grammar http://en.wikipedia.org/wiki/Stochastic_context-free_grammar
- jhy 18y agoWhat about using a combination of revision control and unit-tests? A given unit test serves as the annotation for a static piece of functionality. The evolution of the code behind the unit-test shows the pre-bug (French) and post-bug (English) states. A little harebrained perhaps, but there are a lot of open source projects with a long history behind them; maybe there are a few viable candidates to test this on.