プログラム文の並べ替えに基づくソースコードの可読性向上の試み

情報処理学会 オープンアクセス

書誌事項

タイトル別名
  • An Approach to Improving Readability of Source Code Based on Reordering Program Statements

この論文をさがす

抄録

ソフトウェア保守を行うにあたって,最も時間的コストの高い作業はソースコードを読み理解することである.そのため,ソースコードの可読性を向上させることで,ソフトウェアの保守作業全体のコストを削減できる.既存研究として,ソースコードを読んで理解しようとする際,変数が定義されてから参照されるまでの距離が離れていると理解するためのコストが増大することが報告されている.したがって,文の並びはソースコードの可読性に影響を及ぼすと考えられる.本研究では,変数の定義と参照の間の距離に着目して,ソースコードの可読性を向上させるためのプログラム文並べ替え手法を提案する.提案手法をオープンソースソフトウェアに適用し,並べ替えの行われたメソッドについて被験者からの評価を得たところ,並べ替えの行われたメソッドは可読性が向上するという結果が得られた.

Understanding program source code is the most time-consuming task in software maintenance. If readability of source code becomes better, we spend less time to understand it. That means we can conduct more efficent software maintenance on source code whose readability is better. Previous research efforts reported that, if a program statement referencing a variable is far from another statement defining the variable, understanding the function that they implement becomes more time-consuming task. Those results indicate that the order of program statements has an impact on readability of source code. In this paper, we propose a technique to reorder program statements for improving readability of source code. The proposed method uses distances between definitions and references of variables in source code to find reordering opportunities. We have conducted an experiment on Java open source software with 44 subjects, and confirmed that most of reordered methods had better readability than its original ones.

収録刊行物

関連プロジェクト

もっと見る

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

  • CRID
    1050845762834554368
  • NII論文ID
    110009665003
  • NII書誌ID
    AN00116647
  • ISSN
    18827764
  • Web Site
    http://id.nii.ac.jp/1001/00098491/
  • 本文言語コード
    ja
  • 資料種別
    journal article
  • データソース種別
    • IRDB
    • CiNii Articles
    • KAKEN

問題の指摘

ページトップへ