new component-based self-adaptive system and contract extractionltahvild/courses/ece750... · 2007....

34
Component-based Self-Adaptive System and Contract Extraction Presentation for ECE 750 - 11 Component-Based Software Systems Instructor: Dr. Ladan Tahvildari Presented by: Shaojun Yu, Bob Luo, Hua Zhao July 12, 2007

Upload: others

Post on 09-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Component-based Self-Adaptive Systemand Contract Extraction

Presentation for ECE 750 - 11 Component-Based Software Systems

Instructor: Dr. Ladan Tahvildari

Presented by: Shaojun Yu, Bob Luo, Hua Zhao

July 12, 2007

Page 2: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

OutlineIntroduction

BackgroundSelf-Adaptive System and Autonomic ComputingArchitecture of Self-Adaptive System

General Description of ApproachProblemSolutionRelation worksContract Definition Language (CDL)

Approach Used in the Applicationstep 1: Application domain (Duke’s Bank) step 2: Contraction extraction step 3: Building repositorystep 4: Comparison

Results got till now Future workReferences

Page 3: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

IntroductionBackground• Growing Complexity of the systems and the applications

(design, install, configure, tune, maintenance) • Growing cost and time for administrations• Need more skilled professional• Manual operation means error-prone• Can’t stand up with catastrophic failure of critical

systems (fire alarm system, business system)

Page 4: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

IntroductionSelf-Adaptive software• Software that evaluates its own performance and changed

behaviour when the evaluation indicates that it is not accomplishing what the software is intended to do, or when better functionality or performance is possible (DARPA -- Defense Advanced Research Projects Agency, 1997)

Autonomic computing (AC)• an approach to self-managed computing system with a minimum

interference or intervention from users• Autonomic computing systems have the ability to manage

themselves and dynamically adapt to change in accordance with business policies and objectives. Self-managing systems can perform management activities based on situations they observe or sense in the IT environment.

• Introduced by IBM, 2001 (Paul Harn)

Page 5: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

IntroductionAutonomic Computing (AC)• Essence of AC is system self-management.• Four general properties of self-configuring, self-healing, self-

optimizing and self-protecting. (self-CHOP)

Page 6: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Reference Architecture of AC

IBM Blueprint

2004

Introduction

Page 7: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Autonomic ManagerIntroduction

Page 8: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

OutlineIntroduction

BackgroundSelf-Adaptive System and Autonomic ComputingArchitecture of Self-Adaptive System

General Description of ApproachProblemSolutionRelation worksContract Definition Language (CDL)

Approach Used in the Applicationstep 1: Application domain (Duke’s Bank) step 2: Contraction extraction step 3: Building repositorystep 4: Comparison

Results got till now Future workReferences

Page 9: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Problem in self-adaptive systemWhat happens if one component

doesn’t behavior correctly:

Select some components which have same functionalities

Pick up one with same or better quality to replace the broken component

Solution:

A detail, precise and formalized component interface is needed.

A

C

B

DX

Page 10: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Solution -- Component Contract

Interface

(contract)client supplier

Allowable client usage Expected results, behave, qualities

Contract is a detail and precise component interface, that can be defined with formalized language. It encompasses functional and non-functional properties of a component

The concept was taken from business world • Obligations and benefits

Page 11: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Specification should be concise for not only functional but also non-functional properties

All the information client needs for using componentDetail enough: should not be ambiguousNot over-specification: restrict future enhancements or evolution

Should be formalized so that it is easy to access

Should be focus on close componentProvide a meaningful contract for an open component without considering the context-of-use is impossible

Solution-- Define Component Contract

Page 12: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Related Works

Design by Contract: Bertrand Meyer, 1992To increase the reliability and correctness of object-oriented (OO) software by introducing a set of principles to deal with software errors systematically

Beugnard et al.: Four level contract Basic: IDLBehavioral: Pre- and Post-conditionSynchronization: Quality-of-Service (QoS): Performance

Nikola and Miroslaw: Component CDL Design a new, component-oriented language that features in its syntactic and semantics the various specification component clients need

Page 13: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Contract Definition Language (CDL)

Base:• Method & event

contract• Functional• Nonfunctional

Benefits:• Reuse• Comparing

components• Composability

Page 14: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Contract Extraction

Why do extractionContracts are not a part of modern software engineering and they are not defined explicit in most languages.

Existing extraction methodsStatic: which examines source code and documentation, etc.; Dynamic: which is based on examination of component’s execution.

Our extraction methodWe got the idea from CDL language;Do static extraction for functional property with javadoc, source code;Do dynamic extraction for nonfunctional property with Jprofiler, Jmeter, Eclipse.

Page 15: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

OutlineIntroduction

BackgroundSelf-Adaptive System and Autonomic ComputingArchitecture of Self-Adaptive System

General Description of ApproachProblemSolutionRelation worksContract Definition Language (CDL)

Approach Used in the Applicationstep 1: Application domain (Duke’s Bank) step 2: Contraction extraction step 3: Building repositorystep 4: Comparison

Results got till now Future workReferences

Page 16: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Approach Used in Application

Description:

In the approach, we intend to use formalized contracts to help component selection for self-adaptation systemWe use Duke’s bank as our application environmentWe apply semi-automatic method to extract contracts from Duke’s bank and put these contracts into a component contract repositoryFinally, we try to simulate Autonomic Manager to select component from the repository base on certain criteria. Consequently, make self-adaptation possible for the system

Page 17: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Approach Used in Application (cont.)

Promised result:Extract contracts from a specific domain;Make component selection and evaluation easier;

Page 18: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Approach Used in Application (cont.)Componentcomposition

Running contracts

Alternative contracts

STEP 4:Comparison

Storecontracts

In XML style

Form Repositorydatabase

STEP 3:Repository

Functionalcontacts

Nonfunctionalcontacts

STEP 2:Extraction

Duke’s bankSTEP 1:Application

Page 19: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Approach Used in Application (cont.)STEP 1: Choose application

Why use Duke’s Bank domain?Open source code

It is an banking application from SUN, very easy to get everything like tutorial, document, source code etc.;

Simple J2EEDemonstrates all the J2EE component technologies--enterprise beans, J2EE

application clients, and Web components.

How to deploy Duke’s BankDuke’s bank application in J2ee 1.4 tutorialJboss 4.0xApache Ant 1.52J2SE 1.5, J2EE 1.4

Page 20: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

STEP 1 (cont.)

Client layer:Application client:Administer customers and accounts Web client: Used by customers to access account information and perform operations

Server layer:Session beanEntity bean

DB:Store data of client

Duke’s bank application structure

Page 21: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Approach Used in Application (cont.)

STEP 2: extraction

Dynamic

JproflierJmeterEclipse

Junit

Deployment descriptor;Application server configuration files ;

Dynamic simulation

SecurityPerformance

InvocationEtc.

Nonfunctional

Documentation, constructors, implemented interfaces, base class

Invariant

Documentation, returns of exported methods

Postcondition StaticXMLSpyJavadoc

Documentation, exception, input parameters

Precondition

Functional

MethodToolsLocationContract type

Page 22: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Approach Used in Application (cont.)

STEP 3: Repository

We use CDL to formularize these contracts and form a contracts repository in a database environment or XML styles.

Repository

Contracts database

XML

Alternative contracts

Running contracts

Page 23: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Approach (cont.)

STEP 4: ComparisonAdaptation Management can make a comparison and then run replacement.

Automatic comparison done by

Adaptation Management

Manual comparison

A

C

B

D

NEW

A

NEW

B

D

Page 24: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Summary of Approach

Location Repository Comparison

Approach

Result

Component

selection

Extraction

Component

composition

Page 25: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

OutlineIntroduction

BackgroundSelf-Adaptive System and Autonomic ComputingArchitecture of Self-Adaptive System

General Description of ApproachProblemSolutionRelation worksContract Definition Language (CDL)

Approach Used in the Applicationstep 1: Application domain (Duke’s Bank) step 2: Contraction extraction step 3: Building repositorystep 4: Comparison

Results got till nowFuture workReferences

Page 26: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Successfully deploy Duke’s bank application

Page 27: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Duke’s bank

Page 28: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Respone time of EJB’s Method

Page 29: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

JProfilerJProfiler is an award-winning all-in-one Java profiler. JProfiler'sintuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues.

Page 30: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

XML SpyUse XML Spy to analyze the structure of CDL schema, and use CDL language to extract contracts from our application.

Page 31: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

XML SpyUse XML Spy to extract contracts from Duke’s bank EJB.

Page 32: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Future work

Extract more reliable and formal nonfunctional contracts from Duke’s bank application;

Form a repository ;

Make a virtual Autonomic Manager which can just operate comparison of running and alternative contracts in J2EE environment.

Page 33: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Main ReferencesKephart J, Chess D. The vision of autonomic computing. IEEE Computer 2003, 36, pp41–50.Steve R. White, James E. Hanson, Ian Whalley, David M. Chess, and Jeffrey O. Kephart. An Architectural Approach to Autonomic computing , IBM Thomas J. Watson Research Center, ICAC’04.Roy Sterritt, Manish Parashar, Huaglory Tianfield, Rainer Unland. A concise introduction to autonomic computing. Advanced Engineering Informatics 19(3): 181-187 (2005) IBM. an architectural blueprint for autonomic computing, 2004M. Sadjadi, P. McKinley and B. Cheng, Transparent Shaping of Existing Software to Support Pervasive and Autonomic Computing, In proc. of DEAS workshop, USA, 2005Nikola Milanovic, Miroslaw Malek. Extracting Functional and Non-functional Contracts From Java Classes and Enterprise Java Beans. Proceedings of the Workshop on Architecting Dependable Systems (WADS 2004) at the International Conference on Dependable Systems and Networks (DSN 2004), Florence, Italy, 2004Karine Arnout, Bertrand Meyer. Extracting implicit contracts from .NET components. Microsoft Research Summer Workshop 2002, Cambridge, GB, 9-11 September 2002EdEd Mancebo, Anneliese Andrews. A Strategy for Selecting Multiple Components 2005 ACM Symposium on Applied ComputingBertrand Meyer. Applying “Design by Contract”. Computer, 25(10):41-51, October 1992Bertrandt Meyer: Contracts for Components. Software Development Magazine, July 2000.Matthew Hoyt: A Framework for Software Component Interface Specification and Analysis, 2001

Page 34: New Component-based Self-Adaptive System and Contract Extractionltahvild/courses/ECE750... · 2007. 7. 12. · Contract Extraction Why do extraction Contracts are not a part of modern

Thank you!