Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.

Slides:



Advertisements
Similar presentations
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
Advertisements

Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
Software Engineering COMP 201
Programming Creating programs that run on your PC
Review Amit Shabtay. March 3rd, 2004 Object Oriented Design Course 2 Review What have we done during the course? Where to learn more? What is for the.
ASPECT ORIENTED SOFTWARE DEVELOPMENT Prepared By: Ebru Doğan.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Scripting Languages For Virtual Worlds. Outline Necessary Features Classes, Prototypes, and Mixins Static vs. Dynamic Typing Concurrency Versioning Distribution.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Debugging Support.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University ICSE 2003 Java.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A lightweight.
2006/09/19AOAsia 21 Towards Locating a Functional Concern Based on a Program Slicing Technique Takashi Ishio 1,2, Ryusuke Niitani 2 and Katsuro Inoue 2.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Refactoring.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Change Impact Analysis for AspectJ Programs Sai Zhang, Zhongxian Gu, Yu Lin and Jianjun Zhao Shanghai Jiao Tong University.
Aspect Oriented Programming Scott Nykl CSSE 411 Senior Seminar.
Extensible Plug-ins for Aspect-Oriented Programming Macneil Shonle*Ankit Shah.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development 1.
Chapter 06 (Part I) Functions and an Introduction to Recursion.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton February 28th, 2003 Advisor: David G. Hannay Client:
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Design and Implementation.
Aspect Oriented Programming Gülşah KARADUMAN.
SE: CHAPTER 7 Writing The Program
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
Virtual Support for Dynamic Join Points C. Bockisch, M. Haupt, M. Mezini, K. Ostermann Presented by Itai Sharon
1 An Aspect-Oriented Implementation Method Sérgio Soares CIn – UFPE Orientador: Paulo Borba.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Assertion with.
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
An OBSM method for Real Time Embedded Systems Veronica Eyo Sharvari Joshi.
Adaptive Software Kevin Cella Graduate Seminar 02/04/2005.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University July 21, 2008WODA.
Slicing AspectJ Woven Code Luca Cavallaro Mattia Monga Antonio Castaldo D'Ursi Davide Balzarotti Politecnico di Milano.
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Cage: A Keyword.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University A Slicing Method for Object-Oriented Programs Using Lightweight.
Understanding the Behavior of Java Programs Tarja Systa Software Systems Lab. Tampere Univ. Sookmyung Women’s Univ. PSLAB Choi, yoon jeong.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
Introduction to OOP CPS235: Introduction.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Extracting Sequence.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
ECE 750 Topic 8 Meta-programming languages, systems, and applications Automatic Program Specialization for J ava – U. P. Schultz, J. L. Lawall, C. Consel.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Metric-based Approach for Reconstructing Methods.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Computer System Structures
Software Engineering Lecture 7
Visit for more Learning Resources
Metrics of Software Quality
Chapter 1 Introduction to Computers, Programs, and Java
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Chapter 7 –Implementation Issues
AspectAda Aspect-Oriented Programming for Ada95
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
Presentation transcript:

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program Slicing Tool for Effective Software Evolution Using Aspect-Oriented Technique Takashi Ishio Shinji Kusumoto Katsuro Inoue Osaka University {t-isio, kusumoto,

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Background In software evolution process, software is modified to adapt for the changes of its specification. When a programmer changes structure and functions of a software, several bugs are usually injected. Debugging is an important task in software evolution.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Debugging Large Scale Software Large scale software is difficult to debug. Especially, fault localization needs much cost since the location where a program crushed is not always close to the fault. Executed codes for one test case are usually small pieces of the program. Excluding automatically unrelated codes is effective for fault localization.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program Slicing Program Slicing extracts a slice of codes, which affects value of a specific variable. Program Slicing excludes unrelated codes to aid fault localization. a slice based on slice criteria ( 6, b ) 1: a = 5; 2: b = a + a; 3: if (b > 0) { 4: c = a; 5: } 6: d = b; 1: a = 5; 2: b = a + a; 3: if (b > 0) { 4: c = a; 5: } 6: d = b;

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Slice Calculation Process Phase 1: Extraction of dependence relations Data Dependence Relation: assignment  reference Control Dependence Relation: conditional statement  controlled block Phase 2: Construction of Program Dependence Graph node: a statement. edge: a dependence relation Phase 3: Traversal of PDG traversal backward from a node corresponding a slice criteria 1: a = 1; 2: c = 4; 3: b = a; 1: a = 1; 2: c = 4; 3: b = a; a Data Dependence 4: if (a < 1) { 5: b = a; 6: } 4: if (a < 1) { 5: b = a; 6: } Control Dependence Program Dependence Graph slice criteria

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Dependence-Cache (DC) slicing using dynamic information In slice calculation process, information about the statements actually executed is effective to decrease the slice size. Dynamic information excludes unexecuted codes from a slice. Dependence-Cache (DC) slicing method uses: Dynamic Data Dependence Analysis Static Control Dependence Analysis DC slicing calculates an accurate slice with lightweight costs.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Implementation of dynamic analysis Dynamic analysis, collecting dynamic information during program execution, is a kind of logging (or tracing). Java Virtual Machine (JVM) Customization † +JVM can access all information of the runtime environment. -Customization depends on a specific JVM implementation. -Byte code optimization may affect analysis results. Java Debugger Interface (JDI) +JDI can access local variables, stack traces,... -High runtime cost Threads of control are blocked for each logging point. Although various ways exist in implementing the dynamic analysis, each one requires a high cost in implementation or in runtime. † F. Umemori et al.: “Design and Implementation of Bytecode-based Java Slicing System”, SCAM 2003 (to appear)

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Aspect-Oriented Programming A key feature of Aspect-Oriented Programming is separation of crosscutting concerns. AOP introduces a new module unit named aspect. In OOP, programmers cannot encapsulate crosscutting concerns: logging, error handling, some design patterns Programmers distribute many call statements into related classes for object interaction. It is hard to manage the distributed codes. In AOP, programmers write a crosscutting concern in an aspect. An aspect has information when the aspect is executed. Call statements are needless. When a concern is changed, programmers modify one aspect instead of related classes. AOP improves modularity, maintainability and reusability.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Example of Aspect Logging: “Logs a method name for each method execution.” In OOP, logging codes are distributed in all classes. If logging specification is changed, programmers may modify all classes. In AOP, logging codes are encapsulated in the Logging Aspect. It is easy to maintain and reuse. Class C Class B Class A Logging Class Logging Aspect Class C Class B Class A logger.logs(value); when a method is executed, logger.logs(value) is called.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 AspectJ, an AOP extension for Java AspectJ: an AOP extension for Java An aspect is defined as a set of advices. An advice consists of a procedure and pointcut designators (PCDs). PCDs describe when the procedure is executed. AspectJ compiler: aspects + Java class source  Java bytecode

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Features of AspectJ AspectJ provides the following PCDs: Method Call and Execution Field Assignment and Reference Exception Handling An advice body is written in plain Java code. An advice can access context information through thisJoinPoint object. Context information is: Which method is actually executed ? What type of object is accessed ?

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 How to implement logging in AspectJ: aspect LoggingAspect { pointcut allMethods(): execution(* *(..)) && !within(java.io.*); before(): allMethods(){ Logger.println(thisJoinPoint.getSignature()); } Example of AspectJ keyword for Aspect definition When the advice is executed. Pointcut is defined by PCDs. Pointcut represents events during program execution. In the advice body, programmers can access context information via thisJoinPoint object. It is needless to change logging target classes.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Dynamic Analysis Aspect We implement dynamic analysis using AspectJ. Dynamic analysis aspect records a position of the assignment statement when a new value is assigned to a field, extracts a dynamic data dependence relation when the field is referred, collects method-call information for each thread (multi- threading), collects information when an exception is thrown and which handling clause caught the exception (exception- handling).

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Advantages of Aspect Approach Advantages Modularization of dynamic analysis Independent of a specific JVM implementation Independent of a byte-code optimizer ( JIT compiler ) Lightweight Analysis for large scale software. No local variables are dynamically analyzed. Local variables affects dependencies in one method. Little difference comes from dynamic information of local variables. No library classes are analyzed. We assume that library classes are reliable. less overhead: The aspect is linked to target program at compile time.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Aspect-based Dynamic Analysis and Slice Calculation System: ADAS Debugging Support Tool using Program Slicing for Java Dynamic Analysis Aspect (written in AspectJ) Simple logging-like Implementation size: about 1000 LOC Program Slicing System (written in Java) Program Slicing is an application using dynamic information. The prototype is implemented as Eclipse plug-in.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Architecture and Use Case of ADAS Java Source Dynamic Analysis Aspect Java Bytecode Java VM AspectJ Dynamic Info. Slice Calculation Tool program slice Static Info. slice criteria 3.execute a test case 1.edit 4.slice calculation Static Analyzer 2.compile

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Demonstration Slice calculation button Slice criterion selection Slice results indicated

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Evaluation: size of a slice Compare with customized JVM implementation † JVM approach: Precise DC Slice Our apparoch: omitting analysis for local variables. Target programs P1: A simple database (4 classes, 262 LOC) P2: A sorting program (5 classes, 228 LOC) P3: A slice calculation program (125 classes, about LOC) Our approach calculates a slice including some redundant code JVM can extract a precise slice using fine-grained information. AspectJVMAspect/JVM P P P size of a slice (LOC) † F. Umemori et al.: “Design and Implementation of Bytecode-based Java Slicing System”, SCAM 2003 (to appear)

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Evaluation: analysis cost Our approach shows good performance. Our approach is a coarse-grained, lightweight analysis. JVM approach is hard to apply a large scale software. Normal Execution Aspect Approach JVM Approach Aspect/NormalJVM/Normal P P P Running Time [seconds] ratio

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Evaluation: Cost of Implementation Aspect approach: Our module consists of the dynamic analysis aspect and data management classes. The total size is 1000 LOC. JVM approach: System consists of customized JVM and Java compiler. Customized compiler insert source code information into bytecode files. Size of additional code for the customization is about 50,000 LOC. Source code of the original JVM and compiler is 300,000 LOC. Programmers must re-customize the JVM whenever new version of JVM is released. Aspect approach is inexpensive.

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Remark and Future Work Debugging is an important task for software evolution. Program slicing shows related code to a user. Dynamic information exclude unexecuted code. Dynamic Analysis Aspect is simple implementation, easy to maintain, customize. Future Work Extension of ADAS to calculate AspectJ slice, Improvement of Usability.