Program Analysis Credits: 4 Pre-requisites: Strong Java Programming, Data Structures. Post Condition (on student capability after successfully completing the course): At the end of the course the student should be able to: Specify properties of interest using various formalisms. Apply static analysis techniques including dataflow analysis and develop static analyses with the help of tools such as Soot. Develop aspects and use runtime monitoring tools such as JavaMOP to analyze programs dynamically. Brief Description Ensuring program correctness can be very challenging. Programmers depend on testing to build some confidence in the expected behavior of programs. Although testing is useful, the complexity as well as the criticality of modern software demands more rigorous techniques, in addition to testing to ensure software correctness. The properties that programs need to satisfy vary in terms of expressiveness from simple predicates that check the program states at specific points to regular expressions and context-free grammars that check the legality of traversed program paths. In this course, the students will learn about static analysis techniques, i.e., the techniques that can be applied to programs without running the programs as well as about dynamic analysis (or runtime monitoring) techniques that analyze programs during runtime. The students will learn about the strengths and weaknesses of both techniques and explore ways to combine them to increase their effectiveness. In the static analysis part of the course, the students will learn about dataflow analysis in detail. In addition, they will learn about abstract interpretation and will get introduced to more precise and computationally intensive path-sensitive techniques based on symbolic execution. We will primarily use Java as programming language and "Soot" as static analysis tool. In the dynamic analysis part, the students will learn to specify properties of interest and primarily use "JavaMOP" to build runtime monitors for those properties. In the process, they will learn to develop “aspects” used to instrument and monitor programs. In addition, the students will get introduced to various runtime monitoring tool architectures. In the second half of the course, the students will work on a class project in teams of two to develop either a challenging and novel analysis, which could be either static or dynamic, or hybrid. They will present their work in the class and will submit a project report. Week Topics Covered 1 2 3 Introduction - Overview Static Analysis – Fundamentals Static Analysis – Dataflow Analysis 4 5 6 Path-sensitive analysis: Symbolic Execution Runtime Monitoring: Property Specification Runtime Monitoring: Tool Architectures 7 8 9 Monitoring Performance and Challenges Monitoring Applications and Extensions Hybrid program analysis Written Assignment 10 11 Abstract Interpretation Advanced analysis topic Presentation Project Presentation Project Presentation Class project report 12 13 Nature of assignments / labs and (expected hours of work) or Programming assignment develop a dataflow analysis Written Assignment Programming assignment develop runtime monitors to to Project Evaluation For assessing the performance of students, the course will have written and programming assignments, in-class quizzes/tests, a mid-sem exam, and a class project. Weights of each of these elements could be: Class Participation: 5% Written Assignments and Tests/quizzes: 20% Mid-sem Exam: 15% Class Project: 30% Programming Assignments: 30% Grading Scheme Grading will be done according to the following formula: Final marks = class project marks * .30 + programming assignments marks * .30 + written assignment and quizzes marks * 0.20 + midterm exam marks * 0.15 + participation *.05 Texts/Other Resources There is no textbook for this course. Reference material will be provided from time to time in the class. In addition, following reference books would be useful. "Principles of Program Analysis" by Nielson, Nielson and Hankin. “Software Testing and Analysis: Process, Principles and Techniques” by Pezze and Young.