author: | Twan Coenraad |
title: | Improved static type inference for Ruby |
keywords: | |
topics: | Other |
committee: |
Marieke Huisman
, Ivo van Hurne , Ansgar Fehnker , J. Weeink |
end: | February 2018 |
Abstract
Dynamically typed languages pose both inherent advantages and dis- advantages towards developers. The lack of a static typing system results in having lots of freedom during development, at the cost of having to deal with typical run-time errors, like type errors, argument errors and no method errors. Earlier research has been conducted to deal with this type uncertainty, e. g., by developing analytic tools that can validate statically a dynamically typed code base. However, most of the time these tools give many false positives, therefore, they are not helpful for a developer to use in a real-world scenario. In this research a tool named Analist is developed for the Ruby language, focused on using a pragmatic approach. This means that wherever assumptions (e. g., when derived from the database schema file) are quite safe to be made, this is done. By design, this cannot be as complete as previously developed tools, yet it turns out to be a promising way of preventing programmer errors to occur as both synthetical benchmarks and an experiment with developers confirm. This bal-ance makes Analist a tool that is useful for developers. In future work one can consider to add more Ruby type definitions to Analist to make it even more useful, as for this research the span of what can be analyzed correctly was clearly limited.