Loading...
Please wait, while we are loading the content...
Similar Documents
PointcutDoctor : IDE Support for Understanding and Diagnosing Pointcut Expressions [ AOSD 2007 demonstration proposal ]
| Content Provider | Semantic Scholar |
|---|---|
| Author | Ye, Lingdong Volder, Kris De |
| Copyright Year | 2007 |
| Abstract | Writing correct AspectJ pointcuts is hard. This is partly because of the complexity of the pointcut language and also partly because it requires understanding how the pointcut matches across the entire code base. In this demonstration we present PointcutDoctor, an extension of AJDT tools which helps developers write correct pointcuts by providing immediate diagnostic feedback. PointcutDoctor provides several kinds of information for a given pointcut. Firstly it shows which join points (shadows) the pointcut matches or doesn’t match. This helps a developer to verify whether her pointcut is correct. Furthermore, PointcutDoctor also provides an explanation of why the pointcut matches or does not match a given join point(shadow). This information helps a developer diagnose the cause of problems—unintended matches or failures to match certain join points—in her pointcut. 1. PROBLEM STATEMENT, MOTIVATION Pointcuts in general and AspectJ pointcuts in particular are hard to write. To write a correct pointcut, a developer needs to understand the subtleties of the pointcut language as well as how the pointcut matches against various program elements across her entire code base. We present PointcutDoctor, an IDE based tool that helps developers write correct pointcuts by providing them with easy access to the right kind of information. This information helps developers by making it easier for them to: 1. ascertain whether a given pointcut is correct (or not) 2. diagnose and correct problems if and when they are discovered Ascertaining that a pointcut is correct in a given code base means understanding how this pointcut matches join points across the code base [4]. This requires a global understanding of the code at a level of detail that is not easy to obtain or remember for developers. Fortunately, developers can be assisted by IDE-based tools that provide an explicit representation of the join points a pointcut matches in a given code base. AJDT [1] already provides some useful information in this regard. However, we claim that AJDT has a kind of “blind spot”: the information provided by AJDT is insufficient for a developer to determine a pointcut’s correctness. We illustrate this problem with a concrete example: pointcut threadCreation(Runnable worker) : call(Thread.new(Runnable)) && args(worker); Assume that a developer formulated this pointcut to capture the creation of all Thread instances from an instance of Runnable. How would the developer know this pointcut is correct? Since the intention is to capture all creations, verifying correctness means ascertaining that there are no accidentally missed creation sites. We argue that AJDT does not provide the right kind of information for the developer to make this determination. Indeed, AJDT’s cross references view only shows which join point shadows produce join points matched by the pointcut, but it does not show any explicit information about join points that are not being matched. This is an important “blind spot” and as a result the view is rather unhelpful in discovering unintended misses. Indeed, it is hard for a developer to scan a list of matches and realize that something that should be there isn’t. However, as our example illustrates, this kind of determination, is often critical in understanding whether a pointcut is correct. There are actually 5 Thread constructors that have a Runnable parameter: This example was taken from [5] |
| File Format | PDF HTM / HTML |
| Alternate Webpage(s) | http://pointcutdoctor.cs.ubc.ca/downloads/proposal.pdf |
| Language | English |
| Access Restriction | Open |
| Content Type | Text |
| Resource Type | Article |