A Quick Intro to Model-Based Testing Harry Robinson, Test Architect Microsoft Engineering Excellence Group 45,000 tests in 45 minutes.

Slides:



Advertisements
Similar presentations
Debugging ACL Scripts.
Advertisements

Module 1: BLOCK 1 / MAIN MENU
2017/3/25 Test Case Upgrade from “Test Case-Training Material v1.4.ppt” of Testing basics Authors: NganVK Version: 1.4 Last Update: Dec-2005.
Getting Started with Microsoft Office 2007
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 2 Getting Started.
HOW TO USE … SAMIEEE FOR VOLUNTEER POSITIONS WITH AUTOMATIC ACCESS.
The Reinberger Childrens Library Center Step-by-step instructions for capturing a MARC record and adding a 658 Tag to a record.
Add Governors Discretionary (1G) Grants Chapter 6.
Teacher Name Class / Subject Date A:B: Write an answer here #1 Write your question Here C:D: Write an answer here.
Data Data is information
Patterns and sequences We often need to spot a pattern in order to predict what will happen next. In maths, the correct name for a pattern of numbers is.
Microsoft®.
3/17 Dividend Street, Mansfield, 4122, Queensland, Australia phone: web: The SuperCycler A Software.
Shapes and Designs Inv. 1.3: Tiling Activity.
Reservations PowerPoint Presentation Prepared by NFS Please follow the instructions at the top of each slide. Click anywhere to begin.
Introduction to Software Testing Chapter 1 Model-Driven Test Design Paul Ammann & Jeff Offutt
© Telcordia Technologies 2004 – All Rights Reserved AETG Web Service Advanced Features AETG is a service mark of Telcordia Technologies. Telcordia Technologies.
User Friendly Price Book Maintenance A Family of Enhancements For iSeries 400 DMAS from Copyright I/O International, 2006, 2007, 2008, 2010 Skip Intro.
Vanderbilt Business Objects Users Group 1 Reporting Techniques & Formatting Beginning & Advanced.
1 1 Mechanical Design and Production Dept, Faculty of Engineering, Zagazig University, Egypt. Mechanical Design and Production Dept, Faculty of Engineering,
Xilinx 6.3 Tutorial Integrated Software Environment (ISE) Set up basic environment Select Gates or Modules to Be simulated (Insert Program Code) Run Waveform.
Procedural Programming in C# Chapters Objectives You will be able to: Describe the most important data types available in C#. Read numeric values.
INTRODUCTION Lesson 1 – Microsoft Word Word Basics
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Office 2003 Integration Integrating Office 2003 Applications and the World Wide Web.
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Dynamic Access Control the file server, reimagined Presented by Mark on twitter 1 contents copyright 2013 Mark Minasi.
Benchmark Series Microsoft Excel 2013 Level 2
Media-X eWalk Walkthrough Install Training- Part Two Topic: Uploading Completed Walkthroughs Office of Institutional Education Programs 1.
Services Course Windows Live SkyDrive Participant Guide.
1 How Do I Order From.decimal? Rev 05/04/09 This instructional training document may be updated at anytime. Please visit and check the.
Types of selection structures
MUR-System Next We want with this PowerPoint show how easy it is to install the MUR-Systems hardware. You can try the full version of the software from.
Using the SmartPLS Software
Four Schools of Software Testing Workshop on Teaching Software Testing, Florida Tech, February 2003.
South Dakota Library Network MetaLib User Interface South Dakota Library Network 1200 University, Unit 9672 Spearfish, SD © South Dakota.
Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
User Friendly Item Relationship Maintenance A Family of Enhancements For iSeries 400 DMAS from  Copyright I/O International, 2006, 2007, 2008, 2010 Skip.
0 WPI First Experience Teaching Software Testing Lessons Learned Gary Pollice Worcester Polytechnic Institute and Rational Software Corp.
Benchmark Series Microsoft Excel 2013 Level 2
Using Macros and Visual Basic for Applications (VBA) with Excel
Windows XP Basics OVERVIEW Next.
A Quick Review of Unit 2 – Using Windows 7 Computing Fundamentals © CCI Learning Solutions.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
 Definition of HTML Definition of HTML  Tags in HTML Tags in HTML  Creation of HTML document Creation of HTML document  Structure of HTML Structure.
ADVANCED MICROSOFT POWERPOINT Lesson 6 – Creating Tables and Charts
HBar OR Reader Documentation A copy of the PowerPoint Viewer is shipped with the HBar OR Reader on the HBar Official Records [OR] CD. The PowerPoint Viewer.
Microsoft Windows LEARNING HOW USE AN OPERATING SYSTEM 1.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Problem Analysis and Program Design
Macros n Macros are little programs that you can create to automate particular tasks that you may want to execute more easily than having to specify all.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
What is software testing? 1 What are the problems of software testing? 2 Time is limited Applications are complex Requirements are fluid.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Model-Based Testing K J I H G F E D C B A Harry Robinson Google
VPL basic – data and variables Young Joon Kim MSRDS First Beginner Course – STEP6.
The Software Development Process
XP 1 ﴀ New Perspectives on Microsoft Office 2003, Premium Edition Excel Tutorial 2 Microsoft Office Excel 2003 Tutorial 2 – Working With Formulas and Functions.
Software Quality Assurance and Testing Fazal Rehman Shamil.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Introduction to Software Testing Model-Driven Test Design and Coverage testing Paul Ammann & Jeff Offutt Update.
Today We Will Review: Operating Systems (Windows) (week 3 & 4) Starting up MS Windows Desktop and its contents Functions of the desktop components Brain.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Introducing Python 3 Introduction to Python. Introduction to Python L1 Introducing Python 3 Learning Objectives Know what Python is and some of the applications.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
Excel Tutorial 8 Developing an Excel Application
Engineering and Debugging an App Chapter 15
Lecture 09:Software Testing
Model Based Testing Venkata Ramana Bandari, Expert Software Engineer
CSE 303 Concepts and Tools for Software Development
Presentation transcript:

A Quick Intro to Model-Based Testing Harry Robinson, Test Architect Microsoft Engineering Excellence Group 45,000 tests in 45 minutes or less!

CurrentWindow = WFndWndC("Calculator", "SciCalc") WSetWndPosSiz(CurrentWindow, 88, 116, 260, 260) CurrentWindow = WFndWndC("Calculator", "SciCalc") WSetWndPosSiz(CurrentWindow, 88, 116, 480, 317) CurrentWindow = WFndWndC("Calculator", "SciCalc") WSetWndPosSiz(CurrentWindow, 88, 116, 260, 260) Play "{Click 330, 131, Left}" The Villain of this Piece Awe-inspiring Unchanging Indecipherable

Traditional Automated Testing Imagine that this projector is the software you are testing.

Traditional Automated Testing Typically, testers automate by creating static scripts.

Traditional Automated Testing Given enough time, these scripts will cover the behavior.

Traditional Automated Testing But what happens when the software’s behavior changes?

So What’s a Model? A model is a description of a system’s behavior. Models are simpler than the systems they describe. Models help us understand and predict the system’s behavior.

Model-Based Testing Now, imagine that the top projector is your model.

Model-Based Testing The model generates tests to cover the behavior.

Model-Based Testing … and when the behavior changes…

Model-Based Testing … so do the tests.

Calculator Familiar enough Simple enough Complex enough Hard to test well

Exploratory Testing the Calculator hmm … let’s see … I Start the calculator, and the calculator starts running - OK. I select Scientific, and the calculator goes to Scientific mode. - Good. I Enter a Number, and the number appears in the display – Yup. I select Standard, and the calculator goes back to Standard mode - OK. … Start Scientific Enter a Number Standard …

Scripting the Calculator Testing StepActionResult 1StartCalculator should be Running 2ScientificCalculator in Scientific mode 3Enter NumberNumber in the display 4StandardCalculator in Standard mode … How did you think to try these actions in this order? And how did you know you’d end up with these results?

You Have a Model in your Head NotRunning Start Scientific Enter Number Standard ?

You Could Hand-Draw Your Model But you wouldn’t want to do that.

1Start 2Scientific 3Enter Number 4Standard 5… You Could Hand-Trace Test Sequences But you wouldn’t want to do that either.

Let the Machine Do It for You !

But first … … let’s talk about calculator’s behavior.

Let’s Start Simply

And Get a Bit More Complex

And Even More Complex

What Does This Model Care About? Application status: Running Not Running Mode status: Standard Scientific? Display status: Empty Not Empty

Find the Rules of your Model (Start) Natural Language If the Calculator is Not Running then the user can execute ‘Start’. When the user executes ‘Start’, the Calculator goes to ‘Running’ mode C# if (AppStatus == AppStatusValues.NotRunning) a.Add("start") AppStatus = AppStatusValues.Running;

Find the Rules of your Model (Standard) Natural Language If the Calculator is Running then the user can execute ‘Standard’. When the user executes ‘Standard’, the Calculator goes to ‘Standard’ mode and the display is cleared. C# if (AppStatus == AppStatusValues.Running) a.Add("standard"); if (ModeStatus == ModeStatusValues.Scientific) DisplayStatus = DisplayStatusValues.Empty; ModeStatus = ModeStatusValues.Standard;

Let the Machine Do It for You ! 1Start 2Scientific 3Stop 4Start 5Standard 6Stop 7Clear 8Stop 9Start 10Scientific 11Clear 12Enter Number 13Standard 14Clear 15…

So let’s generate a few thousand tests …

Executing the Test Actions, pt 1 while ( (strRecord = StreamToRead.ReadLine()) != null) { string[] individualWords = strRecord.Trim().Split(whitespace.ToCharArray(),strRecord.Length); switch( individualWords[1]) { }

Executing the Test Actions, pt 2 switch( individualWords[1]) { case "start": Process.Start("calc"); break; case "stop": SendKeys.SendWait("%{f4}"); break; case "standard": SendKeys.SendWait("%vt"); SetForegroundWindow(FindWindow(null, "Calculator")); break; …

A Brief Filk on Test Oracling If you wish to succeed As a tester you need To consider all matters oracular. Verifying is tough; Monkey tests aren’t enough; (Though the crashes are often spectacular!)

Executing the Test Actions, pt 3 // copy display contents to the clipboard SendKeys.SendWait("^c"); if ((individualWords[4] == "Empty") && (GetClipboardContent() != "0")) { Console.WriteLine(" mismatch"); } if ((individualWords[4] == "NotEmpty") && (GetClipboardContent() == "0")) { Console.WriteLine(" mismatch"); }

So let’s run a few dozen tests …

Doing Cool Stuff with Models

Beeline 1.Choose any 2 nodes in the path 2.Find the shortest path between them 3.Execute the spliced ‘shortcut’ path 4.Evaluate the results and repeat

That Was The Year That Wasn’t Start, Minimize, Stop, Start, Restore, Date

An 84-step bug repro sequence start about ok_about no_title doubleclick seconds restore seconds doubleclick doubleclick date about ok_about restore gmt maximize doubleclick doubleclick date seconds date stop start stop start stop start seconds date restore about ok_about no_title doubleclick digital doubleclick doubleclick no_title doubleclick no_title doubleclick seconds restore restore doubleclick doubleclick gmt analog maximize date digital minimize restore minimize stop start restore digital date minimize stop start maximize gmt digital restore doubleclick doubleclick about ok_about maximize digital digital digital seconds analog about ok_about about ok_about minimize stop start restore date

Reducing the Sequence: Initial path length: 84 steps Shortcut attempt 2 : repro sequence: 83 steps Shortcut attempt 3 : repro sequence: 64 steps Shortcut attempt 4 : repro sequence: 37 steps Shortcut attempt 5 : repro sequence: 11 steps Shortcut attempt 7 : repro sequence: 9 steps Shortcut attempt 20 : repro sequence: 8 steps Shortcut attempt 29 : repro sequence: 6 steps

# Repro Steps Over Time

Why Does Model-Based Testing Work? speed complexity model system under test “… I think that less than 10 percent of most programs’ code is specific to the application. Furthermore, that 10 percent is often the easiest 10 percent. Therefore, it is not unreasonable to build a model program to use as an oracle.” –Boris Beizer, Black Box Testing, p.63

Benefits of Model-Based Testing Easy test case maintenance Reduced costs/more tests Can run different tests on 1000s of machines Early bug detection Increased bug count Time savings Time to address bigger test issues Improved tester job satisfaction Start automated testing from Version 0.1

Obstacles to Model-Based Testing Comfort factor –This is not your parents’ test automation Skill sets –Need testers who can design Expectations –Models can be a significant upfront investment –Will never catch all the bugs Metrics –Bad metrics: bug counts, number of test cases –Better metrics: spec coverage, code coverage

Tools Used in this talk: – C#(is free) –Notepad(is just about free) –WinSTDtoDOT(was written by a friend)

Acknowledgments Michael Corning Rory Clark Wolfram Schulte Mike Barnett Margus Veanes Wolfgang Grieskamp

To Learn More Model-based testing website: Books: “Black-Box Testing : Techniques for Functional Testing of Software and Systems” by Boris Beizer “Testing Object-Oriented Systems: Models, Patterns, and Tools” by Robert Binder A real model-based testing tool: –Spec#

thanks!