Example Mining: Assisting Example Creation to Enhance Code Comprehension

Eva Krebs, Patrick Rein, R. Hirschfeld
{"title":"Example Mining: Assisting Example Creation to Enhance Code Comprehension","authors":"Eva Krebs, Patrick Rein, R. Hirschfeld","doi":"10.1145/3532512.3535226","DOIUrl":null,"url":null,"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.","PeriodicalId":245819,"journal":{"name":"Companion Proceedings of the 6th International Conference on the Art, Science, and Engineering of Programming","volume":"3 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-03-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Companion Proceedings of the 6th International Conference on the Art, Science, and Engineering of Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3532512.3535226","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

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.
示例挖掘:协助创建示例以增强代码理解
程序员经常使用带有具体值的示例来更好地理解代码。代码本身是抽象的,这使得它可以用于各种用途,但开发人员很难掌握。Babylonian Programming通过允许程序员在编辑时直接在代码中定义和可视化示例来具体化他们的代码,从而解决了这个问题。目前,像Babylonian/S这样的巴比伦编程实现需要程序员手动定义示例。对于包含小对象的示例,这很简单,但是在创建大型或复杂对象时就不是这样了。有时,诸如复制现有代码片段或尝试重新创建现有对象之类的变通方法用于重用系统中已经存在的信息,但是这些变通方法容易出错,而且很耗时。在本文中,我们提出了示例挖掘来解决这个问题,通过提供技术和集成工具来从现有资源中挖掘示例,类似于运行时跟踪和测试用例提取的概念。示例挖掘介绍了从测试、调试会话和开发中系统实际使用的跟踪中挖掘示例的概念。所有工具都在Squeak/Smalltalk中为Babylonian/S实现。我们将通过演练演示这些工具的有用性。我们的工具立即自动地为许多方法提供示例。因此,程序员可以更直接地访问抽象代码的动态反馈,从而使代码理解和调试更有效。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信