Skip to main content
QUICK REVIEW

[論文レビュー] On the Impact of Refactoring on the Relationship between Quality Attributes and Design Metrics

Mohamed Wiem Mkaouer, Eman Abdullah AlOmar|arXiv (Cornell University)|May 1, 2019
Software Engineering Research参考文献 59被引用数 76
ひとこと要約

本研究では、ソフトウェア開発者がコミットメッセージで報告する品質改善の意図が、リファクタリング後の構造的設計メトリクスの変化とどの程度一致するかを調査する。3,795のオープンソースJavaプロジェクトから抽出した1,245件のリファクタリングコミットを対象に、リファクタリング前の後でのメトリクス変化を分析した結果、開発者が図る結合度、結合度、複雑度の向上と一致するLCOB、CBO、CCといったメトリクスは顕著に改善された一方、NOCや設計サイズメトリクスは開発者の意図と顕著な一致を示さなかった。

ABSTRACT

Refactoring is a critical task in software maintenance and is generally performed to enforce the best design and implementation practices or to cope with design defects. Several studies attempted to detect refactoring activities through mining software repositories allowing to collect, analyze and get actionable data-driven insights about refactoring practices within software projects. Aim: We aim at identifying, among the various quality models presented in the literature, the ones that are more in-line with the developer’s vision of quality optimization, when they explicitly mention that they are refactoring to improve them. Method: We extract a large corpus of design-related refactoring activities that are applied and documented by developers during their daily changes from 3,795 curated open source Java projects. In particular, we extract a large-scale corpus of structural metrics and anti-pattern enhancement changes, from which we identify 1,245 quality improvement commits with their corresponding refactoring operations, as perceived by software engineers. Thereafter, we empirically analyze the impact of these refactoring operations on a set of common state-of-the-art design quality metrics. Results: The statistical analysis of the obtained results shows that (i) a few state-of-the-art metrics are more popular than others; and (ii) some metrics are being more emphasized than others. Conclusions: We verify that there are a variety of structural metrics that can represent the internal quality attributes with different degrees of improvement and degradation of software quality. Most of the metrics that are mapped to the main quality attributes do capture developer intentions of quality improvement reported in the commit messages, but for some quality attributes, they don’t.

研究の動機と目的

  • リファクタリングによる品質向上を意図する開発者の自己報告と最も一致する構造的設計メトリクスを特定すること。
  • 最新の設計メトリクスが、結合度、結合度、複雑度、継承といった品質属性の開発者による認識を的確に捉えられるかを実証的に評価すること。
  • 理論的な品質モデルと実際の開発者実践との間の乖離を解明すること。
  • 今後の研究に役立てるために、関連するメトリクス変化を伴うリファクタリングコミットの再現可能なデータセットを提供すること。

提案手法

  • GitHubから、良好に設計されたシステムに焦点を当てて、3,795件のキュレート済みのオープンソースJavaプロジェクトを収集した。
  • 品質向上の目標を明示するコミットメッセージを含む1,245件のコミットを特定した。
  • 最新のリファクタリングマイニングツール(例:Refactoring Miner)を適用し、これらのコミットからリファクタリング操作を検出し抽出した。
  • リファクタリング対象となったコード要素に限定し、内部的品質属性(例:結合度、複雑度)ごとにコミットをクラスタリングすることで、データセットを洗練させた。
  • 各コミットクラスタについて、27種類の構造的設計メトリクスのリファクタリング前後における値を計算した。
  • p値を用いた統計的分析により、メトリクス変化の有意性を評価し、開発者の意図を顕著に反映するメトリクスを同定した。

実験結果

リサーチクエスチョン

  • RQ1開発者が明示的に品質向上の目標を報告する際、どの構造的設計メトリクスがリファクタリングによって最も顕著に変化するか?
  • RQ2一般的に使用される設計メトリクスは、リファクタリング時の開発者の自己報告された意図とどの程度一致するか?
  • RQ3結合度、複雑度、継承などの特定の品質属性について、どのメトリクスも開発者の意図を顕著に反映しないことがあるか?
  • RQ4同じ品質属性(例:結合度)を測る複数のメトリクスは、開発者の改善認識をどの程度的確に捉えられるか?

主な発見

  • 開発者が結合度の向上を報告した際、LCOMは統計的に有意に改善された(p = 0.0346)ことから、開発者の意図と強い整合性があることが示された。
  • 結合度の向上を意図した際、CBOとFANOUTも有意に改善された(それぞれp = 0.0400およびp = 0.0456)ことから、これらが結合度を適切に表現していることが確認された。
  • 複雑度の向上を意図した際、CC、WMC、RFC、Evg、NPATH、MaxNestは顕著に改善された(p ≤ 0.0062)ことから、これらのメトリクスが関連性があることが確認された。
  • 継承に関しては、DITのみが有意に改善された(p = 0.0439)一方、NOCは逆に上昇した(p = 0.0208)ことから、開発者の認識とは一致しないことが示された。
  • カプセル化、抽象化、設計サイズ属性(例:LOC、CLOC、CDL)に関しては、顕著なメトリクス変化は観察されず、これらの属性について開発者の意図を信頼できるメトリクスで捉えられないことが示唆された。
  • WMCやRFCは多態性に関して顕著な変化が見られなかった(p > 0.5)ことから、開発者の報告された目標と整合性が低いことが示された。

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。