講演抄録/キーワード |
講演名 |
2017-03-09 11:50
Javaのメソッド等価性判定とその応用 ○岡野浩三(信州大)・原内 聡(三菱電機)・小形真平(信州大)・関澤俊弦(日大)・小原岳士(信州大) SS2016-65 |
抄録 |
(和) |
Java プログラムのクラスにおいてequals メソッドとhashCode メソッドをコード実装者が実装することが,しばしば生じる.その際,これらのメソッドについて幾つかの制約を満たすように記述する必要がある.それらの制約の中にはequals メソッドが等価と判断する2 つのオブジェクトについてはhashCode 値も同じでなくてはいけないというメソッド間にまたがる制約がある.このような制約を静的に検査する方法がすでに著者らの研究グループの先行研究等で提案されているが,以下のような課題点があった.1. メソッドにループ構造があってはいけない.2.
SAT/SMT の制約式に変換するため,変換が自明でない場合はツールの妥当性が担保しにくい.本原稿では上記の課題点を解決する別の手法を提案する.この手法はオープンソースの既存ツールであるSAWのメソッドの等価性判定機能を用いる方法であり,上記の課題を解決できるほか,メソッドの内部アルゴリズムの変更やクラスのフィールドの追加・削除等変更にともなう回帰テストの手間の削減を可能にする利点があることを併せて示す. |
(英) |
A programmer sometimes implements both of equals method and hashCode method in a class of Java. The programmer should obey the implementation rules for these methods. One of the rules is that two objects that meet equals method results have to have the same hashCode value. Some of studies including our previous work provide static analysis methods for checking the rules. Our previous work has some issues: (1) the target methods should have no loop structures; and (2) it transforms the methods into a set of SAT/SMT constraints, which is not easy to understand its validity. This report provides yet another solution for the issues. The new proposed method uses equivalence checking for methods/functions. The checking function is provided by SAW, a new tool developed as an open source software. We also state that the method is useful to reduce the cost of regression testing for refactoring of the methods and revise of fields of the class. |
キーワード |
(和) |
記号実行 / 関数等価性判定 / 定理証明 / equals method / hashCode method / / / |
(英) |
Symbolic Execution / Equivalence Checking / Theorem proover / equals method / hashCode method / / / |
文献情報 |
信学技報, vol. 116, no. 512, SS2016-65, pp. 31-36, 2017年3月. |
資料番号 |
SS2016-65 |
発行日 |
2017-03-02 (SS) |
ISSN |
Print edition: ISSN 0913-5685 Online edition: ISSN 2432-6380 |
著作権に ついて |
技術研究報告に掲載された論文の著作権は電子情報通信学会に帰属します.(許諾番号:10GA0019/12GB0052/13GB0056/17GB0034/18GB0034) |
PDFダウンロード |
SS2016-65 |