arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2408.14566cs.SE
收藏

评估 Python 风格指南:一项针对新手开发者的眼动追踪研究

Assessing Python Style Guides: An Eye-Tracking Study with Novice Developers

Pablo Roberto, Rohit Gheyi, José Aldo Silva da Costa, Márcio Ribeiro

AI总结:

本研究通过眼动追踪实验评估了Python PEP8风格指南对32名新手开发者的影响,发现未遵循特定指南会显著增加视觉回视,建议从业者采用有实验支持的指南。

摘要:

风格指南的纳入与改编在软件开发中扮演着重要角色,它通过影响代码格式化、命名约定和结构来增强可读性并简化维护。然而,许多此类指南往往缺乏实证研究来验证其建议。先前的研究考察了代码风格对开发者表现的影响,得出结论认为某些风格对代码可读性有负面影响。然而,仍需要更多研究通过实验在共同基础上评估其他视角以及这些视角的组合。本研究旨在通过眼动追踪技术,调查风格指南中各项指南的影响,特别聚焦于 Python 中因其最佳实践而受到认可的 PEP8 指南。我们对 32 名 Python 新手进行了一项对照实验,通过眼动追踪测量时间、尝试次数和视觉努力,针对四项 PEP8 建议使用了注视时长、注视次数和回视次数作为指标。此外,我们还进行了访谈,以探索受试者在程序方面的困难和偏好。结果强调,不遵循 PEP8 中“运算符后换行”指南,会使本应应用该标准的代码片段中的眼动回视次数增加 70%。大多数受试者偏好遵循 PEP8 指南的版本,并且一些人发现运算符左对齐的组织方式更容易理解。其他被评估的指南揭示了其他有趣的细微差别,例如 True Comparison,尽管受试者偏好 PEP8 的建议,但它对 PEP8 标准的眼动指标产生了负面影响。我们建议从业者选择有实验评估支持的指南。

英文摘要:

The incorporation and adaptation of style guides play an essential role in software development, influencing code formatting, naming conventions, and structure to enhance readability and simplify maintenance. However, many of these guides often lack empirical studies to validate their recommendations. Previous studies have examined the impact of code styles on developer performance, concluding that some styles have a negative impact on code readability. However, there is a need for more studies that assess other perspectives and the combination of these perspectives on a common basis through experiments. This study aimed to investigate, through eye-tracking, the impact of guidelines in style guides, with a special focus on the PEP8 guide in Python, recognized for its best practices. We conducted a controlled experiment with 32 Python novices, measuring time, the number of attempts, and visual effort through eye-tracking, using fixation duration, fixation count, and regression count for four PEP8 recommendations. Additionally, we conducted interviews to explore the subjects' difficulties and preferences with the programs. The results highlighted that not following the PEP8 Line Break after an Operator guideline increased the eye regression count by 70% in the code snippet where the standard should have been applied. Most subjects preferred the version that adhered to the PEP8 guideline, and some found the left-aligned organization of operators easier to understand. The other evaluated guidelines revealed other interesting nuances, such as the True Comparison, which negatively impacted eye metrics for the PEP8 standard, although subjects preferred the PEP8 suggestion. We recommend practitioners selecting guidelines supported by experimental evaluations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑