You are on page 1of 27

A systematic approach to incorporate non-functional requirements into functional requirement modeling

Overview
Introduction Motivation Background FR, NFR Integration
Classpects Use Cases and Their Sequence Digrams Q-SIG

Conclusion
2

Introduction
NFRs: global constraints
FRs: requirements on the function of the system

NFRs are at least as important as FRs


Stated informally Incorporated lately
Difficult to validate even if included

Motivation
Approaches for NFR design
NFR framework AOP NFR specific approaches

Rarely do these approaches indicate how to integrate both NFR and FR


Objective
Incorporate the information in the NFR framework during the development of a software systematically
4

Background

NFR-Framework
Chung et.al, 1989-99
Treat NFRs as softgoals that need to be

satisficied
Softgoal can not be absolutely fulfilled Satsficing satisfying a requirement in a variety of degree without necessarily optimizing.
e.g.. Somewhat, negatively, positively, very positively

Consists of
SIG (Softgoal Interdependency Graph) Catalogues for each NFR
5

Background

Classpects
Leverage the advantage of both class and aspects
Improve the compositionality of aspect modules From 2-layered structure in AOP to hierarchical structure of n-layers
Aspects (now classpects) can advise other classpects

Background

Classpects
Example (in Eos-U, classpect implementation language)
public class SafetyRoomMalOI{ SafetyRoomMal srm; Attribute: the classpect public SafeRoomMalOI(SafeRoomMal srm){ advises SafetyRoomMal this.srm = srm; } Constructor public void safteyfun (){ Advise: now inside a /* body of the method */ } named method so that it before execution{public * could be advised later if safeRoomMal.*(*)) necessary && returns (ret) && args(): call safetyFun(); Pointcut: now calls the }

advise method

Framework
Creating SIG A SIG describing the NFR of the system Creating SIG claspects (skeleton) Synthesizing Classpects that implements the NFRs Discovering classes for claspects Correspondence between the classpects that describe NFR and classes that describe FR Integrating NFR with FR Design document that captures both NFR and FR
8

Creating Classpects from SIG


1.
A(B) A2(B)
Performance (Account)
<<classpect>> Account

A classpect A is applied to the classpect B Two classpects A1 and A2 are applied to classpect A

A1(B)

<<classpect>> Performance

Space (Account)

Response Time (Account)


<<classpect>> Space <<classpect>> Response time

Creating Classpects from SIG


2.
A(B) A(B2)

Case 1: When B1 and B2 are subclasses of B


A classpect A is applied to the classpect B
The advice of A applies automatically to B1 and B2 since they are subclasses of B

A(B1)

Case 2: When B1 and B2 applies to different attributes of B (decomposition via attributes)


A classpect A is applied to the classpect B A classpect A1 advises A about B1 and A2 advises A about B2

Case 3: When B doesnt exist in the functional decomposition


A classpect A applies to B1 and B2
10

Example
Safety (Room. Malfunction)

public class SafeRoomMal{ 1 Room rm; 2 public SafeRoomMal(Room rm){ 3 this.rm = rm; 4 } 5 public void safteyfun(){ 6 inform facility manager 7 } 8 before execution{(public *Room.*(*)) 9 && returns (ret) && args(): 10 call safetyFun(); }

Safety (Room. Malfunction.OI)

Safety (Room. Malfunction. Motion Detector)

inform facility manager

All ceiling lights on

inform user

set room as occupied

11

Example
Safety (Room. Malfunction.OI) Safety (Room. Malfunction. Motion Detector)

All ceiling lights on inform user

public class SafeRoomMalOI{ SafeRoomMal srm; /*CONSTRUCTOR*/ public void safteyfun (){ all ceiling lights on and inform user } public class SafeRoomMalMD{ /* POINTCUT*/ SafeRoomMal srm; }

/*CONSTRUCTOR*/

Safety (Room. Malfunction. Motion Detector)

public void safteyfun (){ inform user and set room as occupied }

/* POINTCUT*/
}
inform user set room as occupied

12

Example
Observation
The code is skeletal
Text information from the SIG
Need to incorporate info from functional analysis

Preserves the hierarchy in the SIG


SafeRoomMal advises Room SafeRoomMalOI and SafeRoomMalMD advise SafeRoomMal

13

Discovering Classes
To match the claspects with classes
Use the same vocabulary Unless NFR and FR analysis done by the same person, not reliable
Account class may have different methods from NFR AND FR perspective

Use use-cases to find which classes may be affected Use the requirement document in such a way that Often the NFR is mentioned along with the class that it applies to
14

Integration
Room class
Roomm +id : Integer +lights : sequence(idl) +user : String +occupied : Boolean +fm : String +lightintensity : Byte +setLightIntensity() +occupied() : boolean +setOccupied() +lightIntensity() : Byte +turnLights(in light : Single) +checkSafety() : bool

public class SafeRoomMalOI{ SafeRoomMal srm; /*CONSTRUCTOR*/ public void safteyfun (){ all ceiling lights on and inform user } /* POINTCUT*/ }

public void safteyfun (){ for all i in srm.rm.lights{ srm.rm.turnOnLights(i); } println (``This room"+ srm.rm.id+ ``has a malfunction"); }
15

Use Cases and their Sequence Diagrams from SIG


Class diagrams are useless without use cases they participate in
The use cases are the NFRs that we identified in the SIG Specifically, the interior nodes of the SIG that havent been captured as classpects.

16

Use Cases and their Sequence Diagrams from SIG


Example (based on the previous example)
Hotel
Reserve() A=checkSafety()
ALT

Room

Notice

|a=true|

FUNCTIONAL
|a=false| safety

safety

S1

S2

S3

PAR

NONFUNCTIONAL
17

Q-SIG: Quantified SIG


Problems with SIG
Prioritization
All NFRs are not equally important
In ATM application, confidentiality is more important than accuracy which is more important than availability

Design Alternatives
As NFRs compete for resources, we need to find the best set of design decisions to satisfy all NFRs
18

Q-SIG: Quantified SIG


Design alternatives in SIG are dealt with the OR decomposition
Authenticate User Access

Use Pin

Id/passwd

Another ID

A D D S

B D S S

Result D S S

D=denied S=Satisfied

Partial OR decomposition table


19

Q-SIG: Quantified SIG


Problem with OR decomposition
In the final system, only one of the alternatives is chosen There is no point in composing alternatives unlike AND decomposition
IF A and B are alternatives, either A or B is chosen, composing A with B is meaningless Has a serious implication in choosing design alternatives

20

Q-SIG: Quantified SIG


A B -D E F ++ F and G are alternatives to implement C. C + G F is better (++) than G (+) in implementing C F has a strong (--) conflict with B than G(-) which one (F OR G) do you choose to implement C?

NO clear guideline using NFR-Framework

21

Q-SIG: Quantified SIG


Solution for both priority problem and trade-off problem in SIG
QUANTIFICATION
It is the failure to represent different degrees of satisfibility and importance that is the root of the two problems.

The OR decomposition technique has to be changed since it is useless for deciding among alternatives.
22

Q-SIG: Quantified SIG


A 0.3 B 0.5 D

0.7

C -0.6 0.7 0.5 -0.9 0.9 F G E

The objective is to get the design alternatives that get the highest value for the root

Solution (contd) Downward arrowsdecomposition Upward arrows-design alternatives AND decompostion-all must add up to 1 The contribution of a child to its parent is the value of the child multiplied by the arrow value that connects them The value of a node is the sum of the contribution from each child. All leaf nodes have value 1
23

Q-SIG: Quantified SIG


How to decide between F and G
Ad-Hoc approach: Choose each and use it to calculate the value at A.
F: 0.3*(1-0.9)+0.9*0.7=0.66 G:0.3*(1-0.6)+0.7*0.7=0.61
F is chosen Because the left arm is not as important as the right arm We cannot make this kind of decision based on SIG Even then, the result is very close because of the trade-off
24

Q-SIG: Quantified SIG


How to decide between F and G
Dissimilarity approach: We only compare the parts of the graph that would be different when we take F and G.
A 0.3 B 0.5 D 0.7 VS C 0.5 D A 0.3 B 0.5 E G
25

0.7 C -0.6

0.7

0.5 -0.9 0.9 F E

Identical-doesnt help to in choosing

Q-SIG: Quantified SIG


A 0.3 B 0.7 VS C -0.9 0.9 F F: -0.9*0.3 + 0.9* 0.7 = 0.36 A 0.3 B 0.7 C -0.6

0.7 G

G: -0.6*0.3 + 0.7* 0.7 = 0.31

Still F is chosen but with less calculation


The gain may not be apparent because of the simplicity of the example
26

Conclusion
Bridged the gap between requirement analysis and implementation for NFRs
Maintained separation of concerns
Ease of traciblity

NFRs are treated as first-class design elements


Both FR and NFRs are implemented as classpects, sequence diagrams, etc

Proposed Q-SIG for addressing


Priority problem Tradeoff problem
27

You might also like