Professional Documents
Culture Documents
Overview
Background
Microsoft Protocol QA Process
Scope and approach
Requirements engineering
Model-based testing
Non-Microsoft Applications
Q&A
BACKGROUND
What is a Protocol?
Rules for interaction between
(among) endpoints using
messages
Data
Content and format
Behavior
Request/Response
Acceptable sequences
BING
XMP
SOAP
Stack of layers
L L-1 ok
XML
L L m NOT ok
HTTP
TCP
IP
format (XML)
UDP
802.11
802.2
Protocols Everywhere
Cellular: CDMA, GSM, SMS, MMS, WAP
Network: 802.11 (WiFi), 802.16 (WiMax)
Protocol Buffers,
10
Publish or Perish
US Federal Court and EU order
Consent Decree
Microsoft to publish server side API
documentation
Goal: interoperability for third
parties
Hard milestones/deadlines imposed
by Federal Judge
Microsoft Open Specification
Initiative
11
Cast of Thousands
MSFT project management
100s of senior MSFT developers
wrote/revised TDs
TD publication staff
More than 350 test suite devs
developers
MSFT Plugfest team
Technical Committee chartered
12
500+ protocols
Remote Desktop
Active Directory
File System
Security
Many others
13
14
15
Challenges
Validation of documentation, not as-built implementation
Is each TD well-formed?
Follows TD standards
Consistency, correctness, completeness
Is each TD all a third party needs to develop:
A client that interoperates with an existing service?
A service that interoperates with existing clients?
Only use over-the-wire messages
16
Analysis
Data and
behavior
statements
Approximates third party implementation
Validates consistency with actual Windows
implementation
WS 2008
WS 2003
WS 2000
Requirements
Specification
Modeling
Model-based
Test Suite
Test Execution
Stobie et al, 2010 Microsoft. Adapted with permission.
17
TD v2
TD vn
Authors
Study
Scrutinize
TD
Define Test
Strategy
Test
Suite
Developers
Review
TD ready?
Strategy?
Reviewers
Plan
Complete
Test Rqmts
High Level
Test Plan
Design
Final
Complete
Model
Complete
Adapters
Review
Review
Review
Test Rqmts?
Config ?
Plan ?
Model?
Adapters?
Coverage?
Test Code?
18
Results
Published 500+ TDs
60,000+ pages
TEST REQUIREMENTS
ENGINEERING
20
TD Statements
Data Statement
2.2.1.2.3 DHCP_OPTION_ID
Behavior Statement
3.1.4.16 R_DhcpRemoveOptionValue
Endnote
<24> Windows XP and Windows Server 2003 DHCP clients request only option code
249 in the Parameter Request List.
21
Doc Sect
Description
Inform
Pos Neg Derived /Norm Verification
TSCH
_R142
2.4.1
The client MUST set the File Version (2bytes, it contains the Version of the .JOB file format)
field of the FIXDLEN_DATA structure to 0x0001.
R110 R113
2
1
TSCH
_R145
2.4.1
The server MUST ignore the value in the App Name Len Offset field of the FIXDLEN_DATA
structure.
2.4.1
The Trigger Offset (2 bytes) field of the FIXDLEN_DATA structure MUST contain the offset in
bytes within the .JOB file where the task triggers are located.
TSCH
_R1332
3.2.5.4.6
Upon receipt of the SchRpcGetSecurity call, the server MUST return S_OK on success.
Norm
Test Case
TSCH
_R1333
3.2.5.4.7
Norm
Adapter
TSCH
_R146
TSCH 3.2.5.4.7
_R1350
Norm
Norm
R110 R113
2
1
Non-testable
Norm
Document Debugging
Bug
Template, MUST-SHOULD-MAY
Ambiguous, unclear, inconsistent
Missing or incorrect
SUT response inconsistent
Fix
Implicit antecedent
Cause or effect too broad
No effect for corrupt/missing
Add antecedent []
Add derived, narrow domain
Add derived, negative effect
cause
Unobservable or uncontrollable
Infeasible
negative effect
Add derived, observable effect
Add derived, narrowed scope
23
Document Debugging
Every TD statement analyzed
Scrutinize
Categorize
Make context explicit
Trace dependencies
Assess testability
Allocate
24
Scrutinize
Ambiguous phrasing
Misuse of MUST, SHOULD, MAY
Inconsistent
Unclear
TD template violations
Write bug report for author correction
25
Categorize
Normative or Informative?
Like code comments (informative)?
26
Test
Requirement 1
Test
Requirement 2
Otherwise [if the computeByClause is not present], all rows of the child
RecordSet are treated as a single group [in the computeByClause.]
27
Trace Dependencies
Is there a stated observable effect:
For every cause?
When a cause is missing or corrupted?
Record analysis with linked requirements
Req ID
Description
R100
R110
Pos
R110
Neg
???
Derived
Verification
Test Case
Test Case
Stobie et al, 2010 Microsoft. Adapted with
permission.
28
Assess Testability
A test requirement is testable if:
Sufficient to generate and/or evaluate in code
Observable over-the-wire
Non-testable if:
Unobservable
Uncontrollable
Infeasible
Excessive cost to develop test
29
Assess Testability
Unobservable or uncontrollable
All the structures MUST begin on 8-byte boundaries, although the
data that is contained within the structure need not be aligned to 8byte boundaries.
Cant detect mis-alignment at test endpoint
Infeasible
The server MUST return a unique ID.
No way to conclusively determine uniqueness
30
Assess Testability
What to do about non-
testable statements?
Punt?
Interpretation unpredictable
(testers and users)
Lowers coverage
Skip?
Taints credibility
lowers coverage
Rewrite non-testable
Strictly limited revision or
elaboration
Significant requirements
engineering innovation
31
Description
R42
R1042
R39
R1039
Derived
42:c
Verification
Comments
Non-testable
Infeasible
Test Case
Non-testable
39:p
Test Case
Server internal
behavior
32
Description
Pos
Neg
R110
R1100
Derived
Verification
R100
R110
Test Case
R113
Test Case
R114
Test Case
R1100
Test Case
R100,
R113:i,
R114:i
Test Case
33
To Adapter
Basic data structure and format checked as side-effect
Netmon parsing
Transport layer marshaling
MODEL-BASED TESTING
35
Model-Based Testing
Develop
Test Requirements
Missing, incorrect
Ambiguous, missing,
contradictory, incorrect,
obscured, incomplete
Run
Test Model
Model error, omission
Generate
Test Suite
Inputs
(Test Sequences)
Evaluate
Control
Observe
SUT
Bug
Coverage
Requirements
Model
Code
36
37
Spec Explorer
Model-based testing tool
Developed at Microsoft Research
Productized after extensive use
Visual Studio Power Tool
Development UI
38
39
40
Model Exploration
Scenarios and slices
Any subset of all [Rule]
methods
Uses reg-exp like syntax
Represent use cases
Data-driven slice
Manages state explosion
problem
Explore
Constraint solver finds
feasible paths using
initial data values and
symbolic execution
Supports iterative model
development
41
Expect a response
from the SUT
Updated model
state
SE reached an
Accepting State
42
43
Endpoint
Under Test
Transport
Transport
Server OS
44
Netmon Capture
45
Complete Traceability
Technical Document
Requirements Spec
Model
Test Suite
Logs
Network Captures
46
Productivity
Total effort: 250 person years (mostly junior SDETs)
Saved 50 person years with model-based testing
Model-based Testing
1.4 Days/Requirement
Traditional Testing
2.4 Days/Requirement
Requirements
Study
Modeling
Test
Coding
Adapter
Coding
Test
Execution
47
golden
MBT productivity and effectiveness even greater for deeper testing of new
services
Be practical: use hand-coded test logic when convoluted behavior defies
modeling
48
Bottom-up evolution
Transparent community participation
49
Q &A
rvbinder@tezzter.com
50
http://www.microsoft.com/openspecifications
Technical Documents
http://msdn.microsoft.com/library/jj712081
Project Overview
http://queue.acm.org/detail.cfm?id=1996412
Spec Explorer
About http://msdn.microsoft.com/en-us/library/ee620411.aspx
Download http://visualstudiogallery.msdn.microsoft.com/enus/271d0904-f178-4ce9-956b-d9bfa4902745
Netmon and protocol parsers
http://blogs.technet.com/b/netmon/
Protocol Test Suites (must provide Live Id to login)
http://msdn.microsoft.com/en-us/openspecifications/cc816059.aspx
Credits
Protocol map, Copyright 2001, Agilent
Technologies.