A Language-Based Version Control System for Python

Authors Luís Carvalho , João Costa Seco



PDF
Thumbnail PDF

File

LIPIcs.ECOOP.2024.9.pdf
  • Filesize: 0.89 MB
  • 27 pages

Document Identifiers

Author Details

Luís Carvalho
  • NOVA LINCS, NOVA School of Science and Technology, Caparica, Portugal
João Costa Seco
  • NOVA LINCS, NOVA School of Science and Technology, Caparica, Portugal

Cite AsGet BibTex

Luís Carvalho and João Costa Seco. A Language-Based Version Control System for Python. In 38th European Conference on Object-Oriented Programming (ECOOP 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 313, pp. 9:1-9:27, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ECOOP.2024.9

Abstract

We extend prior work on a language-based approach to versioned software development to support versioned programs with mutable state and evolving method interfaces. Unlike the traditional approach of mainstream version control systems, where a textual diff represents each evolution step, we treat versions as programming elements. Each evolution step, merge operation, and version relationship is represented explicitly in a multifaceted code representation. This provides static guarantees for safe code reuse from previous versions and forward and backwards compatibility between versions, allowing clients to use newly introduced code without needing to refactor their program manually. By lifting versioning to the language level, we pave the way for tools that interact with software repositories to have more insight into a system’s behavior evolution. We instantiate our work in the Python programming language and demonstrate its applicability regarding common evolution and refactoring patterns found in different versions of popular Python packages.

Subject Classification

ACM Subject Classification
  • Theory of computation → Type theory
  • Theory of computation → Program semantics
Keywords
  • Software evolution
  • type theory

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. ast - Abstract Syntax Trees, 2023. URL: https://docs.python.org/3/library/ast.html.
  2. Edward Amsden, Ryan Newton, and Jeremy Siek. Editing Functional Programs Without Breaking Them. In IFL 2014, 2014. Google Scholar
  3. Sven Apel and Delesley Hutchins. A calculus for uniform feature composition. ACM Transactions on Programming Languages and Systems (TOPLAS), 32(5):1-33, 2008. Google Scholar
  4. Keith H Bennett and Václav T Rajlich. Software maintenance and evolution: a roadmap. In Proceedings of the Conference on the Future of Software Engineering, 2000. Google Scholar
  5. Luís Carvalho and João Costa Seco. Deep semantic versioning for evolution and variability. In PPDP 2021, pages 1-13, 2021. Google Scholar
  6. Siwei Cui et al. PYInfer: Deep Learning Semantic Type Inference for Python Variables, 2021. arXiv:2106.14316. Google Scholar
  7. Luca Di Grazia et al. The evolution of type annotations in python: an empirical study. In ESEC/FSE 2022, pages 209-220. ACM, 2022. Google Scholar
  8. S. G. Eick, T. L. Graves, A. F. Karr, J. S. Marron, and A. Mockus. Does code decay? Assessing the evidence from change management data. IEEE Transactions on Software Engineering, 2001. Google Scholar
  9. Martin Erwig and Deling Ren. A rule-based language for programming software updates. In Proceedings of the 2002 ACM SIGPLAN workshop on Rule-based programming - RULE '02, Pittsburgh, Pennsylvania, 2002. Google Scholar
  10. T.L. Graves, A.F. Karr, J.S. Marron, and H. Siy. Predicting fault incidence using software change history. IEEE Transactions on Software Engineering, 2000. Google Scholar
  11. Neelam Gupta, Haifeng He, Xiangyu Zhang, and Rajiv Gupta. Locating faulty code using failure-inducing chops. In Proceedings of the 20th IEEE/ACM International Conference On Automated Software Engineering - ASE '05, page 263, Long Beach, CA, USA, 2005. ACM Press. URL: https://doi.org/10.1145/1101908.1101948.
  12. P. Hosek and C. Cadar. Safe software updates via multi-version execution. In 2013 35th International Conference on Software Engineering (ICSE), May 2013. URL: https://doi.org/10.1109/ICSE.2013.6606607.
  13. C. Izurieta and J. M. Bieman. How Software Designs Decay: A Pilot Study of Pattern Evolution. In First International Symposium on Empirical Software Engineering and Measurement (ESEM 2007), 2007. Google Scholar
  14. J. Kim, Y. K. Malaiya, and I. Ray. Vulnerability Discovery in Multi-Version Software Systems. In 10th IEEE High Assurance Systems Engineering Symposium (HASE'07), 2007. Google Scholar
  15. Miryung Kim and David Notkin. Program element matching for multi-version program analyses. In Proceedings of the 2006 international workshop on Mining software repositories - MSR '06, 2006. Google Scholar
  16. Raghavan Komondoor and Susan Horwitz. Using Slicing to Identify Duplication in Source Code. In Gerhard Goos, Juris Hartmanis, Jan van Leeuwen, and Patrick Cousot, editors, Static Analysis, volume 2126, pages 40-56. Springer Berlin Heidelberg, Berlin, Heidelberg, 2001. URL: https://doi.org/10.1007/3-540-47764-0_3.
  17. Li Li et al. Scalpel: The python static analysis framework. arXiv preprint, 2022. URL: https://arxiv.org/abs/2202.11840.
  18. Josip Maras, Jan Carlson, and Ivica Crnkovic. Client-side web application slicing. In 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011), pages 504-507, Lawrence, KS, USA, 2011. IEEE. URL: https://doi.org/10.1109/ASE.2011.6100110.
  19. Katsuhisa Maruyama, Eijiro Kitsu, Takayuki Omori, and Shinpei Hayashi. Slicing and replaying code change history. In Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering, pages 246-249. ACM, 2012. Google Scholar
  20. Stuart McIlroy et al. Fresh apps: an empirical study of frequently-updated mobile apps in the Google play store, 2016. Google Scholar
  21. Raphaël Monat et al. Static type analysis by abstract interpretation of python programs. In ECOOP 2020, 2020. Google Scholar
  22. Kashif Munawar and Muhammad Shumail Naveed. The impact of language syntax on the complexity of programs: A case study of java and python. Int. J. Innov. Sci. Technol, 4:683-695, 2022. Google Scholar
  23. Cyrus Omar, Ian Voysey, Ravi Chugh, and Matthew A Hammer. Live functional programming with typed holes. In Proceedings of the ACM on Programming Languages, volume 3, pages 1-32. ACM New York, NY, USA, 2019. Google Scholar
  24. Cyrus Omar, Ian Voysey, Ravi Chugh, and Matthew A. Hammer. Live functional programming with typed holes. Proceedings of the ACM on Programming Languages, 2019. Google Scholar
  25. Cyrus Omar, Ian Voysey, Michael Hilton, Jonathan Aldrich, and Matthew A. Hammer. Hazelnut: A Bidirectionally Typed Structure Editor Calculus. ACM SIGPLAN Notices, 2017. Google Scholar
  26. Tom Preston-Werner. Semantic Versioning 2.0.0, 2023. URL: https://www.semver.org.
  27. S. Raemaekers, A. Van Deursen, and J. Visser. Semantic versioning and impact of breaking changes in the Maven repository. Journal of Systems and Software, 129:140-158, 2017. Google Scholar
  28. Ina Schaefer, Lorenzo Bettini, Viviana Bono, Ferruccio Damiani, and Nico Tanzarella. Delta-Oriented Programming of Software Product Lines. In Software Product Lines: Going Beyond. Springer Berlin Heidelberg, Berlin, Heidelberg, 2010. Google Scholar
  29. Suriya Subramanian, Michael Hicks, and Kathryn S. McKinley. Dynamic software updates: A vm-centric approach. SIGPLAN Not., 44(6):1-12, June 2009. URL: https://doi.org/10.1145/1543135.1542478.
  30. Rick Wash, Emilee Rader, Kami Vaniea, and Michelle Rizor. Out of the loop: How automated software updates cause unintended security consequences. In 10th Symposium On Usable Privacy and Security (SOUPS 2014), 2014. Google Scholar
  31. Mark Weiser. Program slicing. In Proceedings of the 5th international conference on Software engineering, pages 439-449. IEEE Press, 1981. Google Scholar
  32. Zhaogui Xu, Xiangyu Zhang, Lin Chen, Kexin Pei, and Baowen Xu. Python probabilistic type inference with natural language support. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 607-618. ACM, November 2016. Google Scholar
  33. Lyuye Zhang et al. Has My Release Disobeyed Semantic Versioning? Static Detection Based on Semantic Differencing, 2022. URL: https://arxiv.org/abs/2209.00393.
  34. Thomas Zimmermann, Andreas Zeller, Peter Weissgerber, and Stephan Diehl. Mining version histories to guide software changes. IEEE Transactions on Software Engineering, 2005. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail