test d int gration pour des syst mes objets
Download
Skip this Video
Download Presentation
Test d’intégration pour des systèmes à objets

Loading in 2 Seconds...

play fullscreen
1 / 56

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


  • 131 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Test d’intégration pour des systèmes à objets' - fleur


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
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).
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

slide28

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

slide29

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

slide35

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)
slide37

Case study

SMDS

UML diagram

slide38

Case study

SMDS

Test Dependency Graph

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)
slide46

Subsystem that can be integrated

in one block

(would need at least 1 stub)

Remaining part of the system

slide47

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

slide50

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
slide52

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

20 33 18 6 1 4

14 22 27 16 2 4

1 25 7 17 3 4

24 12 2 3 4 4

15 13 29 37 5 4

31 10 34 28 6 4

21 19 9 32 7 4

8 30 36 5 8 4

26 35 4 11 9 4

23 10 1

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)
ad