Program Monitoring

Course material for part II of CS 119 - Reliable Software: Testing and Monitoring

Caltech, third term 2009, Monday/Wednesday 2:30-3:55, Jorgensen 287


Klaus Havelund, Phone (cell): 650-814-0677, Email:

Teaching Assistant

Mihai Florian, Phone: 626-395-3552, Email:

Part I

Part I of this course on testing is taught by Alex Groce



Last day of class: Friday May 29, 2009.


This course offers an introduction to the theory and practice of program monitoring, or runtime verification as we shall call it. Runtime verification is the study of how to design artifacts for monitoring and analyzing program executions. Such artifacts can be used for a variety of purposes, including testing/program understanding and fault protection. Although programmers have written more or less ad-hoc monitors since the birth of the computer, only recently (last decade) has this areas achieved a status as a field on its own. In this course we shall specifically focus on notations for specifying properties of Java programs, and frameworks for monitoring such. The course will initially address the issue of program instrumentation and monitoring using aspect oriented programming and Java. This will not only provide the student with a new useful technology but will also motivate tools presented later in the course. At the end of the course the student will have gained insight into the important problems in the field and will have encountered a core selection of solutions for monitoring programs. The course will enable the student to apply monitoring in software development as well as initiate research in this field. Although the course focuses on Java, the ideas extend to other languages.

We will study 3 systems: AspectJ (lectures 2-3), JavaMOP (lectures 4-7,) and RuleR (lecture 8).


Lecture Plan

Lecture 1, Monday May 4 - Introduction

Lecture 2, Wednesday May 6 - Introduction to AspectJ

Lecture 3, Monday May 11 - Monitoring with AspectJ

Lecture 4, Wednesday May 13 - State Machines and Regular Expressions

Lecture 5, Monday May 18 - Parameterized State Machines and Regular Expressions

Lecture 6, Wednesday May 20 - Temporal Logic

Lecture 7, Friday May 29 - Context Free Grammars

Note 7 contains an additional last assignment 3 (easy if you solved assignment 2) due Friday June 5.

Lecture 8, Rule-Based Systems

This class was not be held. Slides appear below for those interested.