Skip to Main content Skip to Navigation
Reports

Static Analysis by Abstract Interpretation Collecting Types of Python Programs

Abstract : 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.
Complete list of metadatas

Cited literature [20 references]  Display  Hide  Download

https://hal.archives-ouvertes.fr/hal-01869049
Contributor : Raphaël Monat <>
Submitted on : Thursday, September 6, 2018 - 11:04:11 AM
Last modification on : Friday, January 8, 2021 - 5:34:03 PM
Long-term archiving on: : Friday, December 7, 2018 - 2:30:42 PM

File

monat.pdf
Files produced by the author(s)

Identifiers

  • HAL Id : hal-01869049, version 1

Citation

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

Share

Metrics

Record views

238

Files downloads

207