Download Camila_Nunes_-_On_th.. - LES PUC-Rio

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
On the Modularity Assessment of AspectOriented Multi-Agent Systems Product
Lines: a Quantitative Study
Camila Nunes
[email protected]
Summary
• Introduction/Motivation
– Aspect-Oriented Programming (AOP)
• Study Settings
• Modularity Analysis
• Discussions and Lessons Learned
• Related Work
• Final Remarks
© LES/PUC-Rio
Introduction
• Aspect-oriented programming (AOP) techniques to
improve the modularization of features in SPLs, objectoriented frameworks, and multi-agent systems
• The increasing complexity of modern applications
motivates the use of AOP
© LES/PUC-Rio
Introduction
OO Solution
Aspect-Oriented Solution
Aspect
“Crosscutting
Concerns”
Join
Points
Classes
• Improve separation of concerns
• Improve maintainability and reuse of classes and
crosscutting concerns
© LES/PUC-Rio
Introduction
• Problem
– There are recent research and empirical studies
exploring the use of AOP to modularize features
– However, none of them analyzes the impact of
adding agency features in evolution scenarios of a
MAS-PL.
– How to deal with the MAS-PL evolution?
• Evolution in SPLs requires appropriate mechanisms to
lead with invasive changes.
• Implementation of variability mechanisms:
– Conditional Compilation
– Aspect-Oriented Programming (AOP)
© LES/PUC-Rio
Introduction
• Our work
– This work presents an empirical study
development and evolution of an MAS-PL
of
– The aim is to compare the modularity of objectoriented (OO) and aspect-oriented (AO) different
implementations of the MAS-PL.
– Our study is based on a suite of modularity
attributes and change impact metrics.
© LES/PUC-Rio
Introduction
• Our goal is to answer some questions, such as:
– (1) Which technique is more appropriate to allow
superior stability in the implementation of agency
features?
– (2) Which technique required less intrusive
modifications following the Open-Closed principle?
– (3) Which technique supports the construction of
reusable and maintainable MAS?
© LES/PUC-Rio
Summary
• Introduction/Motivation
– Software Product Lines (SPL)
– Aspect-Oriented Programming (AOP)
– Multi-agent Systems Product Line (MAS-PL)
• Study Settings
• Modularity Analysis
• Discussions and Lessons Learned
• Related Work
• Final Remarks
© LES/PUC-Rio
The ExpertCommittee Web based System
• Conference Management System
• Typical web-based application
• Functionalities to support the complete process of the
management of conferences and workshops
– Paper submission
– Reviewing processes
• Examples
– EasyChair (http://www.easychair.org/)
– JEMS (https://submissoes.sbc.org.br/)
© LES/PUC-Rio
Generation of the MAS-PL Releases
• First it was implemented the SPL base architecture of
the EC.
• A series of change scenarios, adding optional and
alternative features in the SPL architecture.
• Seven new releases of the EC MAS-PL were generated
• Each release of our MAS-PL was always implemented
in two different versions:
– (i) one codified in Java with conditional compilation
– (ii) the other one codified in AspectJ
© LES/PUC-Rio
Generation of the MAS-PL Releases
Releases
Description
Change Type
R1
ExpertCommittee core
R2
Addition of the Reviewer role.
R3
New feature added to include user agents Inclusion of optional feature.
including the author and chair roles.
New feature to allow the suggestion of
conferences to the authors.
R4
Addition of a Notifier agent to send Inclusion of optional and
messages to the system users through
alternative feature.
email and SMS.
R5
Addition of the Deadline agent. This agent Inclusion of optional feature.
is responsible for monitoring the
conference deadlines.
R6
Addition of a feature that allows the chair Inclusion of alternative feature
to automatically assign papers to
and extension of deadline
reviewers. Extension of the deadline
monitoring feature.
agent to allow reminder deadlines.
R7
Addition of a Task agent.
Inclusion of optional feature.
Inclusion of optional feature.
© LES/PUC-Rio
Generation of the MAS-PL Releases
• MAS-PL Features Types:
– (i) new conference management features:
• typical kind of feature addressed in SPL
– (ii) new autonomous behavior:
• Introduction of agents
– (iii) new behaviors and roles for an agent:
• Features that have impact inside of agents, internal
variabilities
© LES/PUC-Rio
MAS-PL Object Design
© LES/PUC-Rio
MAS-PL Object Design
© LES/PUC-Rio
MAS-PL Object Design
© LES/PUC-Rio
MAS-PL Aspect Oriented Design
© LES/PUC-Rio
MAS-PL Aspect Oriented Design
© LES/PUC-Rio
MAS-PL Aspect Oriented Design
© LES/PUC-Rio
The Metrics
Attributes
Separation of
Concerns
Metrics
Definition
Concern Diffusion over Components
(CDC)
It counts the number of classes and aspects
whose main purpose is to contribute to the
implementation of a concern and the number
of other classes and aspects that access
them.
Concern Diffusion over Operations
(CDO)
It counts the number of methods and advices
whose main purpose is to contribute to the
implementation of a concern and the number
of other methods and advices that access
them.
Concern Diffusion over LOC (CDLOC)
It counts the number of transition points for each
concern through the lines of code. Transition
points are points in the code where there is a
“concern switch”.
Interaction
Between
Concerns
Component-level Interlacing Between
Concerns (CIBC)
It counts the number of other concerns with
which a given concern shares at least a
component.
Size
Lines of Code (LOC)
It counts the lines of code.
Number of Components (NOC)
It counts the number of components.
Number of Operations (NOO)
It counts the number of operations of a given
component.
© LES/PUC-Rio
The Metrics
Attributes
Metric
Definition
Coupling
Coupling Between
Components
(CBC)
Counts the number of other
classes and aspects to which a
class or an aspect is coupled.
Cohesion
Lack of Cohesion
Operations
(LCCO)
Measures the lack of cohesion of a
class or an aspect in terms of the
amount of method and advice
pairs that do not access the same
instance variable.
© LES/PUC-Rio
Summary
• Introduction/Motivation
– Software Product Lines (SPL)
– Aspect-Oriented Programming (AOP)
– Multi-agent Systems Product Line (MAS-PL)
• Study Settings
• Modularity Analysis
• Discussions and Lessons Learned
• Related Work
• Final Remarks
© LES/PUC-Rio
Separation of Roles and Agents Concerns
• Concern Diffusion
over Operations
(CDO)
Concern Difusion over LOC
Reviewer
• Concern Diffusion
over Lines of Code
(CDLOC)
90
80
70
60
50
40
30
20
10
0
Java
AspectJ
1
2
3
Releases
Reviewer
Concern Difusion over
Operations
60
50
40
Java
30
AspectJ
20
10
0
1
2
3
4
5
4
6
7
Releases
© LES/PUC-Rio
5
6
7
SoC – Reviewer Feature
• Concern Diffusion over Components (CDC)
Concern Difusion over
Components
Reviewer
20
15
Java
10
AspectJ
5
0
1
2
3
4
5
Releases
© LES/PUC-Rio
6
7
SoC – User Agents Feature
• Concern Diffusion over Operations (CDO)
Concern Difusion over
Operations
User Agents
80
70
60
50
40
30
Java
AspectJ
20
10
0
1
2
3
4
Releases
© LES/PUC-Rio
5
6
7
SoC – User Agents Feature
• Concern Diffusion over Components (CDC)
Concern Difusion over
Components
User Agents
30
25
20
Java
15
AspectJ
10
5
0
1
2
3
4
Releases
© LES/PUC-Rio
5
6
7
SoC – User Agents Feature
• Concern Diffusion over Lines of Code (CDLOC)
Concern Difusion over LOC
User Agents
60
50
40
Java
30
AspectJ
20
10
0
1
2
3
4
5
Releases
© LES/PUC-Rio
6
7
SoC – Notifier Agent
• Concern Diffusion over Components (CDC)
NotifierAgent
Concern Difusion over Components
25
20
15
Java
AspectJ
10
5
0
1
2
3
4
Releases
© LES/PUC-Rio
5
6
7
Size Metrics
ExpertCommittee
14000
Lines of Code
12000
10000
8000
Java
6000
AspectJ
4000
2000
0
1
2
3
4
5
6
7
Releases
ExpertCommittee
Number of Operations
1400
1200
1000
800
Java
600
AspectJ
400
200
0
1
2
3
4
5
Releases
© LES/PUC-Rio
6
7
Size Metrics
Number of Components
ExpertCommittee
250
200
150
Java
100
AspectJ
50
0
1
2
3
4
Releases
© LES/PUC-Rio
5
6
7
Interaction between Concerns
Review er
10
CIBC
8
6
Java
4
AspectJ
2
0
1
2
3
4
5
6
7
Releases
User Agents
9
8
7
CIBC
6
5
Java
4
AspectJ
3
2
1
0
1
2
3
4
Releases
© LES/PUC-Rio
5
6
7
Coupling Between Components (CBC)
Coupling Between Components (CBC)
10,0
9,0
8,0
7,0
6,0
Java
5,0
AspectJ
4,0
3,0
2,0
1,0
0,0
1
2
3
4
5
Releases
© LES/PUC-Rio
6
7
Lack of Cohesion over Operations (LCOO)
Lack of Cohesion over Operations (LCOO)
0,25
0,20
0,15
Java
AspectJ
0,10
0,05
1
2
3
4
Releases
© LES/PUC-Rio
5
6
7
Change Propagation Metrics
R2
R3
R4
R5
R6
R7
OO
3
27
11
3
3
26
OA
9
35
20
6
8
34
Changed
Components
OO
9
6
8
8
7
13
OA
0
0
0
0
0
0
Added Operations
OO
32
103
31
29
20
128
OA
43
112
35
49
27
145
OO
4
2
15
2
2
31
OA
0
0
0
0
0
0
Added Pointcuts
OA
5
7
9
1
1
19
Changed Pointcuts
OA
0
0
0
0
0
0
OO
418
1134
639
391
249
2203
OA
511
1202
784
470
496
2166
Added Components
Changed Operations
Added
LOC
© LES/PUC-Rio
Summary
• Introduction/Motivation
– Software Product Lines (SPL)
– Aspect-Oriented Programming (AOP)
– Multi-agent Systems Product Line (MAS-PL)
• Study Settings
• Modularity Analysis
• Discussions and Lessons Learned
• Related Work
• Final Remarks
© LES/PUC-Rio
Discussions and Lessons Learned
• Aspects as “glue” between Roles and Agents:
– several aspects in our MAS-PL worked as a “glue”
code.
• Feature Management:
– Some agency features, such as: User Agents and
Notifier Agent, caused a high number of new
components (classes and aspects) in the AO
solution.
– Although the use of aspects increases the number
of components in these cases, it was also useful to
reduce the tangling and coupling between the
concerns/features.
© LES/PUC-Rio
Discussions and Lessons Learned
• Code Understanding:
– In our study, it was observed that the AO solution
exhibits higher values for all the size metrics (LOC,
NOC, and NOO).
– This was a
implementation
negative
© LES/PUC-Rio
finding
of
the
AO
Discussions and Lessons Learned
• Recent research has pointed AOP as a good technique
for implementation and management of variabilities in
SPL.
• The
aspect-oriented
approach
required
modification and extension of the selected MAS
less
• The implementation of variabilities with AOP also
brings
another
benefit:
the
capacity
of
pluging/unpluging aspects from the SPL core
implementation.
© LES/PUC-Rio
Summary
• Introduction/Motivation
– Software Product Lines (SPL)
– Aspect-Oriented Programming (AOP)
– Multi-agent Systems Product Line (MAS-PL)
• Study Settings
• Modularity Analysis
• Discussions and Lessons Learned
• Related Work
• Final Remarks
© LES/PUC-Rio
Related Work
• Figueiredo, E. et al (2008). Evolving software
product lines with aspects: An empirical study on
design stability
– Empirical study focusing on evolution requirements of
two product-lines.
– Analyzes the evolution of product lines in terms of
metrics for modularity, change propagation and feature
interaction.
• Apel, S. and Batory, D. (2006). When to use
features and aspects?: a case study.
– A study comparing the feature-oriented programming
(FOP) and aspect-oriented programming (AOP)
• Kastner, C. et al. (2007). A case study
implementing features using aspectj.
– Refactoring legacy application into an SPL using aspects
to implement features.
© LES/PUC-Rio
Summary
• Introduction/Motivation
– Software Product Lines (SPL)
– Aspect-Oriented Programming (AOP)
– Multi-agent Systems Product Line (MAS-PL)
• Study Settings
• Modularity Analysis
• Discussions and Lessons Learned
• Related Work
• Final Remarks
© LES/PUC-Rio
Final Remarks
• Exploratory study of development and evolution of a
MAS-PL
– Traditional web-based system
• Support conference management process
– Incorporation of a series of new agency features
• We compared two different versions of the MAS-PL
implemented using the following technologies:
– (i) OO with conditional compilation using the Java
language
– (ii) AO programming using the AspectJ language.
© LES/PUC-Rio
Final Remarks
• AO implementation exhibits a better separation of
concerns/features (CDLOC metric) and interaction
between concerns, but in terms of the CDC and CDO
metrics the AO implementation presented superior
values.
• The NOC, NOO and LOC increased in the AO
implementation, bringing complexity to manage the
new aspects that modularize some agency features.
© LES/PUC-Rio
Final Remarks
• Separation of Concerns
– Aspects (and classes) encapsulate the agency
features of interest
• Reusability
– Reuse of Aspects and Classes
• Maintainability
– Obliviousness
– Quantification
© LES/PUC-Rio
Questions?
© LES/PUC-Rio