La présentation est en train de télécharger. S'il vous plaît, attendez

La présentation est en train de télécharger. S'il vous plaît, attendez

Test dintégration pour des systèmes à objets Yves Le Traon

Présentations similaires


Présentation au sujet: "Test dintégration pour des systèmes à objets Yves Le Traon"— Transcription de la présentation:

1 Test dintégration pour des systèmes à objets Yves Le Traon yletraon@irisa.fr

2 Yves Le Traon 2002 2 Contexte Réalisation dune « bonne » stratégie : pour planifier lintégration des systèmes à objets, le plus tôt possible dans le cycle de vie, en minimisant le coût du test.

3 Yves Le Traon 2002 3 Test dintégration Objectif Vérifier linteraction entre unités (méthode, classe ou package). Difficultés principales de linté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 dunités (ex. risque dutilisation hors domaine).

4 Yves Le Traon 2002 4 Architecture de dépendances Unité à testerDépendance à tester

5 Yves Le Traon 2002 5 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)

6 Yves Le Traon 2002 6 Approche classique : De haut en bas Unité à testerDépendance à tester Dépendance sous test Unité sous test Bouchon de test (stub) Dépendance simulée Unité testée Dépendance testée

7 Yves Le Traon 2002 7 Approche classique : De bas en haut Unité à testerDépendance à testerUnité sous testUnité testéeDépendance sous testDépendance testée

8 Yves Le Traon 2002 8 (…) Cycle de vie en « spirale » Intégration Réalisation Conception Analyse détaillée Analyse préliminaire « (de risque) » V1V2 Validation Synergie avec approche par objets

9 Yves Le Traon 2002 9 Test unitaire et dintégration Classiquement Étapes séparées Dans un cycle en spirale Un composant unitaire ne peut pas être testé hors de son contexte dexécution > conséquence : test unitaire et test dintégration sont des activités inséparables

10 Yves Le Traon 2002 10 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.

11 Yves Le Traon 2002 11 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

12 Yves Le Traon 2002 12 Efficient Strategies for Integration and Regression Testing of OO Systems Integration plan - What we have to deal with... Where to begin with ? How to organize test ? problem interdependencies loops of dependencies between components into an architecture

13 Yves Le Traon 2002 13 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 pck1pck2 pck3 pck4 S

14 Yves Le Traon 2002 14 Interdépendance Interdépendances Cycle de dépendances Composantes fortement connexes (CFC) Intégration Big-Bang Décomposer des CFCs – Utilisation de bouchons

15 Yves Le Traon 2002 15 Décomposition des CFCs – Bouchon Bouchon : une unité qui simule le comportement dune unité évite lutilisation des services dautres unités de la même CFC. A B CC Bouchon réaliste A B C CFC A B C CACA CBCB Bouchon spécifique

16 Yves Le Traon 2002 16 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 A Test depends on C C stub B Test depends on

17 Yves Le Traon 2002 17 Efficient Strategies for Integration and Regression Testing of OO Systems Minimizing the number of stubs specific stub => deterministic component behavior A Test depends on C B A C stub B Test depends on C stub A stub for A and a stub for B

18 Yves Le Traon 2002 18 Problème de test dinté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.

19 Yves Le Traon 2002 19 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

20 Yves Le Traon 2002 20 Efficient Strategies for Integration and Regression Testing of OO Systems 2 types of nodes class node method node A A A … mA1(…)... A mA1 Class A Class node Method mA1 in Class A Method node in a class node The Test Dependency Graph preliminary modeling

21 Yves Le Traon 2002 21 Efficient Strategies for Integration and Regression Testing of OO Systems 3 types of edges class_to_class method_to_class method_to_method … A B A is test dependent from B Semantic of a directed edge Semantic of a directed edge The Test Dependency Graph preliminary modeling

22 Yves Le Traon 2002 22 Efficient Strategies for Integration and Regression Testing of OO Systems Method_to_class A... +mA1(...v1: B...) … mA2(…v: A…)... A mA1 mA2 B Method_to_method A +mA1(...v: B...) {… v.mB1 …} +mA2(...v: A...) {… v.mA1 …} A mA1 mA2 B mB1 an action language (ASL/OCL) code level refinement …

23 Yves Le Traon 2002 23 Efficient Strategies for Integration and Regression Testing of OO Systems Class-to-class A B A B association A B composition A B aggregation A B navigability dependency A B A C B association class A B Interfaces Interface Name A B A B inheritance A BC

24 Yves Le Traon 2002 24 Modélisation statique 1/2 B A B A Une classeUn nœud A A A B A B A B A B B A A B A B B A A B A B

25 Yves Le Traon 2002 25 Modélisation statique 2/2 A B A B B A B A «bind» <B><B> AB B A T A B B A B A B A A B

26 Yves Le Traon 2002 26 Modélisation dynamique C B AC B AC B AC B A A «abstract» BA BCD CA DA E AF FE et

27 Yves Le Traon 2002 27 Éliminer les doublons B A B A B A B A B A B A B A B A

28 Yves Le Traon 2002 28 Efficient Strategies for Integration and Regression Testing of OO Systems B +mB1(v1: C) … -pB1(v: C) -pB2(v: G) …. #redefine pA1 {…} D - pD1(v1:E, v2 : F) E F C H G +mA1(v1: C) {….} #pA1(…) {…} A F E B GH pA1 mB1 pB1 pB2 A C D mA1 pD1 pA1 Implementation dependency Client contractual dependency Inheritance contractual dependency

29 Yves Le Traon 2002 29 Efficient Strategies for Integration and Regression Testing of OO Systems Implementation-dependent graph F E B GH pA1 mB1 pB1 pB2 A C D mA1 pD1 pA1 Delete non-reusable part C D A mA1 B mB1 Contractual graph

30 Yves Le Traon 2002 30 Efficient Strategies for Integration and Regression Testing of OO Systems Normalization rules mB1 mB2 mB3 Preliminary test dependency graph A mA1 mA2 B Problem : Not a classical graph AB class-to-class graph solution 1 Loss of information A mA1 mA2 B mB1 mB2 mB3 mixed classes and methods graph solution 2 No loss of information homomorphism

31 Yves Le Traon 2002 31 Efficient Strategies for Integration and Regression Testing of OO Systems An efficient strategy (1) a b e k f d c i j g h l Optimal ordering => NP-complete complexity = n!

32 Yves Le Traon 2002 32 Efficient Strategies for Integration and Regression Testing of OO Systems An efficient strategy (2) Tarjans algorithm Determination and ordering of connected components A B C [(e) or C][A or B][(a)]then a b e k f d c i j g h l a b e k f d c i j g h l Complexity linear with #nodes

33 Yves Le Traon 2002 33 Efficient Strategies for Integration and Regression Testing of OO Systems An efficient strategy (3) Bourdoncles algorithm Break the connected component Reapply Tarjan [(e) or C][A or B][(a)]then f i j g h 2 3 4 5 [g, h, j, i, f][c, b, d][l, k] Candidate node = # max(fronds) B f i j g h 1

34 Yves Le Traon 2002 34 Result = a partial ordered tree all possible strategies a b e k f d c i j g h l #specific stubs = 4 #realistic stubs = 3 Random selection Optimized algorithm #specific stubs = 9.9 #realistic stubs = 5 Partial ordered tree Efficient Strategies for Integration and Regression Testing of OO Systems

35 Yves Le Traon 2002 35 Exo Plan de test dintégration pour : B E F H G A C D IJ

36 Yves Le Traon 2002 36 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)

37 Yves Le Traon 2002 37 Case study SMDS UML diagram

38 Yves Le Traon 2002 38 Case study SMDS Test Dependency Graph

39 Yves Le Traon 2002 39 SMDS realistic stubs

40 Yves Le Traon 2002 40 Gnu Eiffel Compiler

41 Yves Le Traon 2002 41 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

42 Yves Le Traon 2002 42 Efficient Strategies for Integration and Regression Testing of OO Systems 25 26 27 28 20 36 26 39 34 20 48 26 47 38 20 0 10 20 30 40 50 60 RCMCRTMTOptim. Strategies #stubs Min Mean Max Specific stubs

43 Yves Le Traon 2002 43 Efficient Strategies for Integration and Regression Testing of OO Systems 13 19 18 19 9 21 19 25 24 9 29 19 30 27 9 0 5 10 15 20 25 30 35 RCMCRTMTOptim. Strategies #stubs Min Mean Max Realistic stubs

44 Yves Le Traon 2002 44 Results summary 22 25 22 32 25 35 28 9 43 46 34 0 10 20 30 40 50 RCMCRTMTOptim. #stubs 40 38 27 63 28 63 34 17 87 85 27 0 20 40 60 80 100 RCMCRTMTOptim. #stubs Min Mean Max SMDS case study GNU Eiffel case study Specific stubs countingRealistic stubs counting 25 27 28 36 26 39 34 20 48 47 38 0 10 20 30 40 50 60 RCMCRTMTOptim. #stubs 13 18 19 21 19 25 24 9 29 30 27 0 10 20 30 RCMCRTMTOptim. #stubs

45 Yves Le Traon 2002 45 Variantes possibles Mixte Big-Bang/Incrémental strict Planifier aussi le contexte dont on dépend (Pascale Thévenod)

46 Yves Le Traon 2002 46 Subsystem that can be integrated in one block (would need at least 1 stub) Remaining part of the system

47 Yves Le Traon 2002 47 Mixte Big-Bang/incrémental strict B E F H G A C D IJ

48 Yves Le Traon 2002 48 3 classes par composante : problème NP- complet … encore ! B E F H G A C D IJ Mixte Big-Bang/incrémental strict

49 Yves Le Traon 2002 49 6 classes par composante B E F H G A C D I J Mixte Big-Bang/incrémental strict

50 Yves Le Traon 2002 50 Taille max SCC 15 SMDS, 37 classes, 72 connects 99 SmallEiffel, 104 classes, 140 connects 11 InterViews, 146 classes, 419 connects 63 Pylon, 50 classes, 133 connects 31 Java, 588 classes, 1935 connects 76 Swing, 694 classes, 3819 connects 141 Mixte Big-Bang/incrémental strict

51 Yves Le Traon 2002 51 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

52 Yves Le Traon 2002 52 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 Property

53 Yves Le Traon 2002 53 Efficient Strategies for Integration and Regression Testing of OO Systems An optimal solution components steps testers 203318614 1422271624 12571734 24122344 1513293754 3110342864 211993274 83036584 263541194 23101 Reaches the optimal A Test Resources Driven example SMDS

54 Yves Le Traon 2002 54 Efficient Strategies for Integration and Regression Testing of OO Systems Allocate the needed resources to obtain the minimum integration duration : at least (88 div 7 +1 = ) 13 testers Minimum delay : 7 steps A Delay Driven example GNU Eiffel 1 2 3 4 5 7 6

55 Yves Le Traon 2002 55 Efficient Strategies for Integration and Regression Testing of OO Systems A Delay Driven example GNU Eiffel 7 steps = Optimum delay

56 Yves Le Traon 2002 56 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)


Télécharger ppt "Test dintégration pour des systèmes à objets Yves Le Traon"

Présentations similaires


Annonces Google