Static Analysis by Abstract Interpretation Collecting Types of Python Programs - Archive ouverte HAL Access content directly
Reports Year : 2018

Static Analysis by Abstract Interpretation Collecting Types of Python Programs


Software bugs are costly: they can have disastrous consequences on critical systems, but also on more common applications such as Web servers. It is thus interesting to possess tools helping developers detect those bugs before they ship software into production. The most common approach to avoid those errors is to use testing, which is inefficient: tests are usually written by hand, taking time, and they cover a few executions of a program, but not all of them. The approach I undertook during this internship is to design a static analyzer by abstract interpretation for Python. Static analyzers are programs that automatically analyze an input program and report errors this input program may contain (given a certain class of errors the static analyzer may detect). In particular, if a static analyzer is sound and reports no error on a given input, we know that this program does not contain any error from the class the static analyzer is able to discover. Abstract interpretation is a theory formalizing links between a precise but costly semantics with some computable, approximated counterpart, thus guiding the design and implementation of sound static analyzers. State of the art static analyzers include Julia (analyzing Java), Astrée and Sparrow (for C software). Those are only analyzing statically typed languages. There are no mature static analyzers available for dynamic languages such as JavaScript and Python, although a few static analyses have already been developed and implemented. During this internship, I developed a static analysis of Python programs collecting the types of each variable, and possible type error exceptions. Python is a popular programming language, especially used in teaching and in the scientific community, well-known for its powerful syntax. Major software projects written in Python include the Django web framework and the SageMath computer algebra system. Python is an object-oriented dynamic language, where every value is an object. Python's dynamism means that undeclared variables, type incompatibilities, \dots\, are exceptions detected at runtime.
Fichier principal
Vignette du fichier
monat.pdf (704.04 Ko) Télécharger le fichier
Origin Files produced by the author(s)

Dates and versions

hal-01869049 , version 1 (06-09-2018)


  • HAL Id : hal-01869049 , version 1


Raphaël Monat. Static Analysis by Abstract Interpretation Collecting Types of Python Programs. [Internship report] LIP6 - Laboratoire d'Informatique de Paris 6. 2018. ⟨hal-01869049⟩
286 View
199 Download


Gmail Mastodon Facebook X LinkedIn More