A formal approach for fostering component reuse and managing - - PowerPoint PPT Presentation

a formal approach for fostering component
SMART_READER_LITE
LIVE PREVIEW

A formal approach for fostering component reuse and managing - - PowerPoint PPT Presentation

A formal approach for fostering component reuse and managing software change Abderrahman MOKNI, Marianne HUCHARD, Christelle URTADO, Sylvain VAUTTIER et Huaxi (Yulin) ZHANG SATToSE 2014 1 11/07/2014 Context and problematic


slide-1
SLIDE 1

Abderrahman MOKNI, Marianne HUCHARD, Christelle URTADO, Sylvain VAUTTIER et Huaxi (Yulin) ZHANG

A formal approach for fostering component reuse and managing software change

11/07/2014 1 SATToSE 2014

slide-2
SLIDE 2

Context and problematic

 Component-based software engineering (separation

  • f concerns, software in the large, complex systems,

…)

 Reduce development time and costs,  Reduce maintenance costs (usually takes 60%).

 Challenges:

 A better reuse,  A better evolution handling (unanticipated changes),  A better software architecture documentation.

=> Need for formal mechanisms to improve software reuse and automatically handle architectural changes.

2 11/07/2014 SATToSE 2014

slide-3
SLIDE 3

Outline

 The reuse approach  The formal approach  Intra-level rules  Inter-level rules  Evolution rules and process  Conclusion and perspectives

3 11/07/2014 SATToSE 2014

slide-4
SLIDE 4

Definitions

4

 Software Architecture: blueprint of the software

system (design decisions, strcucture, interactions).

 Components: encapsulates data and functionalities.  Interfaces: abstraction of component services

(required and provided).

 Connections (connectors): connect components to

each other.

11/07/2014 SATToSE 2014

slide-5
SLIDE 5

The reuse approach [Zhang 2010]

Component code storage and indexation Component development and documentation Component code & models Component repository

Component design for reuse

Lifecycle step Production

Component-based software design by reuse

Lifecycle step

System requirement analysis Architecture specification Architecture configuration Instantiated component assembly

Production

Functional & non- functional requirements Abstract architecture description Concrete architecture description Instantiated assembly description & software Component search Component instantiate Caption: Uses Produces Precedes

5

slide-6
SLIDE 6

Architecture levels

 Specification level

 Architecture as intended by the architect and conform to user

requirements

 Component roles: partial and ideal description of software

components

 Used to guide the search for concrete components.

 Configuration level

 A concrete implementation of the software  Concrete component classes selected from repositories

 Assembly level

 Description of the architecture at runtime  Parameterized component instances

6 11/07/2014 SATToSE 2014

slide-7
SLIDE 7

Running example : Home automation software

HomeOrc hestrator

ILight ITime ITherm ICon

Interface types and their signatures: lLight{ void switchOn(); void switchOff(); } ITime{ int getTime(); } ITherm{ int getTemp(); } ICon{ void setCondMode(CondMode mode); CondMode getCondMode(); }

Light Time

Thermometer CoolerHeater

Component role Provided interface Required interface

Caption

7 11/07/2014 SATToSE 2014

slide-8
SLIDE 8

Configuration level

Lamp AndroidOrc hestrator

IClock ITherm IAirCon Interface types and their signatures: lPower{ void switchOn(); void switchOff(); } IIntensity{ void setIntensityLevel(int intensity); int getIntensityLevel(); } IClock{ void setDateTime(int time, Date date); int getTime(); Date getDate(); } ITherm{ int getTemp(); } … … lPower lIntensity

Clock AirConditioner

Component class Provided interface Required interface

Caption Thermost at AirConditioner composition

ITherm ICon ITemp

CHEngine

Delegation link

8

slide-9
SLIDE 9

Assembly level

lamp1 lamp2 clock1

airConditioner 1

androidOrchestrator1

Component instance Provided interface Required interface

Caption

9 11/07/2014 SATToSE 2014

slide-10
SLIDE 10

Outline

 The reuse approach  The formal approach  Intra-level rules  Inter-level rules  Evolution rules and process  Conclusion and perspectives

10 11/07/2014 SATToSE 2014

slide-11
SLIDE 11

The formal approach

 Formalization based on set theory and first-order

logic

 B modeling language

 Generic concepts: architectures, components,

interfaces, signatures, …

 Specific concepts: specification, configuration,

component roles, component classes, …

 Invariants.

11 11/07/2014 SATToSE 2014

slide-12
SLIDE 12

Example

12

slide-13
SLIDE 13

Outline

 The reuse approach  The formal approach  Intra-level rules  Inter-level rules  Evolution rules and process  Conclusion and perspectives

13 11/07/2014 SATToSE 2014

slide-14
SLIDE 14

Intra-level rules

 Substitutability rules

 Syntactic definition of signatures (name, types,

parameters),

 Interface typing with respect to covariance and

contravariance rules,

 Interface substitutability,  Component substitutability.

 Compatibility rules

 Between interfaces,  Between components.

14 11/07/2014 SATToSE 2014

slide-15
SLIDE 15

Example

15

Clock ClockV2

ISettingV2 setTime(Time time) setDateFormat(DateFormat format) ISetting setTime(Time time) setDateFormat(SimpleDateFormat format) IInfo getTime() : Time getDate() : Date getDateFormat() : DateFormat ILanguage getLanguageInfo(): String IlocationAndGMT getLocation() : Point getGMT() : TimeZone ILocation getLocation() : Point Interface substitutability Interface subtyping Component substitutability

Légende

inheritance

DateFormat SimpleDateFormat

slide-16
SLIDE 16

Consistency and completeness

 Based on the compatibility between interfaces  Consistency:

 Correct connections between components,  Connected architectural graph (no isolated

components).

 Completeness (internal):

 All required interfaces are connected

16 11/07/2014 SATToSE 2014

slide-17
SLIDE 17

Outline

 The reuse approach  The formal approach  Intra-level rules  Inter-level rules  Evolution rules and process  Conclusion and perspectives

17 11/07/2014 SATToSE 2014

slide-18
SLIDE 18

Inter-level rules

Abstract architecture specification Concrete architecture configuration Instantiated architecture assembly <<implements>> <<instantiates>> <<realizes>> <<instantiates>> Component role Component class Component instance

18

slide-19
SLIDE 19

The realization rule

 Many-to-many relation,  A component class may <<realize>> several roles

at once,

 A roles may be realized by composing several

component classes. => more flexibility while searching for implementation solutions.

19 11/07/2014 SATToSE 2014

slide-20
SLIDE 20

The realization rule

20 11/07/2014 SATToSE 2014

slide-21
SLIDE 21

Example

R1 R2 R3 C1 sig1 sig2 sig3 sig4 sigB sigA sig1’ sig2’ sig3’ sig4’ sig5 sigA’ sigB’ I1 I2 I3 J1 J2 I J Interface typing: I1 I2 I3 I Signature matching: sig1 <-> sig1’ sig2 <-> sig2’ sig3 <-> sig3’ sig4 <-> sig4’ sigA <-> sigA’ sigB <-> sigB’

21

J1 J2 J

11/07/2014 SATToSE 2014

slide-22
SLIDE 22

Coherence between a specification and a configuration

 A configuration <<implements>> a specification if

and only if:

 Every role in the specification is realized by a

component class in the configuration,

 All the specified services in the specification are

met in the configuration.

22 11/07/2014 SATToSE 2014

slide-23
SLIDE 23

Coherence between assembly and configuration

 <<Instantiates>> is a many-to-one relation.  An assembly is an instantiation of a configuration

iff:

 Each component class is instantiated at least once,  Each instance in the assembly is an instantiation of

a component class in the configuration.

23 11/07/2014 SATToSE 2014

slide-24
SLIDE 24

Outline

 The reuse approach  The formal approach  Intra-level rules  Inter-level rules  Evolution rules and process  Conclusion and perspectives

24 11/07/2014 SATToSE 2014

slide-25
SLIDE 25

Architecture-centric evolution

25

 A process to evolve software system by modifying

its architecture.

 Issues:

 Inconsistencies: (name, interface, behavior, …)  Architecture erosion: integrating architectural

changes that violate higher level preconditions.

 Architecture drift: integrating architectural changes

that are not considered by the higher abstraction level.

11/07/2014 SATToSE 2014

slide-26
SLIDE 26

Evolution rules

26

 Change operations guarded by preconditions,  Three main operations: addition, deletion and

substitution,

 Defined at:

 Specification level to update user requirements,  Configuration level to update software

implementation,

 Assembly level to change software dynamically.

 Change can be initiated externally or triggered by

the evolution manger.

11/07/2014 SATToSE 2014

slide-27
SLIDE 27

Example of evolution rule (Instance addition)

27 11/07/2014 SATToSE 2014

slide-28
SLIDE 28

Evolution process

28

slide-29
SLIDE 29

Outline

 The reuse approach  The formal approach  Intra-level rules  Inter-level rules  Evolution rules and process  Conclusion and perspectives

29 11/07/2014 SATToSE 2014

slide-30
SLIDE 30

Conclusion

 A formal model for multi-level software

architectures,

 Intra-level rules to ensure architecture

consistency,

 Coherence rules between architecture

descriptions,

 Evolution rules to automatically handle software

change and avoid architectural mismatches.

30 11/07/2014 SATToSE 2014

slide-31
SLIDE 31

Perspectives

 Implement an evolution management

environement within an eclipse-based platform,

 Study and manage software architecture

versioning,

 Implementing a case study.

31 11/07/2014 SATToSE 2014