Bugs that are detected earlier during the development lifecycle are easier and cheaper to fix, whereas bugs that are found during production are difficult and expensive to address, and may have dire consequences. Type systems are particularly effective at identifying and preventing bugs early in the development lifecycle by causing invalid programs to result in build failure. Liquid Types are more powerful than those found in mainstream programming languages, allowing the detection of more classes of bugs. However, while Liquid Types were proposed in 2008 with their integration in ML and subsequently introduced in C (2012), Javascript(2012) and Haskell(2014) through language extensions, they have yet to become widely adopted by mainstream developers. This paper investigates how Liquid Types can be integrated in a mainstream programming language, Java, by proposing a new design that aims to lower the barrier to entry and adapts to problems that Java developers commonly encounter at runtime. To promote accessibility, we conducted a series of developer surveys to design the syntax of LiquidJava, our prototype. To evaluate the prototype's usability, we conducted a user study of 30 Java developers, concluding that users intend to use LiquidJava and that it helped to find more bugs and debug faster.
翻译:在开发生命周期早期发现的错误比较容易,也比较便宜,而生产过程中发现的错误很难解决,而且费用昂贵,可能产生严重后果。类型系统特别有效,通过导致无效程序导致建设失败,在开发生命周期早期发现和预防错误。液体类型比主流编程语言中发现的错误更强大,可以发现更多的种类的错误。然而,2008年提出了液体类型,将其纳入ML,随后又在C(2012)、Javascript(2012)和Haskell(2014)中通过语言扩展引入了液体类型,但这些类型尚未被主流开发者广泛采用。本文调查了如何将液体类型纳入主流编程语言Java,提出了旨在降低进入障碍和适应Java开发者在运行时通常遇到的问题的新设计。为了促进无障碍,我们进行了一系列开发者调查,以设计液体java(我们的原型)的合成词。为了评估原型的可用性,我们对30名化开发者进行了用户研究,得出的结论是,用户打算使用液体Java,并且帮助更快地找到更多的错误和调。