Enforcing and validating user-defined programming disciplines

  • Authors:
  • Todd Millstein;Shane Andrew Markstrum

  • Affiliations:
  • University of California, Los Angeles;University of California, Los Angeles

  • Venue:
  • Enforcing and validating user-defined programming disciplines
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Developing good software requires a large investment of time and money. Yet, production-quality code often has lurking bugs and security vulnerabilities. To help manage the complexity of building robust software systems, developers use programming disciplines during the creation process such as naming schemes for understandability, design patterns for extensibility, and lock ordering schemes to prevent program deadlock. But these disciplines are only informally specified and lack tooling support that would allow them to be enforced consistently on the code.In this dissertation, I present a solution for creating frameworks for programming disciplines that allows programmers to define how disciplines should be enforced. Further, this solution allows users to validate that the disciplines they are using ensure desired program properties in their code. This solution is built upon three insights: a domain-specific language provides a standard way to specify a discipline; type systems provide a scaffolding for automatic discipline checking; and explicit association of a runtime invariant allows disciplines to be verified.I present an overview of two instantiations of such programmer-defined discipline frameworks that I developed and built: JAVACOP for Java, and CLARITY for C. I show how the use of these frameworks can be beneficial to programmers via case studies of disciplines—including design pattern checkers, untainted types, and non-null types—that find errors in real code. These frameworks further show a trade-off among the desired properties of expressiveness, usability, and reliability. JAVACOP is expressive in that the language can be used to write a wide variety of disciplines, but it cannot automatically validate that a discipline is sound with respect to its invariant. On the other hand, CLARITY has limited expressiveness but can automatically prove that a discipline establishes an invariant on a program.