skip to main content
10.1145/3532512.3535226acmotherconferencesArticle/Chapter ViewAbstractPublication PagesprogrammingConference Proceedingsconference-collections
research-article
Open access

Example Mining: Assisting Example Creation to Enhance Code Comprehension

Published: 08 December 2022 Publication History

Abstract

Programmers often use examples with concrete values to better understand code. Code by itself is abstract, which empowers it to be used for a variety of uses, but can be difficult to grasp by developers. Babylonian Programming addresses this by allowing programmers to concretize their code by defining and visualizing examples directly in the code itself while editing.
Currently, Babylonian Programming implementations such as Babylonian/S require programmers to define examples manually. For examples containing small objects this is straightforward, however when creating large or complex objects it is not. Sometimes, workarounds such as copying existing code pieces or trying to recreate existing objects are used to reuse information already present in the system, but these workarounds can be error-prone and also time-consuming.
In this paper, we propose Example Mining to address this issue by providing techniques and integrated tools to mine examples from existing sources similar to concepts from run-time tracing and test case extraction. Example mining introduces concepts to mine examples from tests, debugging sessions, and traces of actual usage of the system under development. All tools were implemented for Babylonian/S in Squeak/Smalltalk.
We demonstrate the usefulness of the tools through walkthroughs. Our tools provide examples for many methods immediately and automatically. As a consequence, programmers have more immediate access to dynamic feedback on their abstract code, making code comprehension and debugging more effective.

References

[1]
Bowen Alpern, Ton Ngo, Jong-Deok Choi, and Manu Sridharan. 2000. DejaVu: deterministic Java replay debugger for Jalapeño Java virtual machine. In Object Oriented Programming Systems Languages and Applications Conference, OOPSLA 2000, Minneapolis, MN, USA, October 15-19, 2000, Addendum to the proceedings, James Haungs (Ed.). ACM, 165–166. https://doi.org/10.1145/367845.368073
[2]
Ronald Baecker, Chris DiGiano, and Aaron Marcus. 1997. Software Visualization for Debugging. Commun. ACM 40, 4 (1997), 44–54. https://doi.org/10.1145/248448.248458
[3]
Jong-Deok Choi and Harini Srinivasan. 1998. Deterministic replay of Java multithreaded applications. In Proceedings of the SIGMETRICS symposium on Parallel and distributed tools - SPDT '98. ACM Press. https://doi.org/10.1145/281035.281041
[4]
Jonathan Edwards. 2004. Example centric programming. In Companion to the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2004, October 24-28, 2004, Vancouver, BC, Canada, John M. Vlissides and Douglas C. Schmidt (Eds.). ACM, 124. https://doi.org/10.1145/1028664.1028713
[5]
Sebastian G. Elbaum, Hui Nee Chin, Matthew B. Dwyer, and Jonathan Dokulil. 2006. Carving differential unit test cases from system test cases. In Proceedings of the 14th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2006, Portland, Oregon, USA, November 5-11, 2006, Michal Young and Premkumar T. Devanbu (Eds.). ACM, 253–264. https://doi.org/10.1145/1181775.1181806
[6]
Markus Gaelli. 2006. Modeling Examples to Test and Understand Software. (2006). https://doi.org/10.7892/BORIS.104524
[7]
Adele Goldberg and David Robson. 1983. Smalltalk-80: The Language and Its Implementation. Addison-Wesley.
[8]
Zhongxian Gu, Earl T. Barr, Drew Schleck, and Zhendong Su. 2012. Reusing debugging knowledge via trace-based bug search. In Proceedings of the 27th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2012, part of SPLASH 2012, Tucson, AZ, USA, October 21-25, 2012, Gary T. Leavens and Matthew B. Dwyer (Eds.). ACM, 927–942. https://doi.org/10.1145/2384616.2384684
[9]
Christopher Michael Hancock. 2003. Real-time Programming and the Big Ideas of Computational Literacy. Ph. D. Dissertation. Massachusetts Institute of Technology.
[10]
Ferenc Horváth, Béla Vancsics, László Vidács, Árpád Beszédes, Dávid Tengeri, Tamás Gergely, and Tibor Gyimóthy. 2015. Test suite evaluation using code coverage based metrics. In Proceedings of the 14th Symposium on Programming Languages and Software Tools (SPLST’15), Tampere, Finland, October 9-10, 2015(CEUR Workshop Proceedings, Vol. 1525), Jyrki Nummenmaa, Outi Sievi-Korte, and Erkki Mäkinen (Eds.). CEUR-WS.org, 46–60. http://ceur-ws.org/Vol-1525/paper-04.pdf
[11]
Tomoki Imai, Hidehiko Masuhara, and Tomoyuki Aotani. 2015. Shiranui: a live programming with support for unit testing. In Companion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity, SPLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015, Jonathan Aldrichand Patrick Eugster (Eds.). ACM, 36–37. https://doi.org/10.1145/2814189.2817268
[12]
Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan C. Kay. 1997. Back to the Future: The Story of Squeak - A Usable Smalltalk Written in Itself. In Proceedings of the 1997 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages & Applications (OOPSLA ’97), Atlanta, Georgia, October 5-9, 1997, Mary E. S. Loomis, Toby Bloom, and A. Michael Berman (Eds.). ACM, 318–326. https://doi.org/10.1145/263698.263754
[13]
Shrinivas Joshi and Alessandro Orso. 2007. SCARPE: A Technique and Tool for Selective Capture and Replay of Program Executions. In 23rd IEEE International Conference on Software Maintenance (ICSM 2007), October 2-5, 2007, Paris, France. IEEE Computer Society, 234–243. https://doi.org/10.1109/ICSM.2007.4362636
[14]
Jan-Peter Krämer, Joachim Kurz, Thorsten Karrer, and Jan O. Borchers. 2014. How live coding affects developers’ coding behavior. In IEEE Symposium on Visual Languages and Human-Centric Computing, VL/HCC 2014, Melbourne, VIC, Australia, July 28 - August 1, 2014, Scott D. Fleming, Andrew Fish, and Christopher Scaffidi (Eds.). IEEE Computer Society, 5–8. https://doi.org/10.1109/VLHCC.2014.6883013
[15]
Chris Laffra and Ashok Malhotra. 1994. HotWire - A Visual Debugger for C++. In Proceedings of the C++ Conference. Cambridge, MA, USA, April 1994, Doug Lea (Ed.). USENIX Association, 109–122. http://www.usenix.org/publications/library/proceedings/c++94/laffra.html
[16]
Henry Lieberman and Christopher Fry. 1995. Bridging the Gulf Between Code and Behavior in Programming. In Human Factors in Computing Systems, CHI ’95 Conference Proceedings, Denver, Colorado, USA, May 7-11, 1995, Irvin R. Katz, Robert L. Mack, Linn Marks, Mary Beth Rosson, and Jakob Nielsen (Eds.). ACM/Addison-Wesley, 480–486. https://doi.org/10.1145/223904.223969
[17]
Jens Lincke, Patrick Rein, Stefan Ramson, Robert Hirschfeld, Marcel Taeumel, and Tim Felgentreff. 2017. Designing a live development experience for web-components. In Proceedings of the 3rd ACM SIGPLAN International Workshop on Programming Experience, PX/17.2, Vancouver, BC, Canada, October 23-27, 2017, Luke Church, Richard P. Gabriel, Robert Hirschfeld, and Hidehiko Masuhara (Eds.). ACM, 28–35. https://dl.acm.org/citation.cfm?id=3167109
[18]
Yiling Lou, Junjie Chen, Lingming Zhang, and Dan Hao. 2019. Chapter One - A Survey on Regression Test-Case Prioritization. Adv. Comput. 113(2019), 1–46. https://doi.org/10.1016/bs.adcom.2018.10.001
[19]
Allen D. Malony, David H. Hammerslag, and David Jablonowski. 1991. Traceview: A Trace Visualization Tool. IEEE Softw. 8, 5 (1991), 19–28. https://doi.org/10.1109/52.84213
[20]
Wes Masri and Marwa El-Ghali. 2009. Test case filtering and prioritization based on coverage of combinations of program elements. In Proceedings of the International Workshop on Dynamic Analysis: held in conjunction with the ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2009), WODA 2009, Chicago, IL, USA, July, 2009, Ben Liblit and Andy Podgurski (Eds.). 29–34. https://doi.org/10.1145/2134243.2134250
[21]
Sean McDirmid. 2013. Usable Live Programming. In ACM Symposium on New Ideas in Programming and Reflections on Software, Onward! 2013, part of SPLASH ’13, Indianapolis, IN, USA, October 26-31, 2013, Antony L. Hosking, Patrick Th. Eugster, and Robert Hirschfeld (Eds.). ACM, 53–62. https://doi.org/10.1145/2509578.2509585
[22]
Dominik Meier, Toni Mattis, and Robert Hirschfeld. 2021. Toward Exploratory Understanding of Software using Test Suites. In 7th Programming Experience Workshop (PX/21). ACM. https://doi.org/10.1145/3464432.3464438
[23]
Fabio Niephaus, Patrick Rein, Jakob Edding, Jonas Hering, Bastian König, Kolya Opahle, Nico Scordialo, and Robert Hirschfeld. 2020. Example-based live programming for everyone: building language-agnostic tools for live programming with LSP and GraalVM. In Proceedings of the 2020 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, Onward! 2020, Virtual, November, 2020. ACM, 1–17. https://doi.org/10.1145/3426428.3426919
[24]
Alessandro Orso and Bryan Kennedy. 2005. Selective capture and replay of program executions. ACM SIGSOFT Softw. Eng. Notes 30, 4 (2005), 1–7. https://doi.org/10.1145/1082983.1083251
[25]
Peter Phillips. 2010. Enhanced debugging with traces. Commun. ACM 53, 5 (2010), 50–53. https://doi.org/10.1145/1735223.1735240
[26]
David Rauch, Patrick Rein, Stefan Ramson, Jens Lincke, and Robert Hirschfeld. 2019. Babylonian-style Programming - Design and Implementation of an Integration of Live Examples Into General-purpose Source Code. Art Sci. Eng. Program. 3, 3 (2019), 9. https://doi.org/10.22152/programming-journal.org/2019/3/9
[27]
Patrick Rein, Jens Lincke, Stefan Ramson, Toni Mattis, Fabio Niephaus, and Robert Hirschfeld. 2019. Implementing Babylonian/S by Putting Examples Into Contexts. In Proceedings of the Workshop on Context-oriented Programming - COP '19. ACM Press. https://doi.org/10.1145/3340671.3343358
[28]
Patrick Rein, Stefan Ramson, Jens Lincke, Robert Hirschfeld, and Tobias Pape. 2019. Exploratory and Live, Programming and Coding - A Literature Study Comparing Perspectives on Liveness. Programming Journal 3, 1 (2019), 1. https://doi.org/10.22152/programming-journal.org/2019/3/1
[29]
David Saff and Michael D. Ernst. 2004. Mock object creation for test factoring. In Proceedings of the 2004 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis For Software Tools and Engineering, PASTE’04, Washington, DC, USA, June 7-8, 2004, Cormac Flanagan and Andreas Zeller (Eds.). ACM, 49–51. https://doi.org/10.1145/996821.996838
[30]
Bastian Steinert, Michael Perscheid, Martin Beck, Jens Lincke, and Robert Hirschfeld. 2009. Debugging into Examples. In Testing of Software and Communication Systems, 21st IFIP WG 6.1 International Conference, TESTCOM 2009 and 9th International Workshop, FATES 2009, Eindhoven, The Netherlands, November 2-4, 2009. Proceedings(Lecture Notes in Computer Science, Vol. 5826), Manuel Núñez, Paul Baker, and Mercedes G. Merayo (Eds.). Springer, 235–240. https://doi.org/10.1007/978-3-642-05031-2_18
[31]
Steven L. Tanimoto. 1990. VIVA: A visual language for image processing. J. Vis. Lang. Comput. 1, 2 (1990), 127–139. https://doi.org/10.1016/S1045-926X(05)80012-6
[32]
Steven L. Tanimoto. 2013. A perspective on the evolution of live programming. In Proceedings of the 1st International Workshop on Live Programming, LIVE 2013, San Francisco, California, USA, May 19, 2013, Brian Burg, Adrian Kuhn, and Chris Parnin (Eds.). IEEE Computer Society, 31–34. https://doi.org/10.1109/LIVE.2013.6617346
[33]
Dávid Tengeri, Árpád Beszédes, Tamás Gergely, László Vidács, David Havas, and Tibor Gyimóthy. 2015. Beyond code coverage - An approach for test suite assessment and improvement. In Eighth IEEE International Conference on Software Testing, Verification and Validation, ICST 2015 Workshops, Graz, Austria, April 13-17, 2015. IEEE Computer Society, 1–7. https://doi.org/10.1109/ICSTW.2015.7107476
[34]
David M. Ungar, Henry Lieberman, and Christopher Fry. 1997. Debugging and the Experience of Immediacy. Commun. ACM 40, 4 (1997), 38–43. https://doi.org/10.1145/248448.248457
[35]
Radhika D. Venkatasubramanyam and Sowmya G. R.2014. Why is dynamic analysis not used as extensively as static analysis: an industrial study. In 1st International Workshop on Software Engineering Research and Industrial Practices, SER&IPs 2014, Hyderabad, India, June 1, 2014, Rakesh Shukla, Anjaneyulu Pasala, and Srinivas Padmanabhuni (Eds.). ACM, 24–33. https://doi.org/10.1145/2593850.2593855

Cited By

View all
  • (2024)Implementing Babylonian/G by Putting Examples into Game ContextsCompanion Proceedings of the 8th International Conference on the Art, Science, and Engineering of Programming10.1145/3660829.3660847(68-72)Online publication date: 11-Mar-2024
  • (2024)Examples out of Thin Air: AI-Generated Dynamic Context to Assist Program Comprehension by ExampleCompanion Proceedings of the 8th International Conference on the Art, Science, and Engineering of Programming10.1145/3660829.3660845(99-107)Online publication date: 11-Mar-2024

Index Terms

  1. Example Mining: Assisting Example Creation to Enhance Code Comprehension

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    Programming '22: Companion Proceedings of the 6th International Conference on the Art, Science, and Engineering of Programming
    March 2022
    98 pages
    ISBN:9781450396561
    DOI:10.1145/3532512
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 08 December 2022

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. babylonian programming
    2. example-based programming
    3. examples
    4. exploratory programming
    5. live programming
    6. smalltalk
    7. squeak

    Qualifiers

    • Research-article
    • Research
    • Refereed limited

    Funding Sources

    Conference

    <Programming> '22 Companion

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)187
    • Downloads (Last 6 weeks)17
    Reflects downloads up to 14 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Implementing Babylonian/G by Putting Examples into Game ContextsCompanion Proceedings of the 8th International Conference on the Art, Science, and Engineering of Programming10.1145/3660829.3660847(68-72)Online publication date: 11-Mar-2024
    • (2024)Examples out of Thin Air: AI-Generated Dynamic Context to Assist Program Comprehension by ExampleCompanion Proceedings of the 8th International Conference on the Art, Science, and Engineering of Programming10.1145/3660829.3660845(99-107)Online publication date: 11-Mar-2024

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    HTML Format

    View this article in HTML Format.

    HTML Format

    Login options

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media