Neural Change Prediction: Relating Software Changes to Their Effects and Vice Versa
This work addresses the challenge of predicting software change semantics without execution, offering a fully automatic technique for tasks like feature localization and effect prediction in software engineering.
Neural Change Prediction learns associations between code changes and their behavioral effects using mutation-based training, enabling prediction of required changes for desired behavior and prediction of behavioral effects of given changes. Evaluations on CSS and Python programs demonstrate generality and automatic applicability without prior code knowledge.
Much of software development revolves around understanding the relationship between software changes and their effects. If we could learn and predict those relationships, such predictions could benefit several areas of software engineering. While recent advances in artificial intelligence have shown great promise in software engineering tasks, predicting the semantics of code without executing it remains a big challenge. In this paper, we present Neural Change Prediction, a novel and fundamental technique to learn and predict associations between software changes and their dynamic effects on program behavior. Specifically, for a given program and test inputs, we automatically apply numerous mutations to the code and observe how these changes alter the program's output. From these (changes to software, changes in behavior)-pairs, we create models that: (1) for a desired change in behavior, predict where and how the code should be changed (feature localization, software evolution, and software repair); and (2) for a given code change, predict how this code change affects the output (effect prediction). We have conducted a detailed case study on CSS configuration files and an evaluation on Python programs to demonstrate the generality and wide applicability of Neural Change Prediction. While Neural Change Prediction requires numerous mutations (and thus numerous executions of the program under test), Neural Change Prediction is fully automatic and does not require any prior knowledge of the code or its semantics, making it applicable to any software artifact that can be executed and whose output can be observed.