Test d int gration pour des syst mes objets
This presentation is the property of its rightful owner.
Sponsored Links
1 / 56

Test d’intégration pour des systèmes à objets PowerPoint PPT Presentation


  • 90 Views
  • Uploaded on
  • Presentation posted in: General

Test d’intégration pour des systèmes à objets. Yves Le Traon [email protected] Contexte. Réalisation d’une «  bonne  » stratégie : pour planifier l’intégration des systèmes à objets, le plus tôt possible dans le cycle de vie, en minimisant le coût du test. Test d’intégration. Objectif

Download Presentation

Test d’intégration pour des systèmes à objets

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Test d int gration pour des syst mes objets

Test d’intégration pour des systèmes à objets

Yves Le Traon

[email protected]


Contexte

Contexte

  • Réalisation d’une « bonne » stratégie :

    • pour planifier l’intégration des systèmes à objets,

    • le plus tôt possible dans le cycle de vie,

    • en minimisant le coût du test.


Test d int gration

Test d’intégration

  • Objectif

    • Vérifier l’interaction entre unités (méthode, classe ou package).

  • Difficultés principales de l’intégration

    • Interfaces floues (ex. ordre des paramètres de même type).

    • Implantation non conforme à la spécification (ex. dépendances entre unités non spécifiées).

    • Réutilisation d’unités (ex. risque d’utilisation hors domaine).


Architecture de d pendances

Unité à tester

Dépendance à tester

Architecture de dépendances


Int gration approches classiques

Intégration – Approches classiques

  • On obtient une architecture arborescente

    • SADT, SART, SAO (Aérospatiale)

  • Approches

    • Big-Bang : non recommandé

    • De haut en bas (top-down)

    • De bas en haut (bottom-up)


Approche classique de haut en bas

Unité à tester

Dépendance à tester

Unité sous test

Dépendance sous test

Bouchon de test (stub)

Dépendance simulée

Unité testée

Dépendance testée

Approche classique : De haut en bas


Approche classique de bas en haut

Unité à tester

Dépendance à tester

Unité sous test

Dépendance sous test

Unité testée

Dépendance testée

Approche classique : De bas en haut


Cycle de vie en spirale

Analyse détaillée

Analyse

préliminaire « (de risque) »

Conception

V1

V2

Réalisation

Validation

Intégration

(…) Cycle de vie en « spirale »

Synergie avec approche par objets


Test unitaire et d int gration

Test unitaire et d’intégration

  • Classiquement

    • Étapes séparées

  • Dans un cycle en spirale

    • Un composant unitaire ne peut pas être testé hors de son contexte d’exécution

    • > conséquence : test unitaire et test d’intégration sont des activités inséparables


Efficient strategies for integration and regression testing of oo systems

Efficient Strategies for Integration and Regression Testing of OO Systems

  • The problem domain: Use OO modeling for early Test Planning

    • Integration

      • deduced from UML models

      • to master integration cost and duration

  • Regression

    • separation of reusable tests from implementation

  • the test model must be refinable with design refinement stages.


  • Efficient strategies for integration and regression testing of oo systems1

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • A OO test model must

      • be as simple as possible

        • easy to understand

        • limited to its purpose

      • catch all the information concerning test

        • test dependencies between components

        • from a rough to a precise level of detail

          • (class method)

      • determine design parts due to implementation choices

        • test cases reuse

        • test cases enhancement with system evolution

    Integration

    Regression


    Efficient strategies for integration and regression testing of oo systems2

    Efficient Strategies for Integration and Regression Testing of OO Systems

    Where to begin with ?

    How to organize test ?

    • Integration plan - What we have to deal with...

    problem

    interdependencies

    loops of dependencies

    between components

    into an architecture


    Efficient strategies for integration and regression testing of oo systems3

    S

    pck1

    pck2

    pck4

    pck3

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • A simple solution, with constraints on the design

      • no loops in an architecture

      • often possible

        but local optimizations are not always optimal for the architecture

        but designing interdependent components may also be relevant

  • The solution presented here

    • takes any model

    • optimizes the way to deal with loops of interdependent components


  • Interd pendance

    Interdépendance

    • Interdépendances

      • Cycle de dépendances

      • Composantes fortementconnexes (CFC)

    • Intégration

      • Big-Bang

      • Décomposer des CFCs – Utilisation de bouchons


    D composition des cfcs bouchon

    A

    CA

    A

    A

    C

    C

    C’

    C

    B

    CB

    B

    B

    Bouchon spécifique

    Bouchon réaliste

    CFC

    Décomposition des CFCs – Bouchon

    • Bouchon : une unité qui

      • simule le comportement d’une unité

      • évite l’utilisation des services d’autres unités de la même CFC.


    Efficient strategies for integration and regression testing of oo systems4

    C

    Test depends on

    C’

    A

    stub

    Test depends on

    B

    Efficient Strategies for Integration and Regression Testing of OO Systems

    Integration Testing

    • Based on a TDG, how to order components ?

      • Minimizing the number of stubs

        • realistic stub => dedicated simulator, « old component »

    C’ stub simulates the behavior of C

    when A and B are tested


    Efficient strategies for integration and regression testing of oo systems5

    C

    Test depends on

    Test depends on

    Test depends on

    C’

    A

    A

    B

    stub

    Test depends on

    C’’

    B

    stub

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • Minimizing the number of stubs

      • specific stub => deterministic component behavior

    A stub for A

    and

    a stub for B


    Probl me de test d int gration

    Problème de test d’intégration

    • Modéliser la structure de dépendances

    • Décomposer des composantes fortement connexes en minimisant le coût de création des bouchons

    • Planifier le test.


    Efficient strategies for integration and regression testing of oo systems6

    Efficient Strategies for Integration and Regression Testing of OO Systems

    The Test Dependency Graph

    preliminary modeling

    inheritance

    • Two basic types of test dependencies

      client/provider

      Contractual dependencies =

      • specified in the public part of classes

      • included in the body of internal methods

        Implementation dependencies = not contractual ones


    Efficient strategies for integration and regression testing of oo systems7

    A

    A

    Class A

    Class node

    A

    mA1(…)

    ...

    A

    mA1

    Method mA1 in Class A

    Method node in a class node

    Efficient Strategies for Integration and Regression Testing of OO Systems

    The Test Dependency Graph

    preliminary modeling

    2 types of nodes

    • class node

    • method node


    Efficient strategies for integration and regression testing of oo systems8

    Semantic of a directed edge

    A is

    test dependent

    from B

    A

    B

    Efficient Strategies for Integration and Regression Testing of OO Systems

    The Test Dependency Graph

    preliminary modeling

    3 types of edges

    • class_to_class

    • method_to_class

    • method_to_method


    Efficient strategies for integration and regression testing of oo systems9

    Efficient Strategies for Integration and Regression Testing of OO Systems

    Method_to_class

    A

    ...

    +mA1(...v1: B...)

    mA2(…v: A…)

    ...

    B

    A

    mA1

    mA2

    refinement

    Method_to_method

    A

    +mA1(...v: B...)

    {…

    v.mB1

    …}

    +mA2(...v: A...)

    {…

    v.mA1

    …}

    B

    A

    mB1

    mA1

    mA2

    an action language (ASL/OCL)

    code level


    Efficient strategies for integration and regression testing of oo systems10

    B

    A

    A

    C

    B

    C

    association class

    A

    A

    A

    A

    Interface Name

    B

    A

    B

    B

    B

    B

    inheritance

    Interfaces

    dependency

    navigability

    A

    A

    B

    B

    association

    Efficient Strategies for Integration and Regression Testing of OO Systems

    Class-to-class

    A

    A

    B

    B

    aggregation

    composition


    Mod lisation statique 1 2

    Modélisation statique 1/2

    B

    A

    B

    A

    A

    A

    Une classe

    Un nœud

    A

    A

    A

    A

    A

    A

    A

    A

    A

    A

    B

    B

    B

    B

    B

    B

    B

    B

    B

    B


    Mod lisation statique 2 2

    Modélisation statique 2/2

    A

    A

    B

    B

    A

    A

    B

    B

    B

    A

    A

    B

    T

    A

    AB

    «bind»

    A

    A

    A

    <B>

    B

    B

    B

    B


    Mod lisation dynamique

    Modélisation dynamique

    A

    C

    A

    C

    A

    C

    A

    C

    B

    B

    B

    B

    A

    «abstract»

    BA

    A

    F

    et

    E

    CA

    F

    E

    DA

    B

    C

    D


    Liminer les doublons

    Éliminer les doublons

    A

    A

    A

    A

    B

    B

    B

    B

    A

    A

    A

    A

    B

    B

    B

    B


    Test d int gration pour des syst mes objets

    Efficient Strategies for Integration and Regression Testing of OO Systems

    pD1

    D

    E

    D

    - pD1(v1:E, v2 : F)

    A

    E

    +mA1(v1: C)

    {….}

    #pA1(…)

    {…}

    A

    F

    F

    pA1

    C

    C

    mA1

    B

    +mB1(v1: C)

    -pB1(v: C)

    -pB2(v: G)

    ….

    #redefine pA1

    {…}

    H

    B

    pA1

    mB1

    pB1

    G

    G

    H

    pB2

    Implementation dependency

    Client contractual dependency

    Inheritance contractual dependency


    Test d int gration pour des syst mes objets

    Efficient Strategies for Integration and Regression Testing of OO Systems

    D

    pD1

    E

    A

    F

    A

    pA1

    C

    mA1

    mA1

    D

    Delete non-reusable part

    B

    B

    pA1

    mB1

    C

    mB1

    pB1

    G

    H

    pB2

    Contractual graph

    Implementation-dependent graph


    Efficient strategies for integration and regression testing of oo systems11

    Loss of information

    B

    A

    A

    B

    Problem : Not a classical graph

    mB1

    mA1

    mB2

    mA2

    class-to-class graph

    mB3

    Preliminary test dependency graph

    solution 1

    solution 2

    A

    mA1

    B

    homomorphism

    mA2

    mB2

    mB1

    mB3

    mixed classes and methods graph

    No loss of information

    Efficient Strategies for Integration and Regression Testing of OO Systems

    Normalization rules


    Efficient strategies for integration and regression testing of oo systems12

    a

    f

    b

    i

    g

    e

    c

    j

    h

    d

    k

    l

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • An efficient strategy (1)

    Optimal ordering => NP-complete

    complexity = n!


    Efficient strategies for integration and regression testing of oo systems13

    a

    f

    b

    i

    g

    e

    c

    j

    h

    d

    Determination and ordering

    of connected components

    k

    l

    Efficient Strategies for Integration and Regression Testing of OO Systems

    a

    B

    f

    • An efficient strategy (2)

    Tarjan’s algorithm

    b

    i

    g

    e

    c

    j

    h

    d

    k

    l

    A

    C

    [(e) or C]

    then

    [A or B]

    then

    [(a)]

    Complexity linear with #nodes


    Efficient strategies for integration and regression testing of oo systems14

    Efficient Strategies for Integration and Regression Testing of OO Systems

    5

    f

    Bourdoncle’s algorithm

    • An efficient strategy (3)

    f

    i

    4

    i

    Candidate node =

    # max(fronds)

    g

    j

    3

    j

    g

    h

    h

    2

    1

    B

    [(e) or C]

    then

    [A or B]

    then

    [(a)]

    Break the connected component

    Reapply Tarjan

    [l, k]

    [c, b, d]

    [g, h, j, i, f]


    Efficient strategies for integration and regression testing of oo systems15

    a

    c

    i

    b

    j

    f

    e

    h

    l

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • Result = a partial ordered tree

      • all possible strategies

    g

    Optimized algorithm

    d

    #specific stubs = 4

    #realistic stubs = 3

    Random selection

    k

    #specific stubs = 9.9

    Partial ordered tree

    #realistic stubs = 5


    Test d int gration pour des syst mes objets

    D

    F

    H

    I

    J

    G

    Exo

    • Plan de test d’intégration pour :

    A

    E

    C

    B


    Cases studies

    Cases Studies

    • SMDS

      • Telecommunication Switching System: Switched Multimegabits Data Service

        • running on top of connected networks such as the Broadband Integrated Service Digital Network (B-ISDN)

        • based on the asynchronous transfer mode (ATM).

      • 22 Kloc

    • Gnu Eiffel Compiler

      • open-source Eiffel compiler

      • 70 Kloc of Eiffel code

        • (http://SmallEiffel.loria.fr)


    Test d int gration pour des syst mes objets

    Case study

    SMDS

    UML diagram


    Test d int gration pour des syst mes objets

    Case study

    SMDS

    Test Dependency Graph


    Smds realistic stubs

    SMDS realistic stubs


    Test d int gration pour des syst mes objets

    Gnu Eiffel Compiler


    Efficient strategies for integration and regression testing of oo systems16

    Efficient Strategies for Integration and Regression Testing of OO Systems

    A comparison with

    • 4 strategies

      • RC : Random Components selection

      • MC : Most Used Components

      • RT : Random Thread of Dependencies

      • MT : Most Used Components Threads of Dependencies (intuitive integration)

        100 000 times for random strategies


    Efficient strategies for integration and regression testing of oo systems17

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • Specific stubs

    60

    48

    47

    50

    39

    38

    36

    40

    34

    Min

    28

    27

    26

    26

    26

    30

    #stubs

    25

    Mean

    20

    20

    20

    Max

    20

    10

    0

    RC

    MC

    RT

    MT

    Optim.

    Strategies


    Efficient strategies for integration and regression testing of oo systems18

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • Realistic stubs

    35

    30

    29

    30

    27

    25

    24

    25

    21

    Min

    18

    19

    19

    19

    19

    20

    #stubs

    Mean

    13

    15

    Max

    9

    9

    9

    10

    5

    0

    RC

    MC

    RT

    MT

    Optim.

    Strategies


    Results summary

    Specific stubs counting

    Realistic stubs counting

    60

    48

    47

    50

    30

    27

    29

    30

    39

    38

    25

    36

    24

    40

    34

    21

    19

    19

    26

    28

    25

    18

    27

    #stubs

    20

    30

    #stubs

    13

    SMDS case study

    20

    20

    9

    10

    10

    0

    0

    RC

    MC

    RT

    MT

    Optim.

    RC

    MC

    RT

    MT

    Optim.

    Min

    Mean

    100

    46

    85

    Max

    87

    50

    43

    80

    63

    63

    40

    35

    34

    GNU Eiffel case study

    32

    60

    25

    28

    30

    40

    38

    #stubs

    34

    25

    22

    22

    #stubs

    28

    40

    27

    27

    20

    17

    20

    9

    10

    0

    0

    RC

    MC

    RT

    MT

    Optim.

    RC

    MC

    RT

    MT

    Optim.

    Results summary


    Variantes possibles

    Variantes possibles

    • Mixte Big-Bang/Incrémental strict

    • Planifier aussi le contexte dont on dépend (Pascale Thévenod)


    Test d int gration pour des syst mes objets

    Subsystem that can be integrated

    in one block

    (would need at least 1 stub)

    Remaining part of the system


    Test d int gration pour des syst mes objets

    D

    F

    H

    I

    J

    G

    • Mixte Big-Bang/incrémental strict

    A

    E

    C

    B


    Mixte big bang incr mental strict

    F

    H

    I

    J

    G

    Mixte Big-Bang/incrémental strict

    • 3 classes par composante : problème NP-complet … encore !

    D

    A

    E

    C

    B


    Mixte big bang incr mental strict1

    J

    Mixte Big-Bang/incrémental strict

    • 6 classes par composante

    D

    A

    E

    C

    F

    B

    H

    I

    G


    Test d int gration pour des syst mes objets

    Taille max SCC

    1

    5

    SMDS, 37 classes, 72 connects

    9

    9

    SmallEiffel, 104 classes, 140 connects

    1

    1

    InterViews, 146 classes, 419 connects

    6

    3

    Pylon, 50 classes, 133 connects

    3

    1

    Java, 588 classes, 1935 connects

    7

    6

    Swing, 694 classes, 3819 connects

    14

    1

    Mixte Big-Bang/incrémental strict


    Efficient strategies for integration and regression testing of oo systems19

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • A new problem

      • Testing Resources Optimal Repartition

    • Using the partial ordered tree (acyclic)

    • Assumption: a tester needs 1 time unit to integrate 1 component

      • to simplify presentation

      • Heuristic to reduce integration duration


    Test d int gration pour des syst mes objets

    Property

    Minimum steps >=max (A, B)

    A= longest_path

    B= [nb_nodes/nb_testers] +1

    4 testers

    37 nodes

    max length = 8

    Minimum steps= 10

    10


    Efficient strategies for integration and regression testing of oo systems20

    Efficient Strategies for Integration and Regression Testing of OO Systems

    A Test Resources Driven example

    SMDS

    An optimal solution

    components steps testers

    203318614

    1422271624

    12571734

    24122344

    1513293754

    3110342864

    211993274

    83036584

    263541194

    23101

    Reaches the optimal


    Efficient strategies for integration and regression testing of oo systems21

    Efficient Strategies for Integration and Regression Testing of OO Systems

    A Delay Driven example

    GNU Eiffel

    • Allocate the needed resources to obtain the minimum integration duration : at least (88 div 7 +1 = ) 13 testers

    • Minimum delay : 7 steps

    7

    6

    1

    5

    3

    4

    2


    Efficient strategies for integration and regression testing of oo systems22

    Efficient Strategies for Integration and Regression Testing of OO Systems

    A Delay Driven example

    GNU Eiffel

    7 steps

    =

    Optimum

    delay


    Efficient strategies for integration and regression testing of oo systems23

    Efficient Strategies for Integration and Regression Testing of OO Systems

    • Conclusions

      • an adapted test model

        • Test Dependency Graph

      • efficient algorithms

      • for early stage test planning (UML)

        • integration

        • non-regression

      • evolving with design evolution

      • test economics criterion (early repartition of testing resources)


  • Login