Exploring Tools and Strategies Used During Regular Expression Composition Tasks

Gina R. Bai, Brian Clee, Nischal Shrestha, Carl Chapman, Cimone Wright, Kathryn T. Stolee
{"title":"Exploring Tools and Strategies Used During Regular Expression Composition Tasks","authors":"Gina R. Bai, Brian Clee, Nischal Shrestha, Carl Chapman, Cimone Wright, Kathryn T. Stolee","doi":"10.1109/ICPC.2019.00039","DOIUrl":null,"url":null,"abstract":"Regular expressions are frequently found in programming projects. Studies have found that developers can accurately determine whether a string matches a regular expression. However, we still do not know the challenges associated with composing regular expressions. We conduct an exploratory case study to reveal the tools and strategies developers use during regular expression composition. In this study, 29 students are tasked with composing regular expressions that pass unit tests illustrating the intended behavior. The tasks are in Java and the Eclipse IDE was set up with JUnit tests. Participants had one hour to work and could use any Eclipse tools, web search, or web-based tools they desired. Screen-capture software recorded all interactions with browsers and the IDE. We analyzed the videos quantitatively by transcribing logs and extracting personas. Our results show that participants were 30% successful (28 of 94 attempts) at achieving a 100% pass rate on the unit tests. When participants used tools frequently, as in the case of the novice tester and the knowledgeable tester personas, or when they guess at a solution prior to searching, they are more likely to pass all the unit tests. We also found that compile errors often arise when participants searched for a result and copy/pasted the regular expression from another language into their Java files. These results point to future research into making regular expression composition easier for programmers, such as integrating visualization into the IDE to reduce context switching or providing language migration support when reusing regular expressions written in another language to reduce compile errors.","PeriodicalId":6853,"journal":{"name":"2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC)","volume":"31 1","pages":"197-208"},"PeriodicalIF":0.0000,"publicationDate":"2019-05-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"14","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICPC.2019.00039","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 14

Abstract

Regular expressions are frequently found in programming projects. Studies have found that developers can accurately determine whether a string matches a regular expression. However, we still do not know the challenges associated with composing regular expressions. We conduct an exploratory case study to reveal the tools and strategies developers use during regular expression composition. In this study, 29 students are tasked with composing regular expressions that pass unit tests illustrating the intended behavior. The tasks are in Java and the Eclipse IDE was set up with JUnit tests. Participants had one hour to work and could use any Eclipse tools, web search, or web-based tools they desired. Screen-capture software recorded all interactions with browsers and the IDE. We analyzed the videos quantitatively by transcribing logs and extracting personas. Our results show that participants were 30% successful (28 of 94 attempts) at achieving a 100% pass rate on the unit tests. When participants used tools frequently, as in the case of the novice tester and the knowledgeable tester personas, or when they guess at a solution prior to searching, they are more likely to pass all the unit tests. We also found that compile errors often arise when participants searched for a result and copy/pasted the regular expression from another language into their Java files. These results point to future research into making regular expression composition easier for programmers, such as integrating visualization into the IDE to reduce context switching or providing language migration support when reusing regular expressions written in another language to reduce compile errors.
探索正则表达式组合任务中使用的工具和策略
正则表达式经常出现在编程项目中。研究发现,开发人员可以准确地确定字符串是否与正则表达式匹配。然而,我们仍然不知道与组合正则表达式相关的挑战。我们进行了一个探索性的案例研究,以揭示开发人员在正则表达式组合过程中使用的工具和策略。在这项研究中,29名学生的任务是编写通过单元测试的正则表达式,以说明预期的行为。任务是用Java编写的,Eclipse IDE是用JUnit测试设置的。参与者有一个小时的工作时间,可以使用任何Eclipse工具、web搜索或基于web的工具。屏幕捕获软件记录了与浏览器和IDE的所有交互。我们通过转录日志和提取人物角色来定量分析视频。我们的结果显示参与者有30%的成功率(94次尝试中的28次)在单元测试中达到100%的通过率。当参与者频繁地使用工具时,就像新手测试人员和知识渊博的测试人员角色一样,或者当他们在搜索之前猜测解决方案时,他们更有可能通过所有的单元测试。我们还发现,当参与者搜索结果并将正则表达式从另一种语言复制/粘贴到他们的Java文件中时,经常会出现编译错误。这些结果表明,未来的研究将使正则表达式组合对程序员来说更容易,比如将可视化集成到IDE中以减少上下文切换,或者在重用用另一种语言编写的正则表达式时提供语言迁移支持以减少编译错误。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信