- Main
Does Surprisal Predict Code Comprehension Difficulty?
Abstract
Recognition of the similarities between programming and nat-ural languages has led to a boom in the adoption of languagemodeling techniques in tools that assist developers. However,language model surprisal, which guides the training and eval-uation in many of these methods, has not been validated asa measure of cognitive difficulty for programming languagecomprehension as it has for natural language. We perform acontrolled experiment to evaluate human comprehension onfragments of source code that are meaning-equivalent but withdifferent surprisal. We find that more surprising versions ofcode take humans longer to finish answering correctly. Wealso provide practical guidelines to design future studies forcode comprehension and surprisal.
Main Content
Enter the password to open this PDF file:
-
-
-
-
-
-
-
-
-
-
-
-
-
-