An Introduction to MBT  what, why and when 张 坚 2015-9-11.

Slides:



Advertisements
Similar presentations
Model-Based Testing with Smartesting Jean-Pierre Schoch Sogetis Second Testing Academy 29 April 2009.
Advertisements

© SMARTESTING 2011 – This document is the property of Smartesting. It may not be reproduced in whole or in part Cliquez pour modifier le style du titre.
Test Yaodong Bi.
Verification and Validation
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Ossi Taipale, Lappeenranta University of Technology
Software Modeling SWE5441 Lecture 3 Eng. Mohammed Timraz
Presented by: Thabet Kacem Spring Outline Contributions Introduction Proposed Approach Related Work Reconception of ADLs XTEAM Tool Chain Discussion.
Using UML, Patterns, and Java Object-Oriented Software Engineering Royce’s Methodology Chapter 16, Royce’ Methodology.
® IBM Software Group © 2014 IBM Corporation Innovation for a smarter planet MBSE for Complex Systems Development Dr. Bruce Powel Douglass, Ph.D. Chief.
Software Testing and Quality Assurance
Copyright © 2006 Software Quality Research Laboratory DANSE Software Quality Assurance Tom Swain Software Quality Research Laboratory University of Tennessee.
1 SWE Introduction to Software Engineering Lecture 5.
 QUALITY ASSURANCE:  QA is defined as a procedure or set of procedures intended to ensure that a product or service under development (before work is.
Software Testing Prasad G.
Introduction to Software Testing
Generations of Test Automation COMP551 Week 3 Dr Mark Utting
Software Test Automation and Tools Speaker: Jerry Gao Ph.D. San Jose State University URL:
Test Design Techniques
TEST CASE DESIGN Prepared by: Fatih Kızkun. OUTLINE Introduction –Importance of Test –Essential Test Case Development A Variety of Test Methods –Risk.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
Copyright by Dr. Clarence Lau, IVE(TY)
Texas A&M University Department of Computer Science Sameh S. Sharkawi
CLEANROOM SOFTWARE ENGINEERING.
Balancing Practices: Inspections, Testing, and Others JAXA scenario (formal method) Masa Katahira Japanese Space Agency.
Copyright © Siemens AG All rights reserved. Essential Criteria on MBT to Ensure Quality of Software in Industry PVR Murthy Andreas Ulrich Siemens.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
Assessing the Suitability of UML for Modeling Software Architectures Nenad Medvidovic Computer Science Department University of Southern California Los.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
What is software testing? 1 What are the problems of software testing? 2 Time is limited Applications are complex Requirements are fluid.
University of Southern California Center for Systems and Software Engineering Model-Based Software Engineering Supannika Koolmanojwong Spring 2013.
Advanced Software Engineering: Software Testing COMP 3702 Instructor: Anneliese Andrews.
Agile Test-based Modeling 資工 聶順成. Outline  Introduction : Modeling meets Programming  Agile Modeling: Using Models in Agile Projects  Model-based.
Common Test Project CMU Presentation Jason Weighley Manager Test Engineering.
FDT Foil no 1 On Methodology from Domain to System Descriptions by Rolv Bræk NTNU Workshop on Philosophy and Applicablitiy of Formal Languages Geneve 15.
CS251 – Software Engineering Lecture 9: Software Design Slides by Mohammad El-Ramly, PhD
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Formal Methods.
Software Maintenance Speaker: Jerry Gao Ph.D. San Jose State University URL: Sept., 2001.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Model Based Testing implementing with tools Ruud van Houwelingen 1 December 2, 2009.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 4 Slide 1 Software Processes.
Software Quality Assurance and Testing Fazal Rehman Shamil.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Andrey Karaulov, Alexander Strabykin Institute for System Programming Russian Academy of Sciences SYRCoSE: Spring Young Researchers Colloquium on Software.
Whole Test Suite Generation. Abstract Not all bugs lead to program crashes, and not always is there a formal specification to check the correctness of.
C++ for Engineers and Scientists, Second Edition 1 Problem Solution and Software Development Software development procedure: method for solving problems.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
CS223: Software Engineering Lecture 25: Software Testing.
Cs498dm Software Testing Darko Marinov January 24, 2012.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVIII. Software Testing.
Prepared by: Fatih Kızkun
Regression Testing with its types
Object-Oriented Software Engineering Using UML, Patterns, and Java,
Coverage-Based Test Design CS 4501 / 6501 Software Testing
DEFECT PREDICTION : USING MACHINE LEARNING
Software Development Cycle
It is great that we automate our tests, but why are they so bad?
Chapter 1 Software Engineering.
Introduction to Software Testing
Lecture 09:Software Testing
Model Based Testing Venkata Ramana Bandari, Expert Software Engineer
Software Test Automation and Tools
Chapter 1 Introduction(1.1)
Presentation transcript:

An Introduction to MBT  what, why and when 张 坚

The Challenge

An Introduction to MBT 3 / The Challenge Koi Carp  Employ amateur fishermen  Place nets at strategic places  Electrofishing boat

An Introduction to MBT 4 / The Challenge Testing a new smart card payment system  Manual design/perform tests  Manual design tests + use automated test execution tools  Use state-of-the-art tools: Automatically generate tests from a model of your requirements Regenerate updated test suites each time the requirements change Exactly report the coverage of requirements

An Introduction to MBT 5 / The Challenge Benefits of the third solution  Get faster results with lower costs  Ensure a more systematic coverage Model-Based Testing

An Introduction to MBT 6 / What Do We Mean by Testing? Testing is an activity performed for evaluating product quality, and for improving it, by identifying defects and problems  IEEE Software Engineering Body of Knowledge 2004 Software testing consists of the dynamic verification of the behavior of a program on a finite set of test cases, suitably selected from the usually infinite executions domain, against the expected behavior

An Introduction to MBT 7 / What Do We Mean by Testing? Dynamic  Static techniques: inspections, static analysis Finite  Exhaustive testing is impossible Selected  Key challenge of testing Expected  Oracle problem

An Introduction to MBT 8 / What Do We Mean by Testing? Different kinds of testing

An Introduction to MBT 9 / What is Model-Based Testing? Four main approaches known as MBT  Generation of test input data from a domain model  Generation of test cases from an environment model  Generation of test cases with oracles from a behavior model  Generation of test scripts from abstract tests

An Introduction to MBT 10 / What is Model-Based Testing? Generation of test input data from a domain model  The model is the information about the domains of the input values  The test generation involves clever selection and combination of a subset of those values to produce test input data A: {red, greem, yellow}, B: 1..4, C: {car, truck, bike} All possible combinations: 3*4*3 = 36 tests Pairwise algorithm: 12 tests No oracles

An Introduction to MBT 11 / What is Model-Based Testing? Generation of test cases from an environment model  The model is the expected environment of SUT A statistical model of the expected usage of SUT  Generate sequences of calls to SUT from them No oracles

An Introduction to MBT 12 / What is Model-Based Testing? Generation of test cases with oracles from a behavior model  The model must describe the expected behavior of SUT  The only one that addresses the whole test design problem

An Introduction to MBT 13 / What is Model-Based Testing? Generation of test scripts from abstract tests  An abstract description of a test case A UML Sequence diagram A sequence of high-level procedure calls  The model is the information about the API of SUT and the details of transformation

An Introduction to MBT 14 / What is Model-Based Testing? Definition  Create a model of the expected SUT behavior  Generate tests from that model The automation of the design of black-box tests

An Introduction to MBT 15 / What is Model-Based Testing? What is a model?  Small  Detailed enough Tradeoff: which characteristics of the system should be modeled?

An Introduction to MBT 16 / What is Model-Based Testing? What notation should we use to write models?  State-based notations B, UML/OCL, Spec#  Transition-based notations FSM, UML State Machines  ……

An Introduction to MBT 17 / What is Model-Based Testing? Summary  MBT is the automation of black-box test design  The model must be concise and precise  Test cases (test data + oracles) can be automatically generated from the model  The tests produced from the model are abstract tests, so they must be transformed into executable tests

The Pain and the Gain

An Introduction to MBT 19 / Classic Testing Process Three key issues  Design the test cases  Execute the tests and analyzing the results  Verify how the tests cover the requirements The notations

An Introduction to MBT 20 / easy & cheap to start + flexible testing - expensive every execution - no auto regression testing - ad-hoc coverage - no coverage measurement A Manual Testing Process

An Introduction to MBT 21 / A Capture-Replay Testing Process + flexible testing + auto regression testing - expensive first execution - fragile tests break easily - ad-hoc coverage - no coverage measurement

An Introduction to MBT 22 / A Script-Based Testing Process +/- test impl. = programming + automatic execution + auto regression testing - fragile tests break easily? (depends on abstraction) - ad-hoc coverage - no coverage measurement

An Introduction to MBT 23 / A Keyword-Driven Testing Process + abstract tests + automatic execution + auto regression testing - ad-hoc coverage - no coverage measurement

An Introduction to MBT 24 / The Model-Based Testing Process + abstract tests + automatic execution + auto regression testing + auto design of tests + systematic coverage + measure coverage of model and requirements - modeling overhead

An Introduction to MBT 25 / Models: Build or Borrow? A good model is essential Reuse the development model?  Often a very bad idea   Not abstract enough  Not precise enough  Lack of independence Develop a test model from scratch? A middle path?  Reuse a high-level class diagram

An Introduction to MBT 26 / Your Modeling Maturity Level UML/OCL and MDA community  Level 0, No Specifications  Level 1, Textual  Level 2, Test with Diagrams  Level 3, Models with Text  Level 4, Precise Models  Level 5, Models Only Model-Based Testing

An Introduction to MBT 27 / Model-Based Testing Experience Reports Model-Based Testing at IBM  GOTCHA-TCBeans + TCtranslator POSIX fcntl:  +2 defects  -17% cost Java garbage collor:  +4 defects  Statement coverage: 78%  83%  -50% time spent

An Introduction to MBT 28 / Model-Based Testing Experience Reports Model-Based Testing at Microsoft  Spec#/Spec Explorer An interaction protocol of Windows  Discover 10 times more errors  Code coverage: 60%  70%  Expose twice as many design issues as implementation bugs

An Introduction to MBT 29 / Benefits of Model-Based Testing SUT Fault Detection  >= the manual process  Depend on the skill and experience Reduced Testing Cost and Time  Less time and effort Improved Test Quality  Based on algorithms and heuristics  Measure the quality by the coverage of model

An Introduction to MBT 30 / Benefits of Model-Based Testing Requirements Defect Detection  The model has a precise semantics  Expose issues in the informal requirements Traceability  Requirements-Model Annotate the model elements with requirement IDs  Model-Tests  Requirements-Tests

An Introduction to MBT 31 / Benefits of Model-Based Testing Requirements Evolution  Take less time to update  Incremental traceability Deleted Unchanged Changed Added

An Introduction to MBT 32 / Limitations of Model-Based Testing Cannot guarantee to find all the differences between the model and the implementation It requires different skills from manual test design  Modeling skills and programming skills Usually used only for functional testing Require a reasonable level of test maturity

Putting It into Practice

An Introduction to MBT 34 / Prerequisites for Model-Based Testing Someone enthusiastic Test execution maturity Modeling skills  The models for MBT are more precise than most UML models Access to training, tools, and experts  No independent training companies The right kind of application

An Introduction to MBT 35 / Selecting A Model-Based Testing Approach

An Introduction to MBT 36 / Model-Based Testing and Agile Methods

An Introduction to MBT 37 / Model-Based Testing and the Unified Process (UP) UP

An Introduction to MBT 38 / Model-Based Testing and the Unified Process (UP) Combine UP and MBT

An Introduction to MBT 39 / Future Trends Three major trends make the increased adoption of Model-Based Testing  Increasing level of complexity in modern software  Increasing demand for software with high quality  Increasing use of models in software development Expand into other kinds of testing More good studies that quantitatively measure the benefits and drawbacks of adopting MBT

Thanks