Microsofts Protocol Documentation Program: A Success Story for Model-Based Testing Yiming Cao, Lead Software Design Engineer Windows Interoperability Engineering.

Slides:



Advertisements
Similar presentations
Sugar 2.0 Formal Specification Language D ana F isman 1,2 Cindy Eisner 1 1 IBM Haifa Research Laboratory 1 IBM Haifa Research Laboratory 2 Weizmann Institute.
Advertisements

By Rick Clements Software Testing 101 By Rick Clements
1 Introducing the Specifications of the Metro Ethernet Forum MEF 19 Abstract Test Suite for UNI Type 1 February 2008.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Making the System Operational
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Software Engineering COMP 201
Services Course Office Web Apps Participant Guide.
Server Access The REST of the Story David Cleary
Week 2 The Object-Oriented Approach to Requirements
© Telcordia Technologies 2004 – All Rights Reserved AETG Web Service Tutorial AETG is a service mark of Telcordia Technologies. Telcordia Technologies.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Electric Bus Management System
Preface Demo A Quick Thank You How Did We Do It?
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Configuration management
Chapter 5 – Enterprise Analysis
Turing Machines.
Parallel Performance Tools in Visual Studio 2010.
OOAD – Dr. A. Alghamdi Mastering Object-Oriented Analysis and Design with UML Module 3: Requirements Overview Module 3 - Requirements Overview.
Software testing.
Testing Workflow Purpose
© Telcordia Technologies 2004 – All Rights Reserved AETG Web Service Advanced Features AETG is a service mark of Telcordia Technologies. Telcordia Technologies.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
KETTŐŐ + EGY Comming Soon Comming Soon.
Services Course Outlook Live Participant Guide.
Services Course Windows Live Groups Participant Guide.
Services Course Windows Live SkyDrive Participant Guide.
Chapter 10 Software Testing
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 14: Simulations 1.
Towards Corrective Assurance in Adaptive Service-Based Applications Raman Kazhamiakin 1, Andreas Metzger 2, Marco Pistore 1 FBK-Irst, Trento, Italy SSE,
PSSA Preparation.
14-1 © Prentice Hall, 2004 Chapter 14: OOSAD Implementation and Operation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh.
TCP/IP Protocol Suite 1 Chapter 18 Upon completion you will be able to: Remote Login: Telnet Understand how TELNET works Understand the role of NVT in.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Interactivity Navigating a data model Working with large quantities of data Entry Editing and adding data User feedback and validation Presentation.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

Project Portfolio Management Business Priorities Presentation.
customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
DST 2007 ██ Areas that observe daylight saving time ██ Areas that once observed daylight saving time ██ Areas that have never observed daylight saving.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Cheryl Johnson VSTS Solution Expert | Canarys Automations Pvt Ltd Performance Testing.

demo User Signs Up Temporary Account is Created with Verification Link Sent User Clicks Link Account is Activated Login.Register(userName,
Unit testing your metro style apps built using XAML
Microsoft Virtual Academy
Developing Drivers in Visual Studio
Manual testing of Windows Metro style apps built using HTML
Tech·Ed North America /14/2018 7:13 PM
TechEd /11/ :44 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Microsoft Virtual Academy
Microsoft Virtual Academy
Inside the Windows 8 driver developer workflow
Getting Started with Team Foundation Service
Jamie Cool Program Manager Microsoft
Microsoft Virtual Academy
Presentation transcript:

Microsofts Protocol Documentation Program: A Success Story for Model-Based Testing Yiming Cao, Lead Software Design Engineer Windows Interoperability Engineering Team, Microsoft Corporation Dagstuhl SeminarDagstuhl Seminar, October 2010, Leibniz-Zentrum für Informatik, Germany.

Part 1: Background Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/2010 2

Microsoft Open Protocols Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/2010 3

BlueLine Technical Document Testing Program of Windows (as of 03/09) 222 protocols/technical documents tested 22,847 pages studied and converted into requirements 36,875 testable requirements identified and converted into test assertions 69% tested using MBT 31% tested using traditional test automation 66,962 person days (250+ years) Hyderabad: 250 test engineers Beijing: 100 test engineers Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/2010 4

Formalization Technical Document Test Suite English Statements (Requirements) Assertions Checked against Windows (Accuracy) Validate consistency Simulate implementation process Validate consistency Simulate implementation process Test-Driven Document Quality Assurance Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/2010 5

Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation Study Document study Test strategy (modeled or traditional) Requirements spec (initial) Estimates of Effort Plan Requirements spec (final) Test plan Architecture Scenarios Design Test design Model, or Test case descriptions Adapter Design Final Test case code Generated, or Manual Adapter Implementation Test logs and report Network captures Test setup artifacts Process: Managing a Project with 350 Test Engineers Review after every phase High-profile reviewer team consisting of industry experts and Microsoft senior engineers, build along the model of a program committee Review based on process report and test suite artifacts Verdict accept, conditional accept, reject 9/4/2010 6

Requirements Tracking Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation Technical Document Requirements Spec Model or Test Design Test Suite Logs Network Captures Statements identified in document and tracked with requirement ID IDs referenced from model or test assertion IDs logged at test execution time IDs send to network as beacon packages for network monitor capturing manual automated 9/4/2010 7

Typical Requirements Specification Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation Verification Comment Use this column to explain the reason why the requirement is non-verifiable or unverified (for Normative, Server requirements). Req ID Doc Sect Descrip tion Pos Neg Derive d Scenari os Behavi or Scope Priority Inform ative/ Norma tive Verifica tion Verifica tion Comm ent MS- CHAP_R When a peer receives a Failure-Request message, if the embedded MSCHAPv2 packet indicates a password expiration error, the peer MAY reply with a Change- Password-Response message. ProtocolClientp2NormativeUnverifiedClient behavior not verified. MS- CHAP_R In addition, the authentication phase is terminated by sending an EAP-Success/EAP-Failure packet to the peer. S1,S2,S3,S4, S5,S6 ProtocolServerp2Informativ e Test Case MS- CHAP_R An EAP server MUST transmit a Challenge- Request message to initiate an Extensible Authentication Protocol Method for Microsoft CHAP authentication procedure. S1,S2,S3,S4, S5,S6,S7,S8 ProtocolServerp0NormativeTest Case 9/4/2010 8

Part 2: Model-Based Test Suite Development Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/2010 9

Model-Based Document Analysis Model Implementation Expected Outputs (Test Oracle) Inputs (Test Sequences) Control Document Generate Observe Feedback Author Issue Feedback Verdict Feedback Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Process Drilldown Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation Gather Requirements Define ActionsDefine Adapters Model & Explore Generate TestsImplement Adapters Run Tests 9/4/

Gathering Requirements Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation Gather Requirements Define ActionsDefine Adapters Model & Explore Generate TestsImplement Adapters Run Tests 9/4/

Developing and Implementing Adapters Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation Gather Requirements Define Actions Define Adapters Model & Explore Generate Tests Implement Adapters Run Tests 9/4/

Adapter Interface TC Test Cases (traditional or MBT) TC Adapter Implementation SUT (System under test) Abstracts SUT functionality Contract between teams Test case team Adapter team Pluggable Different server setups Different transports Test Adapters Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Develop Model and Generate Tests Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation Gather Requirements Define Actions Define Adapters Model & Explore Generate Tests Implement Adapters Run Tests Potential dependency on data types 9/4/

Spec Explorer 2010 Technology Breakdown Model programs Guarded state update rules Rich object-oriented model state (collections, object graphs) Language agnostic (Based on.Net intermediate language interpretation) Trace patterns Regular style language to represent scenarios Slicing of model program by composition Symbolic state exploration and test generation Expands parameters using combinatorial interaction testing Extracts a finite interface automaton (IA) from composed model Traverses IA to generate standalone test code –or- Runs on-the-fly tests from IA Integrated into Visual Studio 2010 Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Spec Explorer 2010 Look & Feel Explore Analyze Generate Execute C# Model (or other.Net Language) Model Graph Test Suite VSTT Result Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Spec Explorer Walkthrough: Chat Example Users can Enter the session Exit the session List all session users Broadcast a message Received by all session users 18 Chat Room Server User1 SUT User2User3 What happens if two users broadcast a message at virtually the same time?

Chat Requirements 19 R1: User MUST receive response for logon request R2: User MUST receive response for logoff request R3: User MUST receive response for list request R4: List response MUST contain the list of logged-on users if successful R5: All logged-on users MUST receive broadcast message R6: Messages from one sender MUST be received in order

Chat traces Is the trace correct? (Assume two users (user1, user2) are logged on) 20 T1 Broadcast(user1,1) Broadcast(user2,2) BroadcastAck (user2,1) BroadcastAck (user1,2) BroadcastAck (user1,1) BroadcastAck (user2,2) T2 Broadcast (user1,1) Broadcast (user2,2) BroadcastAck (user1,2) BroadcastAck (user1,1) BroadcastAck (user2,1) BroadcastAck (user2,2) T3 Broadcast (user1,1) Broadcast (user2,2) BroadcastAck (user1,2) BroadcastAck (user2,2) BroadcastAck (user1,1) BroadcastAck (user2,1) If each user sends one message, any receiving order is correct!

Chat traces Is the trace correct? (Assume two users (user1, user2) are logged on) 21 T4 Broadcast(user1,1a) Broadcast(user1,1b) BroadcastAck(user2,1a) BroadcastAck(user1,1a) BroadcastAck(user1,1b) BroadcastAck(user2,1b) T5 Broadcast(user1,1a) Broadcast(user1,1b) BroadcastAck(user1,1a) BroadcastAck(user2,1b) BroadcastAck(user1,1b) BroadcastAck(user2,1a) Local order consistency: messages sent by one user must be received in order

22

23

Spec Explorers Conformance Notion Alternating simulation: SUT must simulate all stimuli of model Model must simulate all responses of SUT (responses are buffered) 24 Broadcast(1,1) Broadcast(1,2) ModelSUT Broadcast(1,1) Broadcast(1,2) BroadcastAck(1,1)BroadcastAck(2,1) BroadcastAck(1,1) BroadcastAck(2,1) BroadcastAck(1,2)

Spec Explorers Approach to State Explosion Slicing techniques: Parameter selection (Constraints, Pairwise, etc.) State filtering Trace patterns Requirement coverage Slicing requires human intervention Smart slicing is an art Spec Explorer tailored for slicing design 25

Where a Trace can end: Accepting State Condition Is the following a valid word? Micr Does the following trace represents a useful test? Broadcast(1,1); Broadcast(1,1) An Accepting state condition characterizes those states in which a trace can end Used to ensure that a trace does not stop at arbitrary points Used to ensure that a test leaves the system in a good state Accepting state condition for Chat: All messages have been delivered to recipients 26

Demo: Chat Model What the demo shows OO model state Using helper methods in models Modeling with events Slicing

Demo: Server Message Block Protocol v2 What the demo shows: Modeling a key Microsoft product Using C# to model state transition systems Using trace patterns to slice test purposes from models Generating and executing tests Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Part 3: Evaluation Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Comparison MBT vs Traditional Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation In % of total effort per requirement, normalizing individual vendor performance Vendor 2 modeled 85% of all test suites, performing relatively much better than Vendor 1 9/4/

Remarks on Comparison Numbers backed up by correlation analysis conducted by empirics expert Engineers applying MBT were lay folks, most of them freshly hired from college Few power modelers achieve much higher efficiency rates Though model authoring takes only a smaller part of overall effort per requirement, modeling approach seems to determine efficiency Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Factors for Success Tool support Modeling in mainstream languages and environments Visualization of exploration and actual generated test suite (no magic as in online testing) Dealing with state explosion by scenario slicing Training and Guidance One week class for every new hire (including both general methodology and model based testing) Size of project generated critical mass for community help Reviewing process added additional guidance Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Pain Points Observed Delta Testing Support A new set of test cases generated based on a new version of model: Which old cases can be re-used? Which old cases are not valid anymore? Which new cases need to be added? By-passing assertion at test execution time Push-button technology for requirement coverage with minimum transitions Good heuristics is needed when behavior is infinite 9/4/2010 Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 33

Pain Points Observed (continued) Ambiguity in Requirement Coverage What does it mean to cover a requirement in model? Covering a transition once/multi-times? Or even path coverage or pairwise coverage? Rule Debugging Support C# provides rich programming experience But rules can get so complex that a debugger is needed to analyze whats going wrong 9/4/2010 Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 34

Conclusions Biggest application of behavioral model- based testing known so far Probe big enough for relevant empiric results, proving efficiency gain of 42% Will lead to more momentum on modeling in general inside of Microsoft Model-based testing rocks! Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

Advertisement… Microsoft offers Spec Explorer 2010 as preview technology free of charge via Visual Studio Gallery: en-us/271d0904-f178-4ce9-956b-d9bfa Licensing allows for commercial use Academic institutions can join MSDN Academic Alliance for access to Visual Studio 2010 Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Microsoft's Protocol Documentation Program: A Success Story for Model-Based Testing Copyright © 2010, Microsoft Corporation 9/4/