Flexible, dynamic injection of structured advice using byteman

  • Authors:
  • Andrew E. Dinn

  • Affiliations:
  • Red Hat UK Ltd, Newcastle Upon Tyne, United Kingdom

  • Venue:
  • Proceedings of the tenth international conference on Aspect-oriented software development companion
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Byteman is a flexible, dynamic advice injection tool for Java. It uses an Event Condition Action rule script language to structure placement and control execution of injected Java code fragments. The Byteman agent can be loaded at application startup or into a running application and rules can be loaded, unloaded and reloaded while the application continues running. This makes Byteman ideal for use in live deployments, simplifying tracing and diagnosis of bugs and investigation and monitoring of performance issues. Byteman is also very useful during all stages of testing. Tests can inject rules into an application or subsystem during test initialisation or as the test progresses, redirecting or breaking the application code at strategic points and validating application behaviour. This limits the need to write harness or mock code, and minimises the extent to which the test distorts normal execution, ensuring that test conditions are as close to live running as possible. Byteman is being used widely within JBoss to perform unit, integration and system testing. Our customer support team use it to perform tracing, debugging and validation of JVM, JBoss and customer code, both inhouse and in live deployments. We are currently developing an extensible, reconfigurable statistical performance monitoring package for JBoss AS based on Byteman. We expect this to be easily extended by JBoss AS customers to enable monitoring of their own applications. This paper employs real examples of these use cases to demonstrate how Byteman works. It shows how Byteman makes advice injection simpler, quicker and more interactive than alternative tools without sacrificing power or rigour.