合久必分,分久必合 long union must separate, long separation must unite discovering aspects...

34
合合合合 合合合合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John Mylopoulos 1

Upload: diana-lambert

Post on 17-Dec-2015

220 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

合久必分,分久必合Long union must separate, long separation must unite

Discovering aspects from requirements goal models

Yijun Yu1

Julio C. S. P. Leite2

John Mylopoulos1

Page 2: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

Identify Aspects Early on in the Software Development Process

Our Goal:

Our Result:

Aspects can be discovered during goal oriented requirements

analysis

Page 3: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

3

Overview

1. Early Requirements in AOP paradigm1.1 Design Principles in AOP

1.2 Requirements Goal Models

2. Aspect discovery through construction of a V-graph (goals, softgoals, and tasks)

3. A case study: Media Shop+osCommerce

4. Summary

Page 4: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

4

1. Principles1.1 Increase Fan-in, aka. DRY

• “Whenever possible, we wish to maximize fan-in during the design process. Fan-in is the raison d’être (grounds for existence) of modularity. Each instance of multiple fan-in means that some duplicate code has been avoided.” (Yourdon, Constantine, Structured Design p. 172, 1979)

• The DRY principle: Don’t Repeat Yourself[A. Hunt, and D. Thomas. Pragmatic Programmer. Addison Wesley,1999. in (Martin Fowler, Avoid Repetition, IEEE Software, Jan/Feb 2001 pp.97—99.)]

Page 5: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

5

CCC

C

CC

C

AspectC

IOC

DRY

Page 6: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

6

VALUE

REMOVALL

MOVE UNTIL

FIND

STRINGCOMP

SCAN

Yourdon & Constantine, SD, pg.168

FIND: AT LINE 5

VALUE: AT LINE7

SCAN: AT LINE 15

MOVE UNTIL: AT LINE 8

REMOVALL: AT LINE 2

Page 7: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

7

Stan Wagon’s bikeMy square-wheel bike, on permanent display at Macalester College. This construction, believe it or not, earned me an entry in "Ripley's Believe It or Not"; beats standing in a block of ice for three days or growing three-foot long fingernails.

-- http://www.stanwagon.com

Stan Wagon ([email protected]), Prof. of Mathematics and Computer Science, Macalester College, St. Paul, Minnesota

Page 8: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

8Yourdon & Constantine, SD, pg.168

VALUE

REMOVALL

MOVE UNTIL

FIND

STRINGCOMP

SCAN

FIND: AT LINE 5

VALUE: AT LINE7

SCAN: AT LINE 15

MOVE UNTIL: AT LINE 8

REMOVALL: AT LINE 2

The Weaver

Page 9: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

9

AspectJ

aspect Logging {

pointcut NeedLogging(): call(void FIND()) || call(void MOVEUNTIL()) || call(void REMOVALL) || call(void SCAN() || call(void VALUE());

after() returning: NeedLogging() { STRINGCOMP(); }}

advice

aspect

pointcut

The GROUND

The WAGON

The DRIVER

Page 10: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

10

1.2 Requirements Goal Models

• A goal model is an intentional model• A goal can be decomposed into AND or OR

subgoals• A goal model has both hard and soft goals

– A hard goal can be either satisfied or denied– A soft goal is partially satisfied => satisficed

• Soft goal uses HELP (+), HURT (-), MAKE (++) or BREAK (--) correlations to show partial satisfaction (satisfice) from a set of subgoals

Page 11: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

11

1.2.1 Hard goal model

Page 12: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

12

1.2.2 Soft goal model

Page 13: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

13

T: satisfiedF: deniedU: unknown

Text Editor SMTP

AND

Get Reliable Reply

Get Reliable Reply

FS: Fully satisfiedPS: Partially satisfiedUN: UnknownPD: Partially deniedFD: Fully deniedCF: ConflictGoal:

Contact a Friend

Goal:Email a Friend

Goal:Mail a Friend

Goal:Call a Friend

++: MAKE

+: HELP --: BREAKOR

++: MAKE

Goal-Oriented Requirements Analysis

Page 14: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

14

T: satisfiedF: deniedU: unknown

Text Editor SMTP

AND

Get Reliable Reply

Get Reliable Reply

FS: Fully satisficedPS: Partially satisficedUN: UnknownPD: Partially deniedFD: Fully deniedCF: ConflictGoal:

Contact a Friend

Goal:Email a Friend

Goal:Mail a Friend

Goal:Call a Friend

OR

++: MAKE

++: MAKE

+: HELP --: BREAK

Page 15: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

15

V-graph

In order to reason about interplay of functional and non-functional requirements, we create a particular type of goal model, called V-graph

Page 16: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

16

Goal

Task

SoftgoalSoftgoal

cont

ribut

ion

cont

ribut

ion

correlation

V

Page 17: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

17

2. The Process– Start from root-level goals and soft goals, correlate

and decompose them into a V-graph– A goal analysis based on the label propagation

algorithm is used to check for:• Conflicts• Inconsistencies• Denial of any goal or soft goals

– After resolving the problems, a proper V-graph is obtained

– Then we list the candidate aspects from the V-graph

Page 18: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

18

Consistent

tasks

goals softgoals

goals softgoals

tasks

root goal

softgoals

list objectives

No conflict

goals softgoals

tasks

listaspects

V model

aspects

Satisfied & satisficed

correlation

decompose

softgoalssoftgoals

correlate

decompose

resolve conflict

decompose

Page 19: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

19

3. A Case Study• Medi@Shop adapted from literature:

Castro, Kolp, Mylopoulos, Towards requirements-driven information systems engineering: the Tropos project, Journal of Information Systems, 2002. Can we find aspects from early requirements?

• osCommerce studied from an LAMP (Linux, Apache, MySQL, PHP) Open-Source project: (http://www.oscommerce.com) Do they manifest in the developed software?

Page 20: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

20

osCommerce (version 2.2m2)

Page 21: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

21

Page 22: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

22

Candidate aspects in the codeClone detection (by Semantic Design,Inc)

LOC #clones Code description Need refactoring?

1 319 require($path . $file); No

1 260 echo $expression; No

559 2 class email; No

2 292 define ($variable, $value); No

76 2 class mime; No

4 67 messageStack->add ($error); Yes (NFR)

15 15 Postal code zone check Yes (FR)

22 10 require(application_top.php);SSL check

Yes (FR/NFR)

3 64 Set HTML head CHARSET Yes (NFR)

Page 23: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

23

Consistent

tasks

goals softgoals

goals softgoals

tasks

root goal

softgoals

list objectives

No conflict

goals softgoals

tasks

listaspects

V model

aspects

Satisfied & satisficed

correlation

decompose

softgoalssoftgoals

correlate

decompose

resolve conflict

decompose

Page 24: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

24

Correlate initial goals and softgoals

T1T0

Page 25: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

25

Inconsistent decomposition

T1 T2

Page 26: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

26

T3

Resolving inconsistency

T2

Page 27: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

27

Further decomposition

T3 T4

Page 28: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

28

Further…

T5

Page 29: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

29T6

Page 30: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

30T7

Resolving Conflicts

T6

Page 31: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

31

Result candidate aspects

Page 32: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

32

Goal Aspects

goal aspect Responsiveness[transaction] {pointcut transaction(): Preparing[cart,product]) ||

CheckingOut[cart, product, account, stock]); required () by: transaction() { SessionCookie[transaction](); }};• AspectJ-like syntax• Allow weaving the operationalized tasks with goals

specified in the pointcut

Page 33: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

33

aspects

goals softgoals

tasks

Separatingaspects

V graph

pointcutsaspects

advicetasks

functiontasks

goals

weaving

Goal aspects

4. SUMMARY

Page 34: 合久必分,分久必合 Long union must separate, long separation must unite Discovering aspects from requirements goal models Yijun Yu 1 Julio C. S. P. Leite 2 John

34

5. On-going and future work

1. On Implementations:– Weaving the goal aspects– AspectPHP: adapting the Zend PHP interpretator– AspecT*: testing NFR in the weaved code

2. Another case study: CORBA

3. Extensions– From V-graph to agent-oriented frameworks such

as i* and KAOS– reuse of goal aspects