XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai.

Slides:



Advertisements
Similar presentations
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Advertisements

A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
METHOD OVERRIDING Sub class can override the methods defined by the super class. Overridden Methods in the sub classes should have same name, same signature.
A Regression Test Selection Technique for Aspect- Oriented Programs Guoqing Xu The Ohio State University
Lecture 2: Object Oriented Programming I
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L13 (Chapter 21) Generics.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
RubyPolish: Static Bug Detection in Ruby Programs John Locke Alex Mont.
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Regression Test Selection for AspectJ Software Guoqing Xu and Atanas.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University A Framework for Source-Code- Level Interprocedural Dataflow Analysis.
Aspect-Oriented Software Development (AOSD) Tutorial #3 AspectJ - continued.
CSE 6329 Project Team 1 Aliasgar Kagalwala Aditya Mone Derek White Dengfeng (Thomas) Xia.
Brian de Alwis and Gail Murphy Dept of Computer Science University of British Columbia, Canada Presented at the International Conference on Software Engineering.
Java 程序设计 Java Programming Fall, Contents for Today Java Program Structure  How to Compile a Java Program  How to Run a Java Program Environment.
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Debugging Support.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
Developing Adaptive J2ME Applications Using AspectJ Ayla Débora and Paulo Borba {add, Centro de Informática - UFPE.
Generics In Java 1.5 By Manjunath Beeraladinni. Generics ➲ New feature in JDK1.5. ➲ Generic allow to abstract over types. ➲ Generics make the code clearer.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Change Impact Analysis for AspectJ Programs Sai Zhang, Zhongxian Gu, Yu Lin and Jianjun Zhao Shanghai Jiao Tong University.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Adding Trace Matching with Free Variables to AspectJ Chris Allan, Pavel Avgustinov, Sascha Kuzins, Oege de Moor, Damien Sereni, Ganesh Sittampalam and.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
CMCD: Count Matrix based Code Clone Detection Yang Yuan and Yao Guo Key Laboratory of High-Confidence Software Technologies (Ministry of Education) Peking.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
Automatic Identification of Bug-Introducing Changes. Presenter: Haroon Malik.
Debug Concern Navigator Masaru Shiozuka(Kyushu Institute of Technology, Japan) Naoyasu Ubayashi(Kyushu University, Japan) Yasutaka Kamei(Kyushu University,
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
BUILD ON THE POLYGLOT COMPILER FRAMEWORK MIHAL BRUMBULLI 7th Workshop “SEERE” Montenegro-Risan 9-14 September 2007 SimJ Programming Language.
Mixing integer and floating point numbers in an arithmetic operation.
Architectural Point Mapping for Design Traceability Naoyasu Ubayashi and Yasutaka Kamei Kyushu University, Japan March 26, 2012 FOAL 2012 (AOSD Workshop)
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
Region Pointcut for AspectJ Shumpei Akai Shigeru Chiba Muga Nishizawa.
Exploiting Code Search Engines to Improve Programmer Productivity and Quality Suresh Thummalapenta Advisor: Dr. Tao Xie Department of Computer Science.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Inter-Type Declarations in AspectJ Awais Rashid Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
Slicing AspectJ Woven Code Luca Cavallaro Mattia Monga Antonio Castaldo D'Ursi Davide Balzarotti Politecnico di Milano.
AspectJ – AOP for Java Tom Janofsky. Instructor at Penn State Abington Consultant with Chariot Solutions JUG Member.
Course Progress Lecture 1 –Java data binding: Basket example: UML class diagram -> class dictionary without tokens-> language design -> class dictionary.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Reducing Combinatorics in Testing Product Lines Chang Hwan Peter Kim, Don Batory, and Sarfraz Khurshid University of Texas at Austin.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming - Week.
Comparison of Different AOP Approaches Presented by: Xiaojing Wang.
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
SCoPE: an AspectJ Compiler for Supporting User-Defined Analysis-Based Pointcuts Tomoyuki Aotani Hidehiko Masuhara
Methods.
AOP with AspectJ Awais Rashid, Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
1 Aspectual Caml an Aspect-Oriented Functional Language Hideaki Tatsuzawa Hidehiko Masuhara Akinori Yonezawa University of Tokyo.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
ECE 750 Topic 8 Meta-programming languages, systems, and applications Automatic Program Specialization for J ava – U. P. Schultz, J. L. Lawall, C. Consel.
PPL 2004, Gamagori, AICHI1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech, Japan) Shigeru Chiba (Tokyo Tech, Japan)
Test Case Purification for Improving Fault Localization presented by Taehoon Kwak SoftWare Testing & Verification Group Jifeng Xuan, Martin Monperrus [FSE’14]
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Precisely Selecting Regression Test for Aspect-Oriented Programs Guoqing Xu The Ohio State University
Object-Oriented programming for Beginners LEAPS Computing 2015
Modern Programming Tools And Techniques-I
Chapter No. : 1 Introduction to Java.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Programming Language Concepts (CIS 635)
Testing Recap Testing can find problems, but cannot prove your program works Since exhaustive testing is impossible, select test cases with maximum likelihood.
Test Case Purification for Improving Fault Localization
Continuously Reasoning about Programs
Presentation transcript:

XFindBugs: eXtended FindBugs for AspectJ Haihao Shen, Sai Zhang, Jianjun Zhao, Jianhong Fang, Shiyuan Yao Software Theory and Practice Group (STAP) Shanghai Jiao Tong University, China

PASTE Is there any bug? public class A { public String s = "Initialize s"; public static void main (String args[]){ new A(); } public aspect B { pointcut beforeInitialize(A a):execution(A.new())&&this(a); before(A a):beforeInitialize(a){ if(!a.s.equals(“some value")) {…} } // Bug Pattern AFBI A code snippet in AspectJ a is null !! Has A been initialized? No !!

PASTE Bugs are common in AspectJ programs Why ? – Most AspectJ beginners are used to writing code with Java programming specification, which may not consist with AspectJ one. – AspectJ is a new paradigm, and AspectJ compiler is not so robust as Java compiler. XFindBugs: eXtended FindBugs in AspectJ Programs XFindBugs: eXtended FindBugs in AspectJ Programs

PASTE Outline Background Bug patterns in AspectJ Implementation issues on XFindBugs Empirical evaluation Related work Conclusion

PASTE Outline Background Bug patterns in AspectJ Implementation issues on XFindBugs Empirical evaluation Related work Conclusion

PASTE Background FindBugs – FindBugs is one of the most widely-used bug finding tools in Java community. – FindBugs analyzed all 89 publicly available builds of JDK and generated over 370 warnings. – There are totally 1127 warnings reported by FindBugs in Google’s Java code base.

PASTE An AspectJ program 1. public class C { 2. private int f1 = 0; 3. public void m (){ m1 ();} 4. public void m1(){} 5. } 6. public aspect A { 7. pointcut pc():call(* m1()); 8. before():pc(){ 9. System.out.println(“…");} 10. } 11. public aspect B { 12. private float C.f2 = 0.0f; 13. public int C.m2() {return 0;} 14. } Class Aspect Pointcut Advice Intertype-field Intertype-method Introduction Join Point PointcutAdvice Fields: f1, f2 Methods: m, m1, m2

PASTE Error-prone features in AspectJ programs Pointcut – Join point model in a lexical-level – Using wildcards in pointcut designators e.g., call (* *.*) Advice – Inconsistent advice invocation sequence – Proceed in around advice Introduction (Intertype-declaration) – Altering the original class hierarchy dramatically – Introducing a same field many a time

PASTE Outline Background Bug patterns in AspectJ Implementation issues on XFindBugs Empirical evaluation Related work Conclusion

PASTE Bug patterns in AspectJ Bug patterns in AspectJ * Pattern IDShort DescriptionCategoryPriority AFBIAccess Field Before Object InitializationAdviceMedium MOARMismatching Of After ReturningAdviceMedium SASingleton AspectAdviceHigh TROPThe Return Of ProceedAdviceMedium TNPThe Negated PointcutPointcutLow UIDUnchecked Intertype DeclarationsIntroductionMedium * The other 11 bug patterns could be found in our technical report. Table 1

PASTE TROP: The Return Of Proceed public interface I { public Integer i = new Integer(3); //  public static final } public aspect B { Integer around(int val): call(Integer.new(int))&& args(val) { Object result = proceed(val); //  assign twice return (Integer)result; } public class A implements I { public static void main(String[] args) {...} } 1 2

PASTE Outline Background Bug patterns in AspectJ Implementation issues on XFindBugs Empirical evaluation Related work Conclusion

PASTE XFindBugs Implementation Build on top of the FindBugs analysis framework Add corresponding bug detector for each bug pattern Search and compare the signature of bug pattern XFindBugs can support AspectJ compiler version 1.5 now.

PASTE Outline Background Bug patterns in AspectJ Implementation issues on XFindBugs Empirical evaluation Related work Conclusion

PASTE Empirical evaluation Research questions Subject programs Experimental procedures Experimental results Experimental conclusions

PASTE Research questions Do the bug patterns defined in this paper exist in real- world AspectJ applications? Can the tool XFindBugs find real potential defects? Can XFindBugs scale to large applications, or is there a real necessity for the usage of our tool?

PASTE Subject programs NameLOC#Advice#Pointcut#Introduction AJHotdraw AJHSQLDB GlassBox ajc Benchmarks Abc Benchmarks Design Patterns Table 2

PASTE Experimental procedures We extract the existing bug reports from AspectJ Bugzilla and run XFindBugs on the reported buggy code. We also run XFindBugs on the subject programs listed in Table 2.

PASTE Demo for finding bugs in AJHotdraw Finding bugs is easy! W. Pugh et al. [OOPSLA’ 04]

PASTE Experimental results Defects from AspectJ Bugzilla – Bugzilla number: , , , , , and – XFindBugs confirmed 7 bug instances. Defects in Subject Programs – XFindBugs reported 257 bug instances in all. – Among them, there are 1, 10, and 147 instances in GlassBox, AJHotdraw, and AJHSQLDB, respectively.

PASTE Some typical bug instances (1) #org.jhotdraw.ccconcerns.commands.UndoableCommand.aj 84: void around(DrawingView drawingView): callCommandFigureSelectionChanged(drawingView) { 85: AbstractCommand command = (AbstractCommand)thisJoinPoint.getTarget(); 86: command.hasSelectionChanged = true; 87: proceed(drawingView); 88: } Misuse Of GetTarget in AJHotdraw !! static metho d return null nullpointe r exception

PASTE Some typical bug instances (2) #glassbox.monitor.resource.JdbcMonitor.aj 182: before(Statement statement, String sql) : topLevelDynamicSqlExec(statement, sql) { 183: if (sql == null) { 184: sql = “I won’t be changed."; 185:} 186: : } The Scope Of Advice in GlassBox !! Warning !!

PASTE Experimental conclusions Overall false positive ratio is 8.0%. XFindBugs scales well to over 300KLOC. XFindBugs not only confirms the reported bugs, but also reports 257 previously unknown defects.

PASTE Related work Bug patterns – E. Allen [Bug patterns in Java] – E. Farchi et al. [PODC’ 03] – W. Pugh et al. [OOPSLA’ 04][PODC’ 04] [PASTE’ 07] Bug finding techniques – Partial verification R. Jhala et al. [POPL’ 02] – Dynamic slicing R. Gupta et al. [ICSE’ 03] – Formal proof B. Cook et al. [PLDI’ 06]

PASTE Conclusion XFindBugs supported a catalog of 17 bug patterns. XFindBugs can scale well and report a lot of warnings in real-world software systems. Future work – Identify more bug patterns in AspectJ – Refine our bug detectors in XFindBugs