a systematic approach to incorporate non-functional requirements into functional requirement...

Upload: gopimerugu

Post on 07-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    1/27

    A systematic approach to incorporate

    non-functional requirements into

    functional requirement modeling

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    2/27

    2

    Overview

    Introduction

    Motivation

    Background

    FR, NFR Integration Classpects

    Use Cases and Their Sequence Digrams

    Q-SIG

    Conclusion

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    3/27

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    4/27

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    5/27

    5

    Background

    NFR-Framework Chung et.al, 1989-99

    Treat NFRs as softgoals that need to besatisficied

    Softgoal can not be absolutely fulfilled

    Satsficing satisfying a requirement in avariety of degree without necessarily optimizing. e.g.. Somewhat, negatively, positively, very

    positively

    Consists of SIG (Softgoal Interdependency Graph)

    Catalogues for each NFR

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    6/27

    6

    Background

    Classpects Leverage the advantage of both class

    and aspects Improve the compositionality of aspect

    modules

    From 2-layered structure in AOP tohierarchical structure of n-layers

    Aspects (now classpects) can advise otherclasspects

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    7/27

    7

    public class SafetyRoomMalOI{SafetyRoomMal srm;public SafeRoomMalOI(SafeRoomMal srm){

    this.srm = srm;}

    public void safteyfun (){/* body of the method */

    }before execution{public *

    safeRoomMal.*(*))&& returns (ret) && args():call safetyFun();

    }

    Background

    Classpects Example (in Eos-U, classpect implementation language)

    Attribute: the classpectadvises SafetyRoomMal

    ConstructorAdvise: now inside anamed method so that itcould be advised later if

    necessary

    Pointcut: now calls theadvise method

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    8/27

    8

    FrameworkCreating SIG

    Creating SIGynthesizing claspects (skeleton)

    Discovering classes for claspects

    Integrating NFR with FR

    A SIG describing the NFR of the system

    Classpects that implements the NFRs

    Correspondence between the classpects thatdescribe NFR and classes that describe FR

    Design document that captures both NFR and FR

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    9/27

    9

    Creating Classpects from SIGA(B)

    A1(B) A2(B)

    Performance (Account)

    Space (Account) Response Time (Account)

    Space

    Performance

    Account

    Response time

    A classpect A is applied to the classpect B

    Two classpects A1 and A2 are applied to classpect A1.

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    10/27

    10

    Creating Classpects from SIG

    A(B)

    A(B1) 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 sincethey are subclasses of B

    2.

    Case 2: When B1 and B2 applies to different attributesof 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 B2Case 3: When B doesnt exist in the functional

    decomposition

    A classpect A applies to B1 and B2

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    11/27

    11

    Example

    public class SafeRoomMal{

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

    }

    Safety(Room.

    Malfunction)

    Safety(Room.

    Malfunction.Motion Detector)

    Safety(Room.

    Malfunction.OI) inform facility manager

    All ceiling lights on inform user set room as occupied

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    12/27

    12

    ExampleSafety(Room.

    Malfunction.Motion Detector)

    Safety(Room.

    Malfunction.OI)

    All ceiling lights on

    inform user

    public class SafeRoomMalOI{

    SafeRoomMal srm;/*CONSTRUCTOR*/public void safteyfun (){

    all ceiling lights onand inform user

    }/* POINTCUT*/}

    Safety(Room.

    Malfunction.Motion Detector)

    inform user

    set room as occupied

    public class SafeRoomMalMD{SafeRoomMal srm;

    /*CONSTRUCTOR*/public void safteyfun (){

    inform userand set room as occupied

    }

    /* POINTCUT*/}

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    13/27

    13

    ExampleObservation

    The code is skeletalText information from the SIG

    Need to incorporate info from functional analysis

    Preserves the hierarchy in the SIG

    SafeRoomMal advises Room

    SafeRoomMalOI and SafeRoomMalMD adviseSafeRoomMal

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    14/27

    14

    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 NFRAND FR perspective

    Use use-cases to find which classes may beaffected

    Use the requirement document in such a way that Often the NFR is mentioned along with the class

    that it applies to

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    15/27

    15

    public class SafeRoomMalOI{

    SafeRoomMal srm;/*CONSTRUCTOR*/public void safteyfun (){

    all ceiling lights onand inform user

    }/* POINTCUT*/}

    Room class

    Integration

    public void safteyfun (){for all i in srm.rm.lights{srm.rm.turnOnLights(i);

    }println (``This room"+ srm.rm.id+ ``has a malfunction");

    }

    +setLightIntensity()

    +occupied() : boolean+setOccupied()+lightIntensity() : Byte+turnLights(in light : Single)+checkSafety() : bool

    +id : Integer+lights : sequence(idl)+user : String+occupied : Boolean+fm : String+lightintensity : Byte

    Roomm

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    16/27

    16

    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 SIGthat havent been captured as classpects.

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    17/27

    17

    Use Cases and their Sequence

    Diagrams from SIG

    Example (based on the previous example)

    Hotel Room Notice

    ALT

    Reserve()

    A=checkSafety()

    |a=true|

    |a=false| safety

    PAR

    S1 S2 S3

    safety

    FUNCTIONAL

    NON-FUNCTIONAL

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    18/27

    18

    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 importantthan availability

    Design Alternatives

    As NFRs compete for resources, we need tofind the best set of design decisions to satisfyall NFRs

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    19/27

    19

    Q-SIG: Quantified SIG Design alternatives in SIG are dealt with

    the OR decompositionAuthenticate User Access

    Use Pin Id/passwd Another ID

    A B Result

    D D D

    D S S

    S S S

    D=denied

    S=Satisfied

    Partial OR decomposition

    table

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    20/27

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    21/27

    21

    Q-SIG: Quantified SIG

    A

    B

    G

    C

    D FE

    +

    ++

    ---

    F and G are alternatives toimplement C.

    F is better (++) than G (+) inimplementing C

    F has a strong (--) conflict with Bthan G(-)

    which one (F OR G) do you

    choose to implement C?

    NO clear guideline using NFR-Framework

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    22/27

    22

    Q-SIG: Quantified SIG Solution for both priority problem and

    trade-off problem in SIG QUANTIFICATION

    It is the failure to represent different degrees ofsatisfibility and importance that is the root ofthe two problems.

    The OR decomposition technique has to

    be changed since it is useless for decidingamong alternatives.

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    23/27

    23

    Q-SIG: Quantified SIG Solution (contd)

    Downward arrows-

    decomposition Upward arrows-design

    alternatives AND decompostion-all must

    add up to 1 The contribution of a child to

    its parent is the value of thechild multiplied by the arrowvalue that connects them

    The value of a node is thesum of the contribution fromeach child.

    All leaf nodes have value 1

    A

    B

    G

    C

    D FE

    0.7

    0.9

    -0.6-0.90.5 0.5

    0.3 0.7

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

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    24/27

    24

    Q-SIG: Quantified SIG How to decide between F and G

    Ad-Hoc approach: Choose each and use itto 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 theright arm

    We cannot make this kind of decision based onSIG

    Even then, the result is very close because ofthe trade-off

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    25/27

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    26/27

    26

    Still F is chosen but with less calculation The gain may not be apparent because of the

    simplicity of the example

    Q-SIG: Quantified SIG

    A

    BC

    F0.9

    -0.9

    0.3 0.7

    A

    B

    G

    C

    0.7-0.6

    0.3 0.7VS

    F: -0.9*0.3 + 0.9* 0.7 = 0.36 G: -0.6*0.3 + 0.7* 0.7 = 0.31

  • 8/4/2019 A Systematic Approach to Incorporate Non-functional Requirements Into Functional Requirement Modeling

    27/27

    27

    Conclusion Bridged the gap between requirement

    analysis and implementation for NFRs Maintained separation of concerns

    Ease of traciblity

    NFRs are treated as first-class designelements Both FR and NFRs are implemented as

    classpects, sequence diagrams, etc Proposed Q-SIG for addressing

    Priority problem

    Tradeoff problem