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

HookLens:用于理解 React 钩子结构的可视化分析

HookLens: Visual Analytics for Understanding React Hooks Structures

Seoul National University(首尔大学);Samsung Electronics(三星电子)

Suyeon Hwang, Minkyu Kweon, Jeongmin Rhee, Soohyun Lee, Seokhyeon Park, Seokweon Jung, Hyeon Jeon, Jinwook Seo

AI总结:

HookLens 通过交互式可视化分析帮助开发者理解 React 钩子之间的依赖关系,识别反模式,提升代码可维护性。

摘要:

维护和重构 React 网站应用具有挑战性,因为 React 代码常常变得复杂,这归因于其核心 API 中的钩子(Hooks)。例如,钩子常常导致组件之间复杂的依赖关系,使代码行为不可预测,降低可维护性,即反模式。为了解决这一挑战,我们提出了 HookLens,一个交互式可视化分析系统,帮助开发者理解钩子如何定义组件之间的依赖关系和数据流。受与经验丰富的 React 开发者迭代设计过程的启发,HookLens 支持用户高效地理解组件结构和依赖关系,并识别反模式。一项涉及 12 名 React 开发者的定量用户研究显示,与传统代码编辑器相比,HookLens 显著提高了参与者检测反模式的准确性。此外,与最先进的基于 LLM 的编程助手的比较研究证实,这些改进在相同任务上甚至超过了此类编程助手的能力。

英文摘要:

Maintaining and refactoring React web applications is challenging, as React code often becomes complex due to its core API called Hooks. For example, Hooks often lead developers to create complex dependencies among components, making code behavior unpredictable and reducing maintainability, i.e., anti-patterns. To address this challenge, we present HookLens, an interactive visual analytics system that helps developers understand howHooks define dependencies and data flows between components. Informed by an iterative design process with experienced React developers, HookLens supports users to efficiently understand the structure and dependencies between components and to identify anti-patterns. A quantitative user study with 12 React developers demonstrates that HookLens significantly improves participants' accuracy in detecting anti-patterns compared to conventional code editors. Moreover, a comparative study with state-of-the-art LLM-based coding assistants confirms that these improvements even surpass the capabilities of such coding assistants on the same task.

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

↑