一句话:以参与式设计将 Liquid Types 融入 Java,实现 LiquidJava,并经 30 人用户研究证明其易学易用且能帮助发现并修复更多缺陷。
该文关注 Liquid Types 在主流语言中落地时的可用性障碍:已有实现多未采用以人为中心的设计与评估方法,导致入门门槛高。作者以参与式设计方法开展开发者问卷,据此设计并实现面向 Java 的原型 LiquidJava,其语法与集成方式针对 Java 开发者常见的运行时问题。为评估额外编写 Liquid Types 注解的成本是否值得,作者对 30 名 Java 开发者进行了用户研究。结果显示,LiquidJava 帮助用户检测并修复了更多缺陷,且 Liquid Types 仅需少量学习资源即可理解和掌握;研究结束时,所有参与者都表示愿意在项目中采用 LiquidJava。
Developers want to detect bugs as early in the development lifecycle as possible, as the effort and cost to fix them increases with the incremental development of features. Ultimately, bugs that are only found in production can have catastrophic consequences. Type systems are effective at detecting many classes of bugs during development, often providing immediate feedback both at compile-time and while typing due to editor integration. Unfortunately, more powerful static and dynamic analysis tools do not have the same success due to providing false positives, not being immediate, or not being integrated into the language. Liquid Types extend the language type system with predicates, augmenting the classes of bugs that the compiler or IDE can catch compared to the simpler type systems available in mainstream programming languages. However, previous implementations of Liquid Types have not used human-centered methods for designing or evaluating their extensions. Therefore, this paper investigates how Liquid Types can be integrated into a mainstream programming language, Java, by proposing a new design that aims to lower the barriers to entry and adapts to problems that Java developers commonly encounter at runtime. Following a participatory design methodology, we conducted a developer survey to design the syntax of LiquidJava, our prototype. To evaluate if the added effort to writing Liquid Types in Java would convince users to adopt them, we conducted a user study with 30 Java developers. The results show that LiquidJava helped users detect and fix more bugs and that Liquid Types are easy to interpret and learn with few resources. At the end of the study, all users reported interest in adopting LiquidJava for their projects.