Java Refactoring Browser

「オブジェクト指向ソフトウェア向けリファクタリングツールの開発」
"A Tool Support for Refactoring Object-Oriented Software"


本研究は,情報処理振興事業協会(IPA)の委託により 財団法人ソフトウェア工学研究財団(RISE)が実施した 平成13年度「高度情報化支援ソフトウェアシーズ育成事業」での支援を受けて行われました.

本研究成果(ソフトウェア,ドキュメント)に対する知的所有権は情報処理振興事業協会(IPA) および立命館大学理工学部情報学科ソフトウェア基礎技術研究室(丸山研究室)の共有となっています.


和文概要

オブジェクト指向プログラムの有するカプセル化,継承,多相性などの特徴は,ソフトウェアの再利用性や保守性を向上させるといわれている. しかしながら,オブジェクト指向に基づき,これらの特徴を十分に生かしたソフトウェアを設計することは難しい. また,たとえソフトウェアが初期段階においてうまく設計されていたとしても,ソフトウェア自体の保守や改良により設計が劣化し, 再利用性や保守性が低下することがある.このような状況に対して,リファクタリングが有効である. リファクタリングとは,ソフトウェアの外部から見た挙動(振る舞い)を保存したまま,内部の構造だけを改良し,その設計を向上させる作業を指す. しかしながら,リファクタリング操作は一般的に煩雑であり,手動で行う際には変換時に誤りが混入しやすい. 特に,リファクタリングの適用に関しては,対象ソースコードに対して多くの前提条件を検査すること, および,変換後のソースコードが影響を及ぼす箇所を特定することが非常に面倒であり,実際の開発現場では有用性が認められているにもかかわらず, 敬遠されることが多い.

本研究開発では,オブジェクト指向プログラムに対する制御フロー解析と依存解析を導入することにより, リファクタリング操作の自動化を達成する.これにより,従来手動で行ってきた前提条件の検査や変更影響範囲の特定を含めたテストから, プログラマを解放することができる. 本論文では,プログラム解析に基づくリファクタリングの自動化手法, および,その手法を実装したリファクタリング支援ツールの機能および適用例を示す. 実装したツールは,ソースコードに対する編集作業と並行してメニューから簡単にリファクタリング操作が実行できるように設計されており, ソフトウェア開発におけるリファクタリングの効果を十分実感できるようになっている. また,本ツールには,プログラマの過去のリファクタリング操作を履歴として蓄積し,プログラマの現在の操作に応じて随時検索を行うことで, 次に行うべき操作を提案する仕組みが組み込まれている. ソフトウェアの改善は一般的に難しい作業であるため,リファクタリング操作の自動化および次操作の提案は, ソフトウェア開発支援という観点から意義は大きい. 本ツールを用いた評価実験の結果,手動で行うリファクタリングに比べて,利用者の負担, 特に変換前の前提条件の検査およびソースコード書き換えの負担を,大幅に削減できることが確認できた. 今後は,本ツールの有用性を評価するためにさまざまなソースコードを用いて数多くの実験を行う予定である.

Abstract

Object-oriented programming with encapsulation, inheritance, and polymorphism has potential for improving software reusability and maintainability, but designing reusable and understandable object-oriented software is hard. Even if software is well designed initially, maintenance and extension will tend to cause its design to deteriorate. Refactoring is the essential and useful process since it improves the internal structure of existing source-code without changing its external behavior. However, it is complex to do by hand. Moreover, the manual refactoring requires programmers to make many checks. For example, does the target source-code satisfy the preconditions for transformation that the programmer wants? Which fragments of source-code will be affected by the fragments that he/she modifies in refactoring? The refactoring with such checks is not easy in general; it is error-prone and time-consuming.

The tool we have developed automates the transformation in refactoring by using data- and control-flow analysis (and dependency analysis) for object-oriented software. With this tool, programmers do not have to test the changed source-code since the tool guarantees the target source-code to preserve its behavior. This paper describes a method that automates the tests and transformations in refactoring and the tool implementing the method, and gives the examples and experimental results of refactoring using the tool. The tool was designed to easily execute refactorings that programmers want in course of editing the source-code. In addition, the tool records the history of refactoring in the past, which is a sequence of refactoring names, and aggressively uses the history to propose the next refactoring to be done. Experimental results show that the automated refactoring and the guidance using refactoring history are effective in object-oriented software development. A large number of experiments with various source-codes for assessing the utility of the tool will be tackled.


プログラムのダウンロード

JRB v1.0


ドキュメント

PDFファイルをZIP形式で圧縮しています.
連絡先
丸山 勝久
立命館大学 理工学部 情報学科
ソフトウェア基礎技術研究室 (丸山研究室)
525-8577 滋賀県草津市野路東1-1-1
Tel: 077-561-4986 Fax: 077-561-2669
E-mail: maru@cs.ritsumei.ac.jp