Dependency-Aware Code Naturalness

被引:0
|
作者
Yang, Chen [1 ]
Chen, Junjie [1 ]
Jiang, Jiajun [1 ]
Huang, Yuliang [1 ]
机构
[1] College of Intelligence and Computing, Tianjin University, Tianjin, China
关键词
D O I
10.1145/3689794
中图分类号
学科分类号
摘要
Code naturalness, which captures repetitiveness and predictability in programming languages, has proven valuable for various code-related tasks in software engineering. However, precisely measuring code naturalness remains a fundamental challenge. Existing methods measure code naturalness over individual lines of code while ignoring the deep semantic relations among different lines, e.g., program dependency, which may negatively affect the precision of the measure. Despite the intuitive appeal of extending the code naturalness measure to the code dependency domain (as there are some work that have initiated the utilization of code dependency for diverse code-related tasks), this assumption remains unexplored and warrants direct investigation. In this study, we aim to perform the first empirical study to investigate whether incorporating code dependency, instead of analyzing individual lines, can enhance the precision of measuring code naturalness. To achieve that, we first propose a new method named DAN for measuring code naturalness by incorporating the rich dependency information in the code. Specifically, DAN extracts multiple sequences of code lines by traversing the program dependency graph, where different code lines are connected by dependencies in each sequence, and then the code naturalness will be measured by taking each sequence as a whole. In this way, the dependency information can be well captured. Finally, we have conducted an extensive study to evaluate the influence of code dependency for measuring code naturalness with DAN, and compared it with the state-of-the-art methods under three emerging application scenarios of code naturalness. The results demonstrate that DAN can not only better distinguish natural and unnatural code, but also substantially boost two important downstream applications of code naturalness, i.e., distinguishing buggy and non-buggy code lines and data cleansing for training better code models, reflecting the significance of code dependency in measuring code naturalness. © 2024 Owner/Author.
引用
收藏
相关论文
共 50 条
  • [21] LCRC: A Dependency-aware Cache Management Policy for Spark
    Wang, Bo
    Tang, Jie
    Zhang, Rui
    Ding, Wei
    Qi, Deyu
    2018 IEEE INT CONF ON PARALLEL & DISTRIBUTED PROCESSING WITH APPLICATIONS, UBIQUITOUS COMPUTING & COMMUNICATIONS, BIG DATA & CLOUD COMPUTING, SOCIAL COMPUTING & NETWORKING, SUSTAINABLE COMPUTING & COMMUNICATIONS, 2018, : 956 - 963
  • [22] Toward Dependency-Aware Live Virtual Machine Migration
    Nocentino, Anthony
    Ruth, Paul M.
    THIRD INTERNATIONAL WORKSHOP ON VIRTUALIZATION TECHNOLOGIES IN DISTRIBUTED COMPUTING (VTDC-09), 2009, : 59 - 66
  • [23] Web service in context and dependency-aware service composition
    Zhou, Jiehan
    Niemela, Eila
    Perala, Juho
    Pakkala, Daniel
    2ND IEEE ASIA-PACIFIC SERVICES COMPUTING CONFERENCE, PROCEEDINGS, 2007, : 349 - 355
  • [24] Dependency-Aware Core Column Discovery for Table Understanding
    Qiu, Jingyi
    Song, Aibo
    Jin, Jiahui
    Zhang, Tianbo
    Ding, Jingyi
    Fang, Xiaolin
    Qian, Jianguo
    SEMANTIC WEB, ISWC 2023, PART I, 2023, 14265 : 159 - 178
  • [25] Dependency-Aware Task Scheduling in Vehicular Edge Computing
    Liu, Yujiong
    Wang, Shangguang
    Zhao, Qinglin
    Du, Shiyu
    Zhou, Ao
    Ma, Xiao
    Yang, Fangchun
    IEEE INTERNET OF THINGS JOURNAL, 2020, 7 (06) : 4961 - 4971
  • [26] Dependency-aware stochastic analysis of chained execution times
    Ivers, M.
    Ernst, R.
    2009 IEEE INTERNATIONAL SYMPOSIUM ON INDUSTRIAL EMBEDDED SYSTEMS, 2009, : 70 - 73
  • [27] A Dependency-Aware QoS System for Mobile Satellite Communication
    Brueckner, Markus
    Driess, Philipp
    Osdoba, Manuel
    Mitschele-Thiel, Andreas
    2016 IEEE WIRELESS COMMUNICATIONS AND NETWORKING CONFERENCE, 2016,
  • [28] Dependency-Aware Parallel Routing for Large-Scale FPGAs
    Shen, Minghua
    Xiao, Nong
    Luo, Guojie
    2017 IEEE 35TH INTERNATIONAL CONFERENCE ON COMPUTER DESIGN (ICCD), 2017, : 249 - 256
  • [29] DeTTO: Dependency-Aware Trustworthy Task Offloading in Vehicular IoT
    Dass, Prajnamaya
    Misra, Sudip
    IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, 2022, 23 (12) : 24369 - 24378
  • [30] Jasmine: Exploring the Dependency-Aware Execution on Distributed Shared Memory
    Wei, Xing
    Hu, Huiqi
    Zhou, Xuan
    Qi, Xuecheng
    Qian, Weining
    Wang, Jiang
    Zhou, Aoying
    PROCEEDINGS OF THE 30TH ACM INTERNATIONAL CONFERENCE ON INFORMATION & KNOWLEDGE MANAGEMENT, CIKM 2021, 2021, : 4804 - 4807