[Paper Review] LiDetector: License Incompatibility Detection for Open Source Software
LiDetector is an automated tool that detects license incompatibility in open source software by identifying meaningful license terms and inferring rights and obligations using a learning-based method and Probabilistic Context-Free Grammar (PCFG). It achieves 93.28% precision in term identification and 91.09% accuracy in right/obligation inference, with low false positive (10.06%) and false negative (2.56%) rates, and reveals 72.91% of 1,846 projects suffer from license incompatibility.
Open-source software (OSS) licenses dictate the conditions which should be followed to reuse, distribute, and modify the software. Apart from widely-used licenses such as the MIT License, developers are also allowed to customize their own licenses (called custom licenses), whose descriptions are more flexible. The presence of such various licenses imposes challenges to understanding licenses and their compatibility. To avoid financial and legal risks, it is essential to ensure license compatibility when integrating third-party packages or reusing code accompanied with licenses. In this work, we propose LiDetector, an effective tool that extracts and interprets OSS licenses (including both official licenses and custom licenses), and detects license incompatibility among these licenses. Specifically, LiDetector introduces a learning-based method to automatically identify meaningful license terms from an arbitrary license and employs Probabilistic Context-Free Grammar (PCFG) to infer rights and obligations for incompatibility detection. Experiments demonstrate that LiDetector outperforms existing methods with 93.28% precision for term identification, and 91.09% accuracy for right and obligation inference, and can effectively detect incompatibility with a 10.06% FP rate and 2.56% FN rate. Furthermore, with LiDetector, our large-scale empirical study on 1,846 projects reveals that 72.91% of the projects are suffering from license incompatibility, including popular ones such as the MIT License and the Apache License. We highlighted lessons learned from the perspectives of different stakeholders and made all related data and the replication package publicly available to facilitate follow-up research.
Motivation & Objective
- To address the challenge of detecting license incompatibility across diverse open source licenses, including custom and versioned licenses.
- To overcome the limitations of existing tools that only support predefined, well-known licenses and require manual rule definition.
- To develop an automated, scalable solution that interprets arbitrary licenses—both official and custom—without requiring manual configuration.
- To enable large-scale detection of incompatibility in real-world software projects, especially given the prevalence of customized licenses.
- To provide a publicly available tool and dataset to support reproducibility and future research in license compatibility.
Proposed method
- A learning-based method is used to automatically identify meaningful license terms from arbitrary license texts, leveraging natural language processing techniques.
- Probabilistic Context-Free Grammar (PCFG) is applied to parse license texts and infer rights and obligations from the syntactic structure.
- The system models license language as a sequence of terms and uses trained embeddings to detect semantically significant clauses.
- Inferred rights and obligations are analyzed for conflicts across multiple licenses to detect incompatibility.
- A rule-based conflict detection engine evaluates whether any pair of rights or obligations contradicts across integrated components.
- The framework is trained and evaluated on a diverse dataset of official and custom licenses, including versioned and exception-extended variants.
Experimental results
Research questions
- RQ1Can an automated system effectively identify and extract meaningful license terms from both official and custom open source licenses?
- RQ2How accurately can a grammar-based model infer rights and obligations from license texts compared to manual annotation?
- RQ3To what extent can the system detect incompatibility across a diverse set of licenses, including those not pre-defined in existing compatibility frameworks?
- RQ4What is the prevalence of license incompatibility in real-world open source projects, especially when custom or less common licenses are involved?
- RQ5How does the system perform in terms of precision, recall, and false positive/negative rates compared to existing tools?
Key findings
- LiDetector achieves 93.28% precision and 75.70% recall in identifying meaningful license terms from arbitrary license texts.
- The system infers rights and obligations with 91.09% accuracy, significantly outperforming existing rule-based approaches.
- In a large-scale evaluation of 200 GitHub projects, LiDetector detected 169 incompatible projects with a 10.06% false positive rate and 2.56% false negative rate.
- A large-scale empirical study on 1,846 real-world projects revealed that 72.91% suffer from license incompatibility, including projects using popular licenses like MIT and Apache.
- The study highlights widespread incompatibility risks, especially from custom licenses, which account for 24.56% of all licenses analyzed.
- All data, code, and replication packages are publicly released to support reproducibility and further research in license compatibility.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.