02242: Program Analysis

Autumn 2024

Christian Gram Kalhauge

1. The Course

In this course, you, the student, will become familiar with different ways of deriving facts from programs, using both dynamic and static analyses. The course will focus on analyses for the JVM, but the students are encouraged to work on any language they want. The theoretical part of the course will be covered in the first half of the course; after which the students should write a proposal for a group project. Finally, the students will carry out experiments verifying their ideas, which they will write up in a paper and present orally.

1.1. Expectations and Didactic Contract

DTU sets the expected workload of one ETCS point to 28 hours. Since this is a 7.5 ETCS point course over 13 weeks + 1 week exam, one should expect to use 14 hours on this course a week, 4 of which are in class.

Participation in the class or doing the assignments are not mandatory. However, they are the primary way we convey the material of the class. It will be very hard to pass the course without engaging with the material.

1.2. Teaching Style and Philosophy

Personally, I've never found lectures or reading as a great way to learn. So my teaching philosophy is a little different than others. Essentially, it can be Core to my teaching philosophy is the phrase:

You only learn from your mistakes.

Essentially, no matter what a student is presented with, if will not be absorbed unless it is needed by the student to fill gabs in their understanding. The gabs in their understanding is only found through failure.

The goal of the teacher is to present the students with challenges to overcome, help them to learn when they fail, and support them when they give up.

1.3. The Learning Objectives

A student who has met the objectives of the course will be able to:

LO1explain the concepts for soundness and completeness and the limitations of program analysis;
LO2explain the benefits and tradeoffs associated with syntactic, semantic, dynamic and static analyses;
LO3design an analysis to solve a specific problem;
LO4formulate theoretical guarantees and limitations of the analysis;
LO5argument for the approach in a project proposal;
LO6implement an analysis for part of a real programming language;
LO7design and motivate a series of experiments using this analysis and interpret the results obtained;
LO8communicate their results in a clear and precise manner in a paper format; and
LO9achieve the above goals in a group effort while at the same time maintaining individual accountability.

1.4. Feedback

This course is still in its infancy, feedback is therefore crucial to make it better for generations to come. You are welcome to send suggestions to chrg@dtu.dk or anonymously on this Google Form.

2. The Lectures

Because of my Teaching Philosophy, I like to focus on practical work and collaboration. The lectures are therefore structured different than what you might be used to.

2.1. The Groups

In the class there are going to be three group formations, the Feedback Group, the Work Group, and the Project Group.

2.2. The Structure

Every lecture (except the first) is structure like so:

13:00Peer-feedback in groups (20 min)
13:20Communal feedback (10 min)
13:30Introduction of new problem (15 min)
13:45Getting started (45 min)
14:30The theory (60 min)

2.3. The Schedule

The lectures are on Mondays at 13:00 to 17:00. This is a tentative list of topics and might change.

NoDateTopic
012024-09-02Introduction
022024-09-09Syntactic Analysis
032024-09-16Semantics
042024-09-23Dynamic Analysis
052024-09-30Bounded Static Analysis
062024-10-07Recap / Project / QA
--2024-10-14Autumn holiday
072024-10-21Self Study // Feedback From Proposals
082024-10-28Unbounded Static Analysis
092024-11-04Concolic Execution
102024-11-11How to write a good paper
112024-11-18Self Study // Peer Feedback On Papers
122024-11-25Context Sensitive Analysis
132024-12-02Q/A & How to-do a good presentation
--2024-12-10Exam

3. The Game

During the course we'll use different tools to try to solve the same problem, namely get the best score in the JPAMB benchmark suite, in the shortest amount of time.

The rules are available in the README of the project.

4. The Finals

Your final grade will be based on a paper handed in by your project group, by the end of the course, which is defended as a group at the oral presentation. The paper should describe the results of project done during the last half of the semester.

The project has the following timeline:

DateAction
2024-10-23Last day to hand in proposal
2024-11-29Project Paper Due
2024-12-10Exam day 1
2024-12-11Exam day 2
Figure: The project timeline

4.1. The Project

The first thing you should do is find an interesting topic. The topic should be centered around program analysis, and should demonstrate your understanding of the course. You can either do an application project which applies some the techniques you have learned into a novel domain, or an foundational project which explores and improves the techniques themselves.

Every project should:

A list of interesting topics, but not limited to:

If you can't come up with an interesting project, then you can always fallback on the following topic:

Implement a semantic or hybrid technique from the course, and extend it, and evaluate the extensions against the JPAMB.

4.2. The Proposal

Before starting on the project, you have to hand in a project proposal. The project proposal is 1 - 2 pages and correspond roughly to the introduction of your final paper. It should formatted using the ACM small format, and will be evaluated on the following parameters, on a score (4-0):

You need to score at least 12 points and none of the parameters can be 0, to be able to hand in the final paper.

If your proposal are rejected you have to resubmit (even after the deadline). The proposals are graded as you submit them, so you do not have to wait to the last day.

4.3. The Paper

The paper should be at most 10 pages, excluding references. It must be formatted using the ACM format in acmsmall mode. To be sure to adhere to the format, and for hints about the structure you should use the template on learn.

Before you continue writing the paper, consider the advice in this lecture, by Simon Peyton Jones.

The final paper should contain the following sections (approximate page numbers in parentheses):

4.4. The Proceedings

The papers will (on a voluntary basis) be collected in a proceedings, which is shared among all students and with the generations to come. Furthermore, every semester a paper will get the best paper award, which will be indicated in the proceedings.

4.5. The Oral Presentation

Finally, the projects are presented orally. The oral presentation follows the plan on DTU Learn. Each group gets 15 minutes to do presentation of their project, after which 2 minutes are allotted per group member for questions.

The questions can cover all of the course material, especially the questions asked in class, and the project.