SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto...
Transcript of SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto...
SQL Protocol Test ToolsEric Bortei-Doku
Agenda
Test tool options – overview (SQL Sever and Data platform protocols) SQL server parsers
Test suites
OData Validator
Model First
A closer look at two of the tools (OData Validator, Model First)
Resources
Q & A
Test Tools Overview: SQL Server Parsers
Two main categories of tests:▪ Unit tests – for testing messages indicated in protocol spec
▪ Scenario tests – for verifying full functionality (messages, structure parsing, operation, summary line info)
▪ Used with Message Analyzer for examining protocol traffic
▪ Goal is 100% test coverage (combination of unit & scenario testing)
▪ Download: https://connect.microsoft.com/site216/Downloads
[Current listing being refreshed to match updates in protocols]
Test Tools Overview: SQL Test Suites
Developed for testing partner implementations of protocols that are based on Microsoft open specifications.
Normative statements (MAY, MUST SHOULD) used for requirements
Suitable requirements are grouped, turned into test cases
Related test cases are grouped into scenarios
Collections of scenarios + adapters turned into Test Suites
Test Tools Overview: SQL Test Suites - setup
Test Tools Overview: SQL Test Suites - results
Agenda for a Closer Look
OData Validator Tool(Web UI)
First: OData - Overview
OData (Open Data Protocol) defines a set of best practices for building and consuming RESTful APIs.
Has become an industry standard. ISO/IEC approved
OASIS standard
OData Validator - Overview
Architecture involves an OData client and an OData server
This tool used for validating OData server responses
OData protocol spec provides info about how to interpret/validate the server responses
Point OData validator at endpoint to validate payloads: Service document
Metadata document
Feed, entity and error
HTTP
OData Validator – Overview (continued)
Why use the OData Validator?
A key part of the ecosystem surrounding the OData protocol
Multiple targets: service doc, metadata doc, feed, entry and error responses
Multiple OData protocol versions supported
Additional selections provided as optional validation configurations
Open source project: http://odatavalidator.codeplex.com/
Design
- OData Validator
Rules come from
▪ MS-ODATA:
• http://msdn.microsoft.com/en-us/library/dd541188.aspx
▪ OASIS specs:
• http://www.odata.org/documentation/odata-version-4-0/
The goal is to test all the normative parts of the specs
▪ MAY, MUST SHOULD statements in specs
Validation Rules Design
OData Validator - Architecture
Response header & payload
Request target
OData Validator - Operation
DEMO
OData Validator – Usage options
Validator connects to OData service via:
URI
Direct input (JSON, or Atom format)
Validator can test OData service for:
Conformance
Metadata
Service implementation
Using OData Validator with a URI
OData target service:▪ http://services.odata.org/V4/TripPinServiceRW
Select other options as needed
Click or tap Validate
{"@odata.context": "http://services.odata.org/V4/OData/OData.svc/$metadata#Products/$entity","@odata.type": "#ODataDemo.Product","@odata.id": "http://services.odata.org/V4/OData/OData.svc/Products(1)","@odata.editLink": "Products(1)","ID": 1,"Name": "Milk","Description": "Low fat milk","[email protected]": "#DateTimeOffset","ReleaseDate": "1995-10-01T00:00:00Z","DiscontinuedDate": null,"[email protected]": "#Int16","Rating": 3,"Price": 3.5,"[email protected]": "Products(1)/Categories/$ref","[email protected]": "Products(1)/Categories","[email protected]": "Products(1)/Supplier/$ref","[email protected]": "Products(1)/Supplier","[email protected]": "Products(1)/ProductDetail/$ref","[email protected]": "Products(1)/ProductDetail”
}
Use OData Validator with Direct Input
Model First Tool_____
Model First Tool - Overview
Allows you to model an API, before implementation with code
Makes it possible to test as you design your API
Generates documentation & tests automatically
API Design – Traditional Method
NO
YES
(Manually created Ref docs)
API Design – Model First Method
AutoGenerated
NO
YES
(Auto docs manually fine-tuned)
Model First Tool - Features
A powerful editor, visually renders API model code in interactive window
Incorporates Swagger UI and interactive features
YAML as input for modeling API
Swagger or Mark Down as outputs
Model First Tool - UI
Live Demo of Books & Blog OData Service
Link to tool: Model-First
Input language is YAML
Resources
OData Validator – Web UI▪ OData sample service
▪ OASIS Spec
OData Validator – GitHub
ISO/IEC approved
OASIS standard
Model First – GitHub▪ Model-First – (Live tool)
Thank You!Questions?