Contains examples from the course on Software Analysis at the University of Passau. The examples are mainly toy examples to visualise a certain aspect during the course. They are not meant to be complete or perfect; they also do not necessarily meet a certain level of style or code quality!
Feel free to fork this repository and file a pull request to add further examples.
ast_exampleprovides an AST visitor and an AST rewriter based on Python's AST module. It is using theastorlibrary to extract source code from the AST again.controldependenciesis an implementation of control-flow graph, dominator and post-dominator tree, and control-dependence graph based on Python bytecode. It emits Graphviz DOT files of the graphs and automatically converts them to PNG.
Make sure you have thedotutility installed and available on yourPATH.mockingtogether with its test module shows some aspects of how to use mocking in Python.