Using static analysis to detect type errors and concurrency defects in erlang programs

  • Authors:
  • Konstantinos Sagonas

  • Affiliations:
  • -

  • Venue:
  • FLOPS'10 Proceedings of the 10th international conference on Functional and Logic Programming
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

This invited talk will present the key ideas in the design and implementation of Dialyzer, a static analysis tool for Erlang programs. Dialyzer started as a defect detection tool using a rather ad hoc dataflow analysis to detect type errors in Erlang programs, but relatively early in its development it adopted a more disciplined approach to detecting definite type clashes in dynamically typed languages. Namely, an approach based on using a constraint-based analysis to infer success typings which are also enhanced with optional contracts supplied by the programmer. In the first part of the talk, we will describe this constraint-based approach to type inference and explain how it differs with past and recent attempts to type check programs written in dynamic languages. In the second part of the talk, we will present important recent additions to Dialyzer, namely analyses that detect concurrency defects (such as race conditions) in Erlang programs. For a number of years now, Dialyzer has been part of the Erlang/OTP system and has been actively used by its community. Based on this experience, we will also critically examine Dialyzer's design choices, show interesting cases of Dialyzer's use, and distill the main lessons learned from using static analysis in open source as well as commercial code bases of significant size.