Technical Meeting

ソースコード置換・変換の実施頻度の調査

An Investigation into the Frequency and Consequences of Code Replacement and Conversion

デッカー マイケル ジョン, 林 晋平

Michael J. Decker, Shinpei Hayashi

電子情報通信学会技術研究報告, vol. 125, no. 115, pp. 73–78, 札幌市教育文化会館, 北海道, July 2025.

Abstract

ソースコードの置換・変換の実施頻度に関する実証的調査について報告する.開発者はコードを書く際に,既存のコードを置換したり,while文からfor文など,特定種類の文を別種の文に変換したりする.本稿では,50のオープンソースソフトウェアを対象に,このようなコードの置換・変換がどの程度行われているか,またそれらがどのような影響を及ぼすかを調査した.その結果,式や文レベルにおける置換は高頻度で起こり,文の種類の変換も稀ではないことが明らかとなった.このような高頻度の置換や一定頻度の変換は,構文木編集距離に基づく差分抽出手法にとって問題となり得るものであり,明示的な検出のサポートが求められる.

Abstract (English)

An investigation into code replacement and conversion is presented. When writing code, developers may rewrite code either by replacing code that already exists or by converting code from one type of statement to another, such as a while-statement to a for-statement. We present an empirical investigation of 50 open-source software systems into how often code replacement and conversion occur, as well as, the consequences of such actions. Results show that replacements are a very common activity at the expression and statement level and conversions are not uncommon. The frequency at which replacements occur is problematic for tree edit-distance-based syntactical differencers, and conversions are frequent enough that syntactical differencers should consider supporting their explicit detection.

BibTeX

@article{decker-sigss202507,
    author = {デッカー マイケル ジョン and 林 晋平},
    title = {ソースコード置換・変換の実施頻度の調査},
    journal = {電子情報通信学会技術研究報告},
    volume = 125,
    number = 115,
    pages = {73--78},
    year = 2025,
}
Type
Technical Meeting
Location
札幌市教育文化会館, 北海道
Presented
July 16, 2025
Volume / Pages
vol. 125, no. 115, pp. 73–78