一句话:提出技术杠杆度量并实证发现中小型 FOSS 库杠杆更高、发布延迟仅 4% 但漏洞几率高 1.6 倍。
本文将金融杠杆类比引入软件生态,研究开发者通过复用免费开源库来放大自身功能时,技术杠杆能否带来开发收益,以及是否会引入安全风险。作者提出 change distance 与 change direction 两个度量,用于刻画对第三方库依赖的规模与演化,并在 8494 个基于 Maven 的 Java FOSS 库版本上进行实证分析。结果显示,中小型库(少于 10 万行代码)对 FOSS 依赖的杠杆比例显著高于大型库。杠杆具有收益:被杠杆化的库在发布间隔上仅增加 4% 延迟,却能提供约四倍于自身代码量的功能;但风险同样存在:具有这种杠杆的库(占样本 75%)发生漏洞的几率是低杠杆库的 1.6 倍。作者还提供了在线演示用于计算真实软件库的所提度量。
In finance, leverage is the ratio between assets borrowed from others and one's own assets. A matching situation is present in software: by using free open-source software (FOSS) libraries a developer leverages on other people's code to multiply the offered functionalities with a much smaller own codebase. In finance as in software, leverage magnifies profits when returns from borrowing exceed costs of integration, but it may also magnify losses, in particular in the presence of security vulnerabilities. We aim to understand the level of technical leverage in the FOSS ecosystem and whether it can be a potential source of security vulnerabilities. Also, we introduce two metrics change distance and change direction to capture the amount and the evolution of the dependency on third-party libraries. The application of the proposed metrics on 8494 distinct library versions from the FOSS Maven-based Java libraries shows that small and medium libraries (less than 100KLoC) have disproportionately more leverage on FOSS dependencies in comparison to large libraries. We show that leverage pays off as leveraged libraries only add a 4% delay in the time interval between library releases while providing four times more code than their own. However, libraries with such leverage (i.e., 75% of libraries in our sample) also have 1.6 higher odds of being vulnerable in comparison to the libraries with lower leverage. We provide an online demo for computing the proposed metrics for real-world software libraries available under the following URL: https://techleverage.eu/