Publication Type
Journal Article
Version
publishedVersion
Publication Date
3-2026
Abstract
Distribution shift poses a significant challenge for deep learning (DL) models in source code analysis, where test data often follows different distributions from training data, leading to unexpected performance degradation and hindering the practical usage of code models. While our previous work CodeS introduced the first benchmark for studying distribution shift in source code analysis, it has limitations in covering more fine-grained types of real-world distribution shifts and lacks the study of the effectiveness of shift mitigation strategies. In this paper, we present CodeS+, an enhanced benchmark that addresses these limitations through two key contributions, (1) expanded shift types, we design more fine-grained distribution shift types, that is, shift introduced by different program element complexity (e.g., different node number of control flow graphs), and (2) investigate the usefulness of fine-tuning based shift mitigation techniques, such as Core-Set. Comprehensive experiments on different pre-trained code models demonstrated that code models significantly suffer from distribution shift, out-of-distribution detectors from other domains (e.g., computer vision) do not generalize to source code, and existing fine-tuning based shift mitigation techniques have limited benefits in enhancing the generalization ability of code models. Our findings highlight the need to pay more attention to OOD issues for code models.
Keywords
Source code learning, distribution shift, out-ofdistribution detection, model generalization
Discipline
Artificial Intelligence and Robotics | Software Engineering
Research Areas
Intelligent Systems and Optimization
Areas of Excellence
Digital transformation
Publication
IEEE Transactions on Software Engineering
Volume
52
Issue
4
First Page
1515
Last Page
1530
ISSN
0098-5589
Identifier
10.1109/TSE.2026.3668096
Publisher
Institute of Electrical and Electronics Engineers
Citation
SHI, Ziyue; WANG, Junjie; GUO, Yuejun; XIE, Xiaofei; HU, Qiang; CORDY, Maxime; CHEN, Sen; PAPADAKIS, Mike; LE TRAON, Yves; and LYU, Yongqiang.
CodeS+: Towards assessing the generalization ability of code models under distribution shift. (2026). IEEE Transactions on Software Engineering. 52, (4), 1515-1530.
Available at: https://ink.library.smu.edu.sg/sis_research/11450
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 International License.
Additional URL
https://doi.org/10.1109/TSE.2026.3668096