1 - Software Engineering Laboratory

Download Report

Transcript 1 - Software Engineering Laboratory

オープンソースソフトウェアにおける
ソフトウェアライセンス間の
包含関係
眞鍋雄貴,井上克郎
大阪大学大学院情報科学研究科
2013/1/11 SIGSS
1
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ソフトウェアの再利用
• 既存のソフトウェアのライブラリ,ソースファイル,ク
ラス,関数などを新たなソフトウェアの開発に利用す
ること.
• ソフトウェアの生産性や品質の向上を目的とする.
• ウェブ上に多数のライブラリやソースファイルが公開
されている.
2013/1/11 SIGSS
2
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ソフトウェアライセンス(ライセンス)
• 著作者が定めた,利用に関する許諾と許諾を得るた
めの要求や義務
– 利用:複製,改変,再配布
(例)GNU General Public license version 3(GPLv3),
BSD4項ライセンス(BSD4)など
– ライセンスによって要求や義務が異なるため,利
用範囲が異なる.
• オープンソースソフトウェアの場合,指定されている
ライセンスに従えば利用することができる.
2013/1/11 SIGSS
3
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ライセンスの選択問題
• ライセンスの異なる複数のライブラリやソースファイルを
利用したとき,そのソフトウェアのライセンスは何にすべ
きか.
• 制約:各ライブラリやソースファイルのライセンスを満た
さないといけない.
ソフトウェア
ライブラリ
リンク
他プロジェクトから
再利用した
ソースファイル
再利用
自分で開発した
ソースファイル
このソフトウェアの
ライセンスは
何にすれば
License A,B,C,Dを満たせるか.
License B
リンク
License C
License A
2013/1/11 SIGSS
License D
4
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
課題
• 開発者にとって,各ライセンスを理解し,それを満たせる
ライセンスを選択することは手間が大きい.
• ライセンスの種類が多いこと
– Open Source Initiativeが承認しているオープンソース
ライセンスは69種(2012/11/17現在)
– BlackDuck Knowledgebaseでは2200種以上としてい
る.
• ライセンスが契約文書であること
– 開発者にとっては読みにくい.
2013/1/11 SIGSS
5
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
既存のソフトウェアの例
Scacchiら[5]によるGoogle Chromeの調査
– 27種の外部コンポーネント
bsddiff, ffmpeg, HarfBuzz, hunspell, Skia…
– 14種類の異なるライセンス
BSD Protection License, LGPL, MIT License,
MPL 1.1 or GPL 2.0 or LGPL, Apache License
2.0…
[5]W. Scacchi and T.A. Alspaugh, “Understanding the role
of licenses and evolution in open architecture software
ecosystems,” Journal of Systems and Software, vol.85, no.7, pp.1479–1494, 2012.
2013/1/11 SIGSS
6
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ライセンスの不整合に関する既存研
究
• Alspaughら[9]
ライセンスの各条項を<actor, modality, action, object,
license>のタプルで表現し,権利や義務の衝突を計算す
る.
• Danielら[4]
ライセンスの不整合が生じたときの対処をライセンス統
合パターンとして整理した.
代替となるライセンスを見つけるのは難しい
⇒不整合が生じないライセンスを見つけられるようにしたい.
[4]D.M. German and A.E. Hassan, “License integration patterns: Addressing license mismatches in component-based
development,” Proceedings of 31st International Conference on Software Engineering, pp.188–198, 2009.
[9]T.A. Alspaugh, H.U. Asuncion, and W. Scacchi, “Intellectual property rights requirements for heterogeneously licensed
systems,” Proceedings of 17th IEEE International Requirements Engineering Conference, pp.24–33, Sept. 2009.
2013/1/11 SIGSS
7
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ライセンス間の包含関係
あるライセンスで配布されている成果物を別のライセン
スで配布できるとき,それらのライセンス間にある関係
License A の元で許
可される範囲
License Cの下で
許可される範囲
2013/1/11 SIGSS
License A ⊇ License C
8
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
包含関係のグラフ
LicenseA
License A ⊇ License B
License A ⊇ License C
License C ⊇ License D
LicenseB
ノード:ライセンス
辺:包含関係
LicenseC
LicenseD
包含関係をたどることで,矛盾の起きないライセンスを選
択できる.
(例)LicenseCの成果物はLicenseDで配布できる.
2013/1/11 SIGSS
9
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
アプローチ
開発者によるライセンス選択を支援する
• オープンソースソフトウェアにおけるライセンス間の包
含関係を調査する.
• 既存のオープンソフトウェアにおけるソースファイルと
ソースパッケージの関係に着目する.
2013/1/11 SIGSS
10
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ソースパッケージと包含関係
• 管理され,インストール方法が提供されている,ソース
ファイル集合やパッケージ情報のドキュメント等を含む
ファイル.
• ソースパッケージにもライセンスが設定される.
ソースファイルはソースパッケージとしてそのライセンスの下で
配布されている
ソースファイルの
ライセンス
2013/1/11 SIGSS
⊇
ソースパッケージの
ライセンス
11
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Empirical Study
目的:オープンソースソフトウェアにおけるソフトウェア
ライセンス間の包含関係と,再利用への適用可能性を
調べる
リサーチクエスチョン
RQ1:既存のソフトウェアから得られるライセンス間
の包含関係はどの様なものであるか.
RQ2:得られた包含関係から,ライセンス間の矛盾
が起きうることを確認できるか
2013/1/11 SIGSS
12
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
実験対象
Fedora 17のソースパッケージ (.src.rpm)2132個
SPECファイルとソースファイル集合(tar.gz)から構
成されている.
SPECファイルの例(traceroute.spec)
Summary: Traces the route taken by packets over an IPv4/IPv6 network
Name: traceroute
Epoch: 3
Version: 2.0.18
Release: 3%{?dist}
Group: Applications/Internet
パッケージのライセンス
License: GPLv2+
URL: http://traceroute.sourceforge.net
:
2013/1/11 SIGSS
13
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
包含関係の抽出手順
パッケージ群
解凍
ソース
ファイル
各ソース
ファイルの
ライセンス名
包含関係
の作成
フィルタ
リング
ライセンスの
特定
ライセンスの
包含関係
SPECファイル
ライセンスの
包含関係
パッケージの
ライセンス名
ライセンス名の対応表
2013/1/11 SIGSS
14
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ライセンスの特定
• ソースファイル
– Ninka[12]を用いてライセンスを特定する.
• パッケージ
– 各パッケージのSPECファイルを参照する.
ライセンス名
#Package
ライセンス名
#File
GPLv2+
334
EPLv1
39916
LibraryGPLv2+
199
GPLv2+
35097
GPLv2
89
GPLv3+
29813
BSD3
65
Apachev2
24549
MITX11noNotice
61
LesserGPLv2.1+
20677
2013/1/11 SIGSS
[12]D. M. German et.al. A sentence-matching method for
automatic license identification of source code files. In Proc. ASE
2010, 2010.
15
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Ninka
ソースファイルのライセンスを自動的に特定する
– 112種類のライセンス
– 適合率: 96.6%
ソースファイル
ルールマッチ
ライセンス名
2013/1/11 SIGSS
ライセンス
知識
BSDcondSource:Redistribution
s? of source code must retain
the (above )?copyright notice,
this list of conditions(,)? and
the following disclaimer(,
without modification)?:
…
BSD2:BSDPre, BSDcondSource,
BSDcondBinary, BSDasIs,
BSDWarr
16
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
包含関係の作成
• ソースファイルのライセンス⊇ソースパッケージのライセ
ンスとして包含関係を作成する.
– 包含関係を簡単にするため,どちらのライセンスにつ
いても一種類だけ特定されている場合だけ包含関係
を作る.
• パッケージのライセンスはライセンス名の対応表を用い
て,Ninkaでのライセンス名を使用する.
総計
パッケージ数
ソースファイル数
2013/1/11 SIGSS
包含関係
抽出に利用
2132
932
458366
144297
17
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ライセンス名対応表
Ninkaのライセンス知識や,Fedoraでのライセンス名の
規則[13]から作成した.
パッケージでのライセンス名
Ninkaでのライセンス名
ApacheSoftwareLicense
Apachev2
ASLv2
Apachev2
BSDwithadvertising
BSD4
BSD-compatible
BSD3
LGPLv2
LibraryGPLv2
LGPLv2.1
LesserGPLv2.1
ISC
BSD2
[13] T. ’spot’ Callaway,
“Licensing:main - fedoraproject”.
https://fedoraproject.org/wiki/Licensing:Main.
2013/1/11 SIGSS
18
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
包含関係のフィルタリング
• 10パッケージ以上に登場する包含関係のみを残す
– 利用できたパッケージの1%
• ライセンス特定の結果や,ライセンス名の対応に誤
りがあった場合の影響を減らすため
2013/1/11 SIGSS
19
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
RQ1
リサーチクエスチョン
RQ1:既存のソフトウェアから得られるライセンス間
の包含関係はどの様なものであるか.
アプローチ
抽出できた包含関係からグラフを作成し,その特徴
を確認する.
2013/1/11 SIGSS
20
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
publicDomain
11
BSD3
MITX11noNotice
10
15
BSD2
12
10
22
21
LesserGPLv2+
29
120
LibraryGPLv2+
11
LesserGPLv2.1+
17
15
35
54 41
13
17
GPLv2+
35 41
GPLv2
10
LesserGPLv2.1
13 18
GPLv3+
12
17
LibraryGPLv2
11
LesserGPLv3+
2013/1/11 SIGSS
21
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
RQ1 考察
• 実際のソースパッケージから包含関係を抽出できて
いる.
• 包含関係間において,連結している部分が多い.
⇒既存のソフトウェアから得られた関係を用いて,再
利用をした際のライセンス選択の支援が出来そう
RQ1の結論
• 実際のソースパッケージから包含関係を抽出でき,
再利用の際に利用できる可能性が高い.
2013/1/11 SIGSS
22
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
RQ2
リサーチクエスチョン
得られた包含関係から,ライセンス間の矛盾が起
きうることを確認できるか
アプローチ
– RQ1で作成したグラフにおけるライセンス間の到
達可能性をワーシャル法[14]を用いて計算した.
[14] S. Warshall, “A theorem on boolean matrices,” J. ACM,
vol.9, no.1, pp.11–12, Jan. 1962.
2013/1/11 SIGSS
23
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
ライセンス間の到達可能性
a
b
c
d
e
f
g
h
i
j
k
l
m
a. BSD2
b. BSD3
c. GPLv2
d. GPLv3
e. GPLv3+
f. LesserGPLv2+
g.LesserGPLv2.1
h. LesserGPLv2.1+
i. LesserGPLv3+
j. LibraryGPLv2
k. LibraryGPLv2+
l. MITX11noNotice
m. publicDomain
2013/1/11 SIGSS
24
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
RQ2 考察
• 任意のライセンスから到達可能なライセンスは存在
しなかった.
⇒使用したソースファイルやライブラリのライセンス次
第ではどのライセンスを選んだとしても矛盾が生じる
可能性がある.
RQ2結論
• 調べた範囲においては,ライセンスの矛盾が生じう
る.
2013/1/11 SIGSS
25
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
制限
• 実際のソースファイルの利用方法は考慮していない
• SPECファイルに記載されたソースパッケージのライ
センスや,Ninkaの特定結果が誤っているかもしれな
い
→実際には存在しない包含関係が現れるかもしれ
ない.
• ソースパッケージに偏りがあるかもしれない
→実際にはあるはずの包含関係が現れていない
可能性がある.
2013/1/11 SIGSS
26
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
関連研究
Germanら[15]
• ソースパッケージにおけるライセンスの整合性につ
いて調査し,問題を指摘している
– パッケージのライセンスがソースファイルのライセ
ンスよりも古い
– ソースファイルのライセンス変更が反映されてい
ない
• 本研究では,パッケージのライセンスとソースファイ
ルのライセンス間の関係から導出できる推移的な関
係に着目している
[15]D.M. German, M. Di Penta, and J. Davies, “Understanding and auditing the licensing of open source software distributions,”
Proceedings of 18th IEEE International Conference on Program Comprehension, pp.84–93, Braga, Portugal, 2010.
2013/1/11 SIGSS
27
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
まとめと今後の課題
• 開発者のライセンス選択支援を目的に既存のソー
スパッケージから包含関係を抽出
– 様々なライセンスについて包含関係を抽出できた
– ライセンスが矛盾することを包含関係から見るこ
とが出来た
• 今後の課題
– ソースファイルの利用状況の考慮
– 各ライセンスの条項まで踏み込んだ包含関係の
抽出
2013/1/11 SIGSS
28
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University