ASTA Aspect Software Testing Assistant Juha Gustafsson, Juha Taina, Jukka Viljamaa University of Helsinki.

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
Secure Systems Research Group - FAU Aspect Oriented Programming Carlos Oviedo Secure Systems Research Group.
Overview of AspectJ Aspect Oriented Software Development Seminar Technion presented by Oren Mishali.
Aspect-Oriented Programming. Procedural Programming Abstract program into procedures. Object-Oriented Programming Abstract program into objects. Aspect-Oriented.
Aspect-Oriented Programming In Eclipse ® Aspect-Oriented Programming in Eclipse with AspectJ Dr Helen Hawkins and Sian January.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
Aspect-Oriented Programming using Phoenix Marc Eaddy MSR Intern Columbia University.
Detailed Design Kenneth M. Anderson Lecture 21
An Untyped Calculus of Aspect- Oriented Programs Radha Jagadeesan Alan Jeffrey James Riely DEPAUL UNIVERSITY, CHICAGO.
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.
Aspect Oriented Programming Written by Michael Beder.
1 FM Overview of Adaptation. 2 FM RAPIDware: Component-Based Design of Adaptive and Dependable Middleware Project Investigators: Philip McKinley, Kurt.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development 2.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt
Software Testing.
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)
VERIFICATION OF ASPECT ORIENTED MODELS BY DON MARTIN JAYASHREE VENKIPURAM PATHANGI PIYUSH SRIVASTAVA REFERENCES F. Mostefaoui and J. Vachon,” Design level.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development 1.
Testing Workflow In the Unified Process and Agile/Scrum processes.
 FOAL 2010 Modeling Aspects by Category Theory Serge P. Kovalyov Novosibirsk, Russia.
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Using Aspects to Support the Software Process: XP over Eclipse Oren Mishali and Shmuel Katz Technion, Israel Institute of Technology.
POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.
Aspect Oriented Programming Gülşah KARADUMAN.
On the Modularity Assessment of Aspect- Oriented Multi-Agent Systems Product Lines: a Quantitative Study Camila Nunes
A Meta-Level Specification and Profile for AspectJ in UML Joerg Evermann School of Information Management Victoria University of Wellington.
1 Graph Coverage (4). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Introduction Better Faster Cheaper (pick any two) On-going issue that continues to motivate research in software engineering Applications: –continue to.
1 An Aspect-Oriented Implementation Method Sérgio Soares CIn – UFPE Orientador: Paulo Borba.
CSC 480 Software Engineering Lecture 15 Oct 21, 2002.
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
Adaptive Software Kevin Cella Graduate Seminar 02/04/2005.
Aspect-Oriented Action Semantics Descriptions Luis Menezes University of Pernambuco
Inter-Type Declarations in AspectJ Awais Rashid Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
Introduction to Software Testing (2nd edition) Chapter 7.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
CPSC 871 John D. McGregor Module 8 Session 1 Testing.
问题 Code scattering Blocks of duplicated code Blocks of complementary code, and different modules implementing complementary parts of the concern Code.
Aspect Oriented Security Tim Hollebeek, Ph.D.
aspectj tools new and noteworthy Mik Kersten University of British Columbia Adrian Colyer IBM Hursley OOPSLA, October
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
Aspect-Oriented Software Development (AOSD)
CS223: Software Engineering Lecture 21: Unit Testing Metric.
Inspections on Testing Aspect-Oriented Programs Rodrigo Manuel Lopes de Matos Moreira 4 th Doctoral Symposium on Informatics Engineering Porto, 6 th February.
Testing Integral part of the software development process.
Aspect-oriented Code Generation Approaches Abid Mehmood & Dayang N. A. Jawawi Department of Software Engineering Faculty of Computer Science and Information.
CPSC 372 John D. McGregor Module 8 Session 1 Testing.
Paul Ammann & Jeff Offutt
John D. McGregor Session 9 Testing Vocabulary
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
John D. McGregor Session 9 Testing Vocabulary
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
CS223: Software Engineering
Fundamental Test Process
Structuring Adaptive Applications using AspectJ and AOM
AspectAda Aspect-Oriented Programming for Ada95
Presentation transcript:

ASTA Aspect Software Testing Assistant Juha Gustafsson, Juha Taina, Jukka Viljamaa University of Helsinki

2/21 Motivation Cross-Cutting Concerns in Software Implementation modules Security Logging Persistence Cross-cutting concerns clutter the main class model

3/21 Logger log(s: String) out: OutputStream

4/21 An Example Money Transfer: Logical Level void transfer(Account from, Account to, int amount) { if (from.getBalance() < amount) { throw new InsufficientFundsException(); } from.withdraw(amount); to.deposit(amount); }

5/21 void transfer(Account from, Account to, int amount) { if (!getCurrentUser().canPerform(OP_TRANSFER)) { throw new SecurityException(); } Transaction tx = database.newTransaction(); if (from.getBalance() < amount) { tx.rollback(); throw new InsufficientFundsException(); } from.withdraw(amount); to.deposit(amount); systemLog.logOperation(OP_TRANSFER, from, to, amount); tx.commit(); } An Example Money Transfer: Implementation Details Security Logging Persistence

6/21 Solution Aspect-Oriented Programming (AOP) Separating cross-cutting concerns from the core concerns (i.e. from the main class model) Aspect = a definition of a cross-cutting concern  pointcut = a pattern that selects join points (i.e. elements that appear in method bodies)  advice = a method-like construct that is executed in the selected join points (before, after, around)  weaving = the process of attaching advice to the appropriate join points

7/21 An example AOP program HelloWorld in the AspectJ language Go to … … and watch the demo!

8/21 A new question arises How to test AOP? Do we test what we intend to test?  How to prioritise our tests?  How to pick a good testing strategy? When should we stop testing? In AOP these are especially difficult questions because  the execution context of an aspect depends on the (internal implementation of the) class it is woven to  relating a failure to the fault that causes it is difficult the control and data flows are not explicit a particular aspect weave order can cause problems

9/21 A new question arises How to test AOP? Visualising AOP testing is not straightforward  what kinds of test coverage criteria to use and visualise (is it sufficient to show that we have visited an aspect once, how to show the weaving context)?  current control flow graphs are insufficient to visualise the test execution paths in the presence of aspects  high-level coverage visualisation for AOP testing is a completely open question Yet, visualisation of AOP testing is (at least) as important as visualisation of traditional (OO) testing

10/21 Testing AOP Fault Sources Fault in the core concern code Fault in the (context independent) aspect code Fault created by interactions between the aspect and the core concern code Fault created when more than one aspect is woven into the core concern code

11/21 Testing AOP [Alexander, Bieman, Andrews, 2004] Fault Model & Additional Testing Required Incorrect strength in pointcut patterns  test the aspect Incorrect aspect precedence  test all weave orders Incorrect focus of control flow  use a form of condition coverage of pointcut designators Failure to establish expected postconditions  use the original test set to re-test all methods that have the aspect Failure to preserve state invariants  same as in previous Incorrect changes in control dependencies  same as in previous

12/21 AOP Testing Theory Coverage criteria Coupling metrics Control flow formalism …

13/21 Tool Support Tool support is essential for systematic testing Not many tools exist for AOP testing  coverage tools  visualisation tools  scripting languages & environments to automate AOP testing

14/21 Research Background Due to project RITA (fRamework Intgration and Testing Application) we have a strong background in white-box test execution and analysis RITA is intended for product family testing, but similar ideas and issues arise in AOP testing RITA as a prototype is not suitable for large- scale testing but its ideas are relevant

15/21 RITA Functionality Rita supports the following:  Java program testing  Product family or single application testing  JUnit and private test execution  Full support for data flow diagrams  Visualisation and white-box coverages on four levels: Method level: traditional coverages Object level: object and class coverages Package level: object coupling, reference coverages Application level: multiple application coverages

16/21 Lessons learned from RITA A White-Box Testing Software (WBTS) must support traditional code  RITA: not all applications are in product families  ASPECTS: not all applications use aspects WBTS should be integrated to a software development environment  While stand-alone software can have similar functionality than integrated software, usability issues favor the latter approach Code coverage is not sufficient in WBTS  The higher is the abstraction of testing, the more complex coverages are needed.  Even at code level code coverage gives weak results.

17/21 Aspect-Oriented Testing Tool Based on our experiences in RITA we propose the following requirements for an Aspect- Oriented Testing Tool (AOTT):  It has to support testing of traditional software  It must be integrated to a well-known and actively updated programming environment such as Eclipse  It has to support several levels of white-box testing including program-level, package-level, object-level, aspect-level, and method-level Aspect-level: testing and visualisation are inside a single aspect.

18/21 AOTT Requirements Continue More AOTT requirements:  It has to calculate static mesurements of the software: Lines of code (LOC) Aspects of code (AOC) Coupling between objects Depth of inheritance tree Depth of aspect tree (aspects in aspects) Coupling between code and aspects etc.  It has to support integration between dynamic test execution results and static measurements How? This is an open research question  Something else? Definitely! This is a work-in-progress list

19/21 Research directions [Alexander, Bieman, Andrews, 2004] Open Questions Can we measure test coverage after weaving?  also visualisation How do we test aspects that interact with the core concern code?  coupling between an aspect and core concern code as a measure of testability of the aspect How do we test aspects that interfere with each other?  inter-aspect coupling How do we test aspects whose effects must span more than one concern? Are there ways to test aspects on their own?  probably not… ? (Can we reverse engineer the weave process?)  how does this relate to testing

20/21 Validation How to validate that  Theory is correct?  Application is effecient? Alternatives:  Formalism  Empirical controlled experiments  Practical experiments in industrial settings All alternatives are  Relevant  Needed.

21/21 Summary To be written...