scieee AI-readable full text Open interactive document viewer

Empirical Software Engineering Research with Software Heritage

Zacchiroli, Stefano

Abstract

Software Heritage collects publicly available source code from numerous software projects and tracks their ongoing development. Outline1 Datasets2 Accessing source code artifacts3 Software provenance and evolution4 Software forks5 Diversity, equity, and inclusion

Full text

Empirical Software Engineering Research with Software Heritage Stefano Zacchiroli Télécom Paris, Polytechnic Institute of Paris [email protected] 28 September 2022 THE GREAT LIBRARY OF SOURC E CODE Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 1 / 12 Outline 1Datasets 2Accessing source code artifacts 3Software provenance and evolution 4Software forks 5Diversity, equity, and inclusion Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 2 / 12 Graph dataset Use case: large scale analyses of the most comprehensive corpus on the development history of free/open source software. Antoine Pietri, Diomidis Spinellis, Stefano Zacchiroli The Software Heritage Graph Dataset: Public software development under one roof MSR 2019: 16th Intl. Conf. on Mining Software Repositories. IEEE preprint: http://deb.li/swhmsr19 Dataset Relational representation of the full graph as a set of tables Available as open data: https://doi.org/10.5281/zenodo.2583978 Chosen as subject for the MSR 2020 Mining Challenge Formats Local use: PostgreSQL dumps, or Apache Parquet files (~1 TiB each) Live usage: Amazon Athena (SQL-queriable), Azure Data Lake Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 2 / 12 Graph dataset — example SELECT COUNT(*) AS c, word FROM ( SELECT LOWER(REGEXP_EXTRACT(FROM_UTF8( message), ’^\w+’)) AS word FROM revision) WHERE word != ’’ GROUP BY word ORDER BY COUNT(*) DESC LIMIT 5; Count Word 71 338 310 update 64 980 346 merge 56 854 372 add 44 971 954 added 33 222 056 fix Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 3 / 12 Graph dataset — example SELECT COUNT(*) AS c, word FROM ( SELECT LOWER(REGEXP_EXTRACT(FROM_UTF8( message), ’^\w+’)) AS word FROM revision) WHERE word != ’’ GROUP BY word ORDER BY COUNT(*) DESC LIMIT 5; Count Word 71 338 310 update 64 980 346 merge 56 854 372 add 44 971 954 added 33 222 056 fix Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 3 / 12 License dataset Stefano Zacchiroli A Large-scale Dataset of (Open Source) License Text Variants MSR 2022 (best dataset paper award) preprint: https://arxiv.org/abs/2204.00256 Dataset 6.5 million unique full texts of FOSS license variants Detected using filename patterns across the entire SWH archive LICENSE,COPYRIGHT,NOTICE, etc. Metadata: file lengths measures, detected MIME type, detected SPDX license (via ScanCode), example origin repository, oldest public commit of origin Use cases Empirical studies on FOSS licensing, including phylogenetics Training of automated license classifiers NLP analyses of legal texts Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 4 / 12 Outline 1Datasets 2Accessing source code artifacts 3Software provenance and evolution 4Software forks 5Diversity, equity, and inclusion Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 5 / 12 The Software Heritage Filesystem (SwhFS) The Software Heritage Filesystem (SwhFS) is a user-space POSIX filesystem that enables browsing parts of the Software Heritage archive as if it were locally available. code: forge.softwareheritage.org/source/swh-fuse documentation: docs.softwareheritage.org/devel/swh-fuse Thibault Allançon, Antoine Pietri, Stefano Zacchiroli The Software Heritage Filesystem (SwhFS): Integrating Source Code Archival with Development ICSE 2021: The 43rd International Conference on Software Engineering https://arxiv.org/abs/2102.06390 Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 5 / 12 The Software Heritage Filesystem (SwhFS) — example $ mkdir swhfs $ swh fs mount swhfs/ # mount the archive $ cd swhfs/ $ cat archive/swh:1:cnt:c839dea9e8e6f0528b468214348fee8669b305b2 #include <stdio.h> int main(void) { printf("Hello, World!\n"); } $ cd archive/swh:1:dir:1fee702c7e6d14395bbf5ac3598e73bcbf97b030 $ ls | wc -l 127 $ grep -i antenna THE_LUNAR_LANDING.s | cut -f 5 # IS THE LR ANTENNA IN POSITION 1 YET # BRANCH IF ANTENNA ALREADY IN POSITION 1 Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 6 / 12 Outline 1Datasets 2Accessing source code artifacts 3Software provenance and evolution 4Software forks 5Diversity, equity, and inclusion Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 11 / 12 Diversity, equity, and inclusion Idea Archived commit metadata contains public information that can be mined to study long-term trends of diversity, equity, and inclusion (DEI) traits of the global population of public code contributors. Key findings on the gender gap Male authors contributed 92% of public code commits up to 2019. The ratio of female authors (and their contributions) has grown stably for 15 years reaching for the first time 10% of yearly contributions in 2019. The COVID-19 pandemic has reversed the trend. Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 11 / 12 Diversity, equity, and inclusion (cont.) Key findings on the geographic gap The early decades of public code were dominated by contributions from North America, followed by a period of alternating dominance between North America and Europe. Since then geographic diversity has increased constantly, with raising importance of contributions from Central and South America. The trend of increased female contributions is almost worlwide, with the notable exception of specific regions of Asia were it is either slower or flat. References Zacchiroli. Gender differences in public code contributions: a 50-year perspective. IEEE Software, 2021 Rossi and Zacchiroli. Worldwide gender differences in public code contributions. ICSE SEIS, 2022 Rossi and Zacchiroli. Geographic diversity in public code contributions. MSR 2022 Stefano Zacchiroli Empirical Software Eng. Research with Software Heritage 2022-09-28 12 / 12