コードクローンの自動集約に基づく削減可能なソースコード行数の測定

書誌事項

タイトル別名
  • Measurement Reducible Lines of Code Based on Automated Merging Code Clones

この論文をさがす

抄録

コードクローン(以下,クローン)とは,ソースコード中に存在する互いに一致または類似しているコード片を指す.クローンはソフトウェア保守を困難にする要因の1つとして知られている.リファクタリングを行い,クローンを1つのメソッドやクラスなどのモジュールに集約することにより保守が容易になる.しかし,リファクタリングは正常に稼働しているソースコードに手を加える作業であり,またリファクタリングによりかえってバグが混入する可能性がある.そのため,リファクタリングを行う動機となる指標が必要となる.クローンのリファクタリングによる削減可能な行数がその指標として用いられる.既存研究では,クローンの情報や行数の解析に基づいて削減可能なソースコード行数を推定する手法を提案している.しかし,削減行数の推定にとどまっているため,リファクタリングにより実際に削減される行数とは乖離が存在する場合があるのではないかと著者らは考えた.そこで本研究では,削減可能なソースコード行数をより正確に推定する手法を提案する.提案手法では,クローンの検出,集約,ソースコードのコンパイル,テストを繰り返し自動で行い,削減行数を測定する.また,提案手法をJavaプロジェクトに対して適用し,既存手法との比較を行った.その結果,既存手法と比較してより正確にソースコードの削減行数を測定できた.

A code clone (in short, clone) is a code fragment that is identical or similar to other code fragments in source code. The presence of clones is known as one of the factors that make the software maintenance difficult. Refactoring clones, merging clones as a module such as a method or class, makes the software maintenance more manageable. However, refactoring is modifying source code of which software working regularly and, in some cases, introduces a new bug. Thus, developers need criteria for refactoring. Lines of code (in short, LoC) that can be reduced by refactoring clones is used as the criterion. The existing study proposed a technique to estimate reducible LoC based on analyzing the information and the amount of source code of clones. However, we think that reducible LoC that the existing technique estimates is different from actual value because the existing technique only estimates. Consequently, in this research, we propose a new technique to calculate reducible LoC more accurately. The proposed technique performs a loop processing of detecting clones, merging them, compiling the edited source files, and testing them. After finishing the loop, reducible LoC is calculated from the edited source files. This paper also includes comparison results of the proposed technique and the existing one. As a result, we confirmed that the proposed technique was able to calculate more accurate reducible LoC than the existing technique.

収録刊行物

詳細情報 詳細情報について

問題の指摘

ページトップへ