Tutorial MBT For Beginners - ETSI - 8th UCAAT

Transcription

TutorialMBT for BeginnersEddie JaffuelConsultant1

Agenda Introduction (15 min)MBT as a black box (35 min)Open the box (20 min)The value of MBT (10 min)Questions (10 min)2

Agenda Introduction––––– The speakerWhat is MBT ?Goal of the tutorialFocus of the tutorialMBT Process overviewMBT as a black boxOpen the boxThe value of MBTQuestions3

Who is Eddie JAFFUEL? Independent consultant Expert in Modeling and Model Based Testing for 10 years–––––Proof Of ConceptsDeployment Pilot ProjectsTraining, Coaching and Knowledge TransferModel ProductionTechnical Lead and Project Manager for the MBT technics: Information Technologies Automotive industries Embedded Systems (Smartcard & Device industries) MBT applied toCompliance Testing (KeyNote) More information 4

What is MBT ? The context:RequirementManagement Test DesignBusiness AnalystRobotGestionTestManagementdes testsTest AnalystTestExecutionTesterManual design5

What is MBT ? MBT Model Based TestingFocused on Test DesignCombines a method: Model-BasedAnd a Technology: automatic test generation from a modelRequirementManagement Test DesignMBT SolutionTest DesignBusiness AnalystRobotGestionTestManagementdes testsTest AnalystTestExecutionTesterManual designComputer-aided Design6

Goal of the tutorial Understand the principles of MBT– How a MBT Tool may deduce tests from a Model ? Explanation based on One MBT Methodology––––from the Requirements through the Test Objective Charter through the Behavioral Modelto the generated Tests for manual execution Benefits of MBT approach– Different levels of factorization,– Ability to manage changes more efficiently through MBT7

Focus of the TutorialCriteriaFocus of the tutorialNot covered by tutorialbut MBT is also applicable forKind of System UnderTestWeb based applicationApplication Java / ERP / CRMMulti-ApplicationsSystem / Interface to access toSUTGraphical User Interface API / Services / SOAFlow / Level of testApplication TestingFunctional TestingSystem TestingIntegration TestingCompliance Testing Nature of test execution Manual ExecutionAutomated ExecutionTest formatHTMLTTCN, XML, script languages,VB, C, Java ModelUML (Unified ModelingLanguage)BPMN, MBT Solution/ProductSmartesting CertifyItConformiq, Matelo,SpecExplorer, .8

BPMNWhat kind of tests ?Model-BasedTestingSystemTestingEnd-to-end test,ERP, CRM UMLIntegrationTestingApplicationTestingAcceptance testmulti-applications /servicesFunctional testsingle applicationFocus of the tutorial9

MBT Process OverviewTest DesignBehavioralModelSpecificationsTest AnalystMBT ToolGeneratedTest SequencesTest Objective Charter(XLS)Test Objective CharterTest Plan(HTML)ClientTests in otherformats Manual Tester10

Agenda Introduction MBT as a black box––––Introduction of the System Under TestTest Objective CharterBehavioral ModelTest Plan Publication Open the box The value of MBT Questions11

Introduction of the System Under Test (1/4) It is a simple Web Application : Sims Features– Manage the inhabitants (Add / Delete / Edit)– Marry the inhabitants– Divorce the inhabitants Navigation– Start at HOME– Go to CHURCH to perform a Marriage, once done go back HOME– Go to COURT to perform a Divorce, once done: go back HOME12

Introduction of the System Under Test (2/4)13

Introduction of the System Under Test (3/4)14

Introduction of the System Under Test (4/4)15

Agenda Introduction MBT as a black box––––Introduction of the System Under TestTest Objective Charter Test Objective CharterBehavioral ModelTest Plan Publication Open the box The value of MBT Questions16

Test Objective Charter (1/3)Test Objective Charter a « Test Objective Charter » (TOC) helps to– List and Identify the REQuirements or Business Rules to cover– Describe the Expected Coverage (Test AIMS) WHAT to cover17

Test Objective Charter (2/3)Test Objective Charter18

Test Objective Charter (3/3)Test Objective Charter19

Agenda Introduction MBT as a black box––––Introduction of the System Under TestTest Objective CharterBehavioralBehavioral ModelModelTest Plan Publication Open the box The value of MBT Questions20

BehavioralModelBehavioral Model The different components of the Behavioral Model:– Static part Points of Control and Observation Operations Data Representation ClassesPoint Control Obs– Dynamic part Initial Data of the System Under Test (SUT) Objects Flows State Machine Business Rules OCL: Object Contraint Language21

Behavioral Model:Points of Control OperationsBehavioralModelPoint Control Obs22

Behavioral Model:Points of Control Operations ParametersBehavioralModelPoint Control Obs23

Behavioral Model:Points of Control Operations ParametersBehavioralModelPoint Control Obs24

Behavioral Model:Points of Observation OperationsBehavioralBehavioalModelModelPoint Control Obs25

Behavioral ModelBehavioralModel The different components of the Behavioral Model:– Static part Points of Control and Observation Operations Data Representation Classes Data Representation– Dynamic part Initial Data of the System Under Test (SUT) Objects Flows State Machine Business Rules OCL: Object Contraint Language26

Behavioral Model :Data RepresentationBehavioralModel The Class diagrams helps to model the Data representation– Classes helps to represent the Business Entities– Attributes are the characteristics of the Business Entities– Association are the relations between Business EntitiesData Representation27

Behavioral ModelBehavioralModel The different components of the Behavioral Model:– Static part Points of Control and Observation Operations Data Representation Classes– Dynamic part Initial Data of the System Under Test (SUT) Objects Initial Data of SUT Flows State Machine Business Rules OCL: Object Contraint Language28

Behavioral Model:Initial Data of the SUTBehavioralModel The Object diagram used to model the Initial Data of the SUT– Objects are instance of Business EntitiesInitial Data of SUT29

Behavioral ModelBehavioralModel The different components of the Behavioral Model:– Static part Points of Control and Observation Operations Data Representation Classes– Dynamic part Initial Data of the System Under Test (SUT) Objects Flows State MachineFlows Business Rules OCL: Object Contraint Language30

Behavioral Model:Dynamic FlowsBehavioralModel The State Machine used to model the Dynamic Flows– With States and TransitionsFlows31

Behavioral ModelBehavioralModel The different components of the Behavioral Model:– Static part Points of Control and Observation Operations Data Representation Classes– Dynamic part Initial Data of the System Under Test (SUT) Objects Flows State Machine Business Rules OCL: Object Contraint Language Business Rules32

Behavioral Model:Business RulesTest Objective CharterBehavioralModelBusiness Rules33

Behavioral Model:Business RulesBusiness RulesBehavioralModelTest Objective Charter34

Agenda Introduction MBT as a black box––––Introduction of the System Under TestTest Objective CharterBehavioral ModelTest Plan Publication Test Plan Open the box The value of MBT Questions(HTML)35

Test Plan Publication (HTML)Test Plan(HTML)36

Test Plan Publication (HTML)Test Plan(HTML)37

Test Plan Publication (HTML)Test Plan(HTML)38

Test Plan Publication (HTML)Test Plan(HTML)Point Control Obs39

MBT Process OverviewTest DesignBehavioralModelSpecificationsTest AnalystMBT ToolAny kind of Magic ? Let’s open the box!GeneratedTest SequencesTest Objective Charter(XLS)Test Objective CharterTest Plan(HTML)ClientManual Tester40

Agenda IntroductionMBT as a black boxOpen the boxThe value of MBTQuestions41

Test Generation DetailsBehavioralModelMBT ToolFlowsBusiness RulesFlowsBusiness Rules1MBT ToolCoverage CriteriaGeneratedTest TargetsMBT Tool 2Initial Data of SUTGeneratedTest SequencesGeneratedTest Sequences42

1 Test Target Generation from Model Flows1)Flows1MBT ToolCoverage Criteria Cover all transitions Cover all states Coverage CriteriaGeneratedTest TargetsTest Targets Cover Transition « Marry » Cover Transition « Divorce » 43

1 Test Target Generation from Business Rules1)Coverage Criteria Cover all branches of the Rules Cover all conditions in a decision Business Rules1MBT ToolCoverage CriteriaGeneratedTest TargetsTest Targets for « Marry » Cover Behavior « Error same person » Cover Behavior « Error same gender » Cover Behavior « Error one is not adult » Only person1 is adult Only person2 is adult The 2 persons are not adult 44

2 Test Sequence Generation from Model Flows2)Test Target:- Cover the Transition « Marry »GeneratedTest TargetsFlowsMBT Tool 2GeneratedTest SequencesTest Sequence to cover that Test Target1) Go to church2) Marry45

2 Test Sequence Generation From Business Rules2)Test Target:- Transition « Marry »- Behavior « Error same person »GeneratedTest TargetsBusiness RulesInitial Data of SUTMBT Tool 2GeneratedTest SequencesTest Sequence to cover that Test Target1) Go to church2) Marry (person1 EDDIE,person2 EDDIE)Expected Result:Message ERROR MARIAGE SAME PERSON46

2 Test Sequence Generation From Business Rules2)Test Target:- Transition « Marry »- Behavior « Error one is already married »GeneratedTest TargetsBusiness RulesInitial Data of SUTMBT Tool 2GeneratedTest SequencesTest Sequence to cover that Test Target1) Go to church2) Marry (person1 DOOLEY,person2 CHRISTELLE)Expected Result:Message ERROR MARIAGE NOT SINGLE47

MBT PrinciplesFlowsBusiness RulesFlowsBusiness Rules1MBT ToolCoverage CriteriaGeneratedTest TargetsMBT Tool 2Initial Data of SUTGeneratedTest SequencesComplexity ? MBT is dedicated to manage complexity and to reduce it Main key points are: Factorization and Reusability Let’s see the impact of functional changes in the Model48

Agenda IntroductionMBT as a black boxOpen the boxThe value of MBTQuestions49

Change in Model FlowsInitial Data of SUTBusiness RulesMBT ToolFlowsTest Sequence1) Go to town hall2) Go to church3) Marry (person1 EDDIE,person2 EDDIE)Expected Result:Message ERROR MARIAGE SAME PERSONTest Sequence1) Go to town hall2) Go to church3) Marry (person1 DOOLEY,person2 CHRISTELLE)Expected Result:Message ERROR MARIAGE NOT SINGLE50

Change in Business Rules« Marriage between same gender now Allowed » Impact in Business Rules only at 1 placeBusiness RulesInitial Data of SUTFlowsMBT ToolDeleted Test Sequence for the « Error Same Gender »New Test Sequences for the cases with Same Gender Male-Male Female-Female51

Change in Initial Data of SUTDo not want to define any pre-requisites for Initial Data Impact in « Initial Data of SUT » only which is now emptyInitial Data of SUTBusiness RulesFlowsMBT ToolTest Target:- Transition « Marry »- Behavior « Error one is already married »Updated Test Sequence to cover that Test Target1) Add Inhabitant (id ID1, gender MALE, age 20)2) Add Inhabitant (id ID2, gender FEMALE, age 21)3) Go to church4) Marry (person1 ID1, person2 ID2)Expected Result: Message SUCCESS5) Go to church6) Marry (person1 ID1, person2 ID2)Expected Result: Message ERROR MARRIAGE NOT SINGLE7) Delete Inhabitant (ID1)8) Delete Inhabitant (ID2)52

As Take Away The metaphore for MBT Change Management Other benefits of MBT– Regarding specifications, Model is closer than Tests– Early raise issues in specifications– Booster for test automation of the tests53

Agenda IntroductionMBT as a black boxOpen the boxThe value of MBTQuestions54

Thank your for attention !Any question ?Eddie.Jaffuel@eConsult.fr55

Tutorial MBT for Beginners Eddie Jaffuel Consultant . 2 Agenda Introduction (15 min) MBT as a black box (35 min) Open the box (20 min) The value of MBT (10 min) Questions (10 min) 3 Agenda .