University of Malta

Runtime Testing Tutorial
UOM Main Page
Apply - Admissions 2016
Campus Map button

Runtime Testing - From Assertions to Monitors

No matter how much effort is put into testing, one can never be sure that the system under test will behave according to the requirements. Typically, once the system is deployed, little or no checking is performed to ensure that the system has not deviated from the expected behaviour. If the system does deviate, the system administrator might not be able to immediately detect any problems. For example a few pence’ error in financial transactions originating from a particular country might go unnoticed for a long while until an audit discovers an accumulated discrepancy. The solution to this problem is to somewhat perform an ongoing audit of the system’s behaviour where any deviations are instantly visible.

Many test engineers are familiar with the concept of an assertion - explicitly stating assumptions which should hold throughout a system’s execution and automatically raising an alarm if an assumption fails. Indeed, assertions do provide a means of ongoing auditing but they are severely limited in the expressive power they provide. Using only basic assertions, simple checks would quickly clutter the code they are meant to check.

This tutorial starts by exposing the challenges of expressing non-trivial checks using basic assertions. Subsequently, you will be able to experiment with incrementally complex assertions and shown how these can be elegantly expressed using aspect-oriented programming techniques. Towards the end of the tutorial, the use of aspect-oriented programming is superseded by a specialised monitoring tool which simplifies the task of specifying assertion logic even further. By the end of the tutorial you will experiment with LarvaLight and would hopefully appreciate the benefits of using monitors to test a system at runtime. 

The resources and instructions below should help you get started: 

1. Download Java JDK installer (version 5 or higher) from Oracle website and install
2. Download Eclipse Juno (Classic) version 4.2 from 
3. Tutorial guide [PDF
4. RV tutorial Eclipse project (with tutorial examples and solutions) [ZIP]
5. Presentation [PPTX-ZIP]

1. Install JDK
2. [AspectJ installation] Run Eclipse -> (from top menu) Help -> Install New Software -> Add... (top right) -> insert "" -> follow the wizart to completion
3. [Tutorial project setup] Run Eclipse -> (from top menu) File -> Import... -> General -> Existing Project into Workspace -> Select download 4 above (after unzipping) -> Finish

Serving suggestion: 
[Test setup] Run Eclipse -> Open the file "solutions._5_trace.banking.Central" from the imported project -> Press the "play" (green) button and select AspecjtJ/Java Application. Finally check that the console output shows no errors (text in red)

Ongoing projects page updated
We are proud to present our team of graduates and postgraduates and the list of projects we are currently working on. Click <Ongoing Projects> to find out more...
LarvaLight tool launched
Visit the <LarvaLight tool page> for more information
Interested in collaborating?
Checkout our industry collaboration models <here>
Last Updated: 30 September 2018

Log In back to UoM Homepage