Software Engineering Laboratory Department of Computer Science Graduate
ソフトウェア 学サマースクール(3) ソフトウェア 学の新潮流(1) リポジトリマイニング 松下誠 大阪大学 Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
今日の話題 • • リポジトリマイニング データマイニングの例 マイニングのための要素技術 MSR(Mining Software Repositories) SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 2 2009/09/09
データマイニングの例 Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
マイニング対象データを集める • 過去の貸出状況とその結果から将来を予想 – 顧客の年収 – 貸した金額 返済された 焦げ付いた 貸出額 年収 SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 6 2009/09/09
マイニングのための要素技術 協調フィルタリング Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
協調フィルタリングを用いた ソフトウェア部品の推薦 Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
SPARS-J • Javaソフトウェア部品検索シ ステム – Javaのクラスを部品とし, キーワード入力により検索 – パッケージブラウザ – 利用関係の表示 SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 20 2009/09/09
履歴の取得 ユーザ Webブラウザ 部品データベース 閲覧履歴 部品 セッションの追加 履歴の記録 セ ッ シ ョ ン 1 : 表示済 2 3 4 5 6 7 a b c d e SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 23 2009/09/09
SPARS-Jへの実装 セッション中で表示した部品 推薦部品(Zip. Entryとの利用関係別) 推薦部品 SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 25 2009/09/09
public class Image. Converter { /** public static void main(String[] args) { * 拡張子に応じた形式でイメージを読み込む // 入力ファイル: data/a. gif * @param file 読み込み元 ファイル File in. File = new File("data", "a. gif"); • 目的 * @param suffix 拡張子 String in. File. Suffix = "gif"; –*/ 推薦機能が検索効率の改善に役立つかど 部品の検索・取得 // 出力ファイル: data/b. png うか検証する public Buffered. Image read. Image(File file, String suffix) throws IOException { File out. File = new File("data", "b. png"); Buffered. Image image = null; • 内容 被験者 String out. File. Suffix = "png"; ここにコードを書いて下さい – //SPARS-Jを利用してのJavaプログラム作 Image. Converter image. Converter = new Image. Converter(); return image; 成 try { • スケルトンコードの未実装部分の記述 } Buffered. Image image = image. Converter. read. Image(in. File, in. File. Suffix); • SPARS-Jで検索したソースコードを参考に if (image != null) { /** • 練習課題および,課題1~課題4 の 5課題 // ビューアで確認 * 拡張子に応じた形式でイメージを保存する • 被験者 new Viewer(image); image 保存する画像 –* @param 井上研究室の学生・研究員 8名 image. Converter. write. Image(image, out. File. Suffix); file 書きだし先 ファイル –* @param 4名ずつの 2グループに分け,比較 } else { */ • SPARS-J データベース System. out. println("Image is null"); public void write. Image(Buffered. Image image, File file, String suffix) throws IOException { } – JDK,Web上から収集したソースなど約 //35, 000 ここにコードを書いて下さい } catch クラス (Exception e) { –} 履歴データベースは空の状態から開始 e. print. Stack. Trace(); } } 参照してコード記述 2009/09/09 SES 2009 } 適用実験の概要(1/2) Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 26
マイニングのための要素技術 潜在意味解析(LSA) Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
LSA の例 文書 1 A B B F 文書 2 A B C D E 文書 3 B C C C D 文書 4 A G G 文書ベクトル G H H 文書 6 B C D E G H F 1 1 2 0 0 0 1 0 0 2 1 1 1 0 0 0 3 0 1 3 1 0 0 単語頻度行列を 4 作成 0 0 0 2 0 5 0 0 0 1 1 2 6 0 0 1 0 1 1 文書 5 F 単語ベクトル E G H LSA A B C D E F G H 1 0. 3 0. 7 0. 9 0. 4 0. 3 0. 2 0. 3 2 0. 4 1. 0 1. 4 0. 6 0. 3 0. 2 0. 1 3 0. 6 1. 5 2. 3 1. 0 0. 4 0. 2 -0. 2 4 0. 1 -0. 2 0. 0 0. 2 0. 4 0. 9 5 0. 1 0. 2 -0. 2 0. 0 0. 4 0. 6 1. 5 1. 4 6 0. 1 0. 2 -0. 1 0. 0 0. 3 0. 4 1. 0 0. 9 SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 31 2009/09/09
LSA の効果 A B C D E G H F A B C D E F G H 1 1 2 0 0 0 1 0. 3 0. 7 0. 9 0. 4 0. 3 0. 2 0. 3 2 1 1 1 0 0 0 2 0. 4 1. 0 1. 4 0. 6 0. 3 0. 2 0. 1 3 0 1 3 1 0 0 3 0. 6 1. 5 2. 3 1. 0 0. 4 0. 2 -0. 2 4 0 0 0 2 0 4 0. 1 -0. 2 0. 0 0. 2 0. 4 0. 9 5 0 0 0 1 1 2 5 0. 1 0. 2 -0. 2 0. 0 0. 4 0. 6 1. 5 1. 4 6 0 0 1 0 1 1 6 0. 1 0. 2 -0. 1 0. 0 0. 3 0. 4 1. 0 0. 9 LSA 類似度計算 1 2 3 4 5 6 1 1. 0 0. 2 -0. 1 -0. 3 -0. 5 2 0. 2 1. 0 0. 5 -0. 9 -0. 5 3 -0. 1 0. 5 1. 0 -0. 2 -0. 4 -0. 5 4 -0. 3 -0. 5 -0. 2 1. 0 0. 3 5 -0. 3 -0. 9 -0. 4 0. 3 6 -0. 5 類似度計算 1 2 3 4 5 6 1 1. 0 0. 9 -0. 6 -0. 5 2 1. 0 -0. 8 -0. 7 3 0. 9 1. 0 -0. 8 0. 5 4 -0. 6 -0. 8 1. 0 0. 5 5 -0. 6 -0. 8 1. 0 0. 5 1. 0 6 -0. 5 -0. 7 -0. 8 1. 0 341. 0 LSAにより,似た 文書がはっきり わかるように SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 2009/09/09
LSAを用いた ソフトウェア類似度測定 Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
MUDABlueの構成 MUDABlue Soft 1 Soft 4 Soft 2 Soft 5 Soft 3 Soft 6 Categorization System Parser Matrix generator Ourlier remover LSA program Cluster analysis program Software cluster generator Category title generator RDB converter Soft 1 Soft 2 Soft 3 Category. Title 1 Soft 4 Soft 5 Soft 6 Category. Title 2 User Interface System Web Browser Keyword searche Category hierarchy view UCM view Detailed information display SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University DBMS (Postgre. SQL) 37 2009/09/09
MUDABlue動作例(1/3) SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 38 2009/09/09
MUDABlue動作例(2/3) SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 39 2009/09/09
MUDABlue動作例(3/3) SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 40 2009/09/09
MSRの紹介 (Mining Software Repositories) Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
MSR: Mining Software Repositories • • http: //www. msrconf. org/ ICSE併設のworkshop/working conference 2004年より毎年開催、今年で 6回目 多彩なプログラム構成 – Keynoteおよび論文発表 – ポスター発表・デモンストレーション – MSR Challenge SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 43 2009/09/09
MSR Challenge • • MSR 2006から毎年開催 共通の題材に対し各自の分析手法を適用 手法の比較や限界を探る 過去の例題 – GNOME, Eclipseの履歴を対象としたマイニング – GNOMEアプリケーションの増加行数を予想 – Eclipseのパッケージに発生したバグの数を予想 SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 44 2009/09/09
MSR 2009 Challengeから • GNOME開発履歴を対象としたマイニング – 開発者の分散度合いとファイルサイズの比較 – 変更要求とプロセス品質の比較 – Bugzilla登録データの品質推定 – 開発履歴の可視化 – GTK+開発者が行うIRC会議の推移 SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 45 2009/09/09
まとめ • データマイニングとは • マイニング手法とリポジトリへの応用 • 国際会議MSRの紹介 SES 2009 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 46 2009/09/09
- Slides: 46