{"id":17160642,"url":"https://github.com/michaeldorner/information-diffusion-boundaries-in-code-review","last_synced_at":"2025-06-30T11:35:33.907Z","repository":{"id":154114013,"uuid":"463539395","full_name":"michaeldorner/information-diffusion-boundaries-in-code-review","owner":"michaeldorner","description":"Replication package for \"The Upper Bound of Information Diffusion in Code Review\"","archived":false,"fork":false,"pushed_at":"2025-01-15T08:42:19.000Z","size":28686,"stargazers_count":7,"open_issues_count":0,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T05:12:12.077Z","etag":null,"topics":["codereview","information-diffusion","replication-package","simulation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaeldorner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-25T13:16:55.000Z","updated_at":"2025-01-15T08:42:21.000Z","dependencies_parsed_at":"2023-12-21T12:46:21.011Z","dependency_job_id":"10e0b8a1-9349-4001-9e26-ac8b4c5755a2","html_url":"https://github.com/michaeldorner/information-diffusion-boundaries-in-code-review","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeldorner%2Finformation-diffusion-boundaries-in-code-review","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeldorner%2Finformation-diffusion-boundaries-in-code-review/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeldorner%2Finformation-diffusion-boundaries-in-code-review/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeldorner%2Finformation-diffusion-boundaries-in-code-review/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeldorner","download_url":"https://codeload.github.com/michaeldorner/information-diffusion-boundaries-in-code-review/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724629,"owners_count":21151561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codereview","information-diffusion","replication-package","simulation"],"created_at":"2024-10-14T22:25:30.996Z","updated_at":"2025-04-13T14:11:02.968Z","avatar_url":"https://github.com/michaeldorner.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Upper Bound of Information Diffusion in Code Review: Replication package\n\n[![GitHub](https://img.shields.io/github/license/michaeldorner/information-diffusion-boundaries-in-code-review)](./LICENSE)\n[![GitHub Actions](https://github.com/michaeldorner/information-diffusion-boundaries-in-code-review/actions/workflows/test.yml/badge.svg)](https://img.shields.io/github/actions/workflow/status/michaeldorner/information-diffusion-boundaries-in-code-review/main.yml)\n[![Codacy Badge](https://img.shields.io/codacy/grade/ef43d5d9b7c74ec0b211c03d91c448d8)](https://app.codacy.com/gh/michaeldorner/information-diffusion-boundaries-in-code-review/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Codacy Badge](https://img.shields.io/codacy/coverage/ef43d5d9b7c74ec0b211c03d91c448d8)](https://app.codacy.com/gh/michaeldorner/information-diffusion-boundaries-in-code-review/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_coverage)\n[![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.8042256-blue)](https://doi.org/10.5281/zenodo.8042256)\n\nSimulation code for the study [\"The Upper Bound of Information Diffusion in Code Review\"](https://link.springer.com/article/10.1007/s10664-024-10442-y)\n\n\n## Introduction\n\nThe underlying idea of our in-silico experiment is simple: We simulate an artificial information diffusion process in empirical communication networks emerging from code review and measure the minimal paths among all participants, the upper bound of information diffusion. The cardinality of reachable participants indicates how far (RQ 1) and minimal distances between participants indicate fast (RQ 2) information can spread following the communication channels that code review provide under best-case assumptions.\n\nYet, since communication, and, therefore, information diffusion, is (1) inherently a time-dependent process that is (2) not necessarily bilateral—often more than two participants exchange information in a code review—, traditional graphs are not capable of rendering information diffusion without dramatically overestimate information diffusion [(Dorner et al. 2022)](https://dl.acm.org/doi/abs/10.1145/3544902.3546254). Therefore, we use time-varying hypergraphs to model the communication network and measure the minimal paths of all vertices. Since a hypergraph is a generalization of a traditional graph, traditional graph algorithms (i.e., Dijkstra's algorithm) for determining minimal distances between vertices can be used.\n\nThe connotation of minimal is two-fold in time-varying hypergraphs: A distance in time-varying hypergraphs between two vertices can be topological or temporal. This means a minimal path in time-varying hypergraphs can be the _shortest_, _fastest_, and _foremost_ distance between vertices. Those different notions of a minimal path enable us to understand how fast and how far information can spread through code review.\n\nFor more details on time-varying hypergraphs in general and modelling communication networks that emerges from code review with time-varying hypergraphs, have a look into [Dorner et al. 2022](https://dl.acm.org/doi/abs/10.1145/3544902.3546254).\n\n\n## Installation\n\nThe simulation requires Python 3.10 and higher. Due to the [significant performance improvements in Python 3.11](https://docs.python.org/3/whatsnew/3.11.html#whatsnew311-faster-cpython) and the heavy CPU workload in the simulation, Python 3.11 is highly recommended! \n\nThe project depends on two external libraries: [`tqdm`](https://github.com/tqdm/tqdm) and [`pandas`](https://pandas.pydata.org). Install via\n\n```\npython3 -m pip install -r requirements.txt\n```\n\nFor a faster initial loading of the communication network, you **can optionally** install `orjson` via pip:\n\n```\npython3 -m pip install orjson\n```\n\nIf `orjson` is not installed, built-in [`json`](https://docs.python.org/3/library/json.html) encoder is used.\n\n\n## Usage\n\nTo run the full simulation, use\n\n```\npython3 -m simulation.run\n```\n\nPlease notice that depending on your hardware, the complete simulation may run several days and max out the CPU power. On a Apple MacBook M1 Max, it takes about three full days to complete. The simulations is highly parallelized which means: The more cores, the better/faster. We also recommend at least 64 GB of RAM and at least 12 GB available storage for storing the results.\n\nThe simulation provides options\n\n- `--select \u003cname 1\u003e \u003cname 2\u003e ...` to select a subset of available code review networks\n- `--vertex_dijkstra` to use a vertex-based implementation of Dijkstra's algorithm (which tends to be slower),\n- `--num_processes` to limit the number of processes\n\nFor an overview of all options, use `python3 -m simulation.run --help`.\n\nThe code review communication networks are in the subfolder `data/networks`, the simulation results are stored in `data/minimal_paths`\n\n\n## Tests and verification\n\n### Testing\n\nSo far, the simulation provides only a rudimentary test setup. You can run all tests via\n\n```\npython -m unittest discover\n```\n\nThe tests run also via [GitHub Actions](https://github.com/michaeldorner/information-diffusion-boundaries-in-code-review/actions). \n\n### Verification\n\nTo verify the your results with our [results](https://doi.org/10.5281/zenodo.7898863), compare the MD5 hashes of your results (for example, via `md5 ./data/minimal_distances/.*bz2` on macOS or `md5sum ./data/minimal_distances/.*bz2` on Linux) with the following MD5 hashes.\n\n```\ntrivago.pickle.bz2 \t 64c97c8ddb1e67cb70bfe297ad81c4ed\ntrivago.csv.bz2 \t a5e1a6d5230ac8c1888a711bd91f0420\nspotify.pickle.bz2 \t c434b887fcf449dc7195cc428260b35c\nspotify.csv.bz2 \t 259532c46779df2702bcff0fa6c7932f\nmicrosoft.pickle.bz2 \t f5b0beb747705fe3fcf4a84191bba937\nmicrosoft.csv.bz2 \t 08e93558473fb2b0a00de90e608901a3\n```\n\nWe also provide a minimal unittest that compares the hashes from Zenodo. It requires `requests` (install via `pip3 install requests`) and a [Zenodo access token](https://zenodo.org/account/settings/applications/tokens/new/). Run the unit test with the following command: \n\n```\nexport ZENODO_TOKEN=\u003cinsert token here\u003e\npython3 -m unittest tests/test_results.py\n```\n\nPlease notice: This simulation uses [Pickle Protocol version 5](https://peps.python.org/pep-0574/). Future protocol versions may produce different hashes if the internals change. `.csv` files, however, must produce always the same hashes.\n\n\n## Visualization\n\nBecause of the large runtime of the simulation, we provide precomputed results of the simulation via [Zenodo](https://doi.org/10.5281/zenodo.7898863). You can download the results and place the `.pickle` and `.csv` files in the subfolder `data/minimal_paths`. Consider verify the `.pickle` and `.csv` files (see [Verification](#verification)).\n\nTo visualize the results and reproduce the tables and figures of the publication, see the Jupyter notebooks in the subfolder `notebooks/`.\n\n\n## Credits\n\nThanks a lot\n\n- [Andreas Bauer](https://github.com/andreas-bauer) for your valuable feedback in countless discussion.\n- Students of the course _Software Testing_ in 2023 for their extraordinary efforts on developing a test suite for this project.\n\n\n## License\n\nCopyright © 2023 Michael Dorner\n\nThis work is licensed under [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeldorner%2Finformation-diffusion-boundaries-in-code-review","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeldorner%2Finformation-diffusion-boundaries-in-code-review","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeldorner%2Finformation-diffusion-boundaries-in-code-review/lists"}