Program Analysis: Towards the Analysis of CPython Bytecode

Program analysis methods offer static compile-time techniques to predict approximations to a set of values or dynamic behaviours which arise during a program’s run-time. These methods generate
useful observations and characteristics about the underlying program, in an automated way.

PATH (Python Analysis Tooling Helper) is a static analysis toolcreated in this project, which generates a standardized Intermediary Representation for given functions, allowing analysis metrics to be generated from the facts produced by the tool. The goal of this project was to create a framework that generates facts from a function, in addition to an IR that is amenable for further analysis.The framework created should simplify the engineering complexity of fact analysis for
future use. PATH would disassemble CPython bytecode into a more straightforward representation, making any further possible analyses a simpler task, as analysis can be conduced on the generated

The final findings of the project indicate that performing analysis on the IR generated by PATH is indeed a simpler task than generating facts manually and conducting block analysis without such a
framework. These results are satisfactory and hold up to the aims of this project.

Figure 1. CPython code execution
Figure 2. PATH high-level overview

Student: Andre Theuma
Course: B.Sc. (Hons.) Computing Science
Supervisor: Dr Neville Grech