+ All Categories
Home > Documents > SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto...

SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto...

Date post: 04-Sep-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
29
SQL Protocol Test Tools Eric Bortei-Doku
Transcript
Page 1: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

SQL Protocol Test ToolsEric Bortei-Doku

Page 2: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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

Page 3: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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]

Page 4: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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

Page 5: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Test Tools Overview: SQL Test Suites - setup

Page 6: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Test Tools Overview: SQL Test Suites - results

Page 7: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Agenda for a Closer Look

Page 8: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

OData Validator Tool(Web UI)

Page 9: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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

Page 10: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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

Page 11: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

HTTP

OData Validator – Overview (continued)

Page 12: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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/

Page 13: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Design

- OData Validator

Page 14: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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

Page 15: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

OData Validator - Architecture

Response header & payload

Request target

Page 16: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

OData Validator - Operation

Page 17: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

DEMO

Page 18: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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

Page 19: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Using OData Validator with a URI

OData target service:▪ http://services.odata.org/V4/TripPinServiceRW

Select other options as needed

Click or tap Validate

Page 20: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

{"@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

Page 21: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Model First Tool_____

Page 22: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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

Page 23: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

API Design – Traditional Method

NO

YES

(Manually created Ref docs)

Page 24: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

API Design – Model First Method

AutoGenerated

NO

YES

(Auto docs manually fine-tuned)

Page 25: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

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

Page 26: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Model First Tool - UI

Page 27: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Live Demo of Books & Blog OData Service

Link to tool: Model-First

Input language is YAML

Page 29: SQL Protocol Test Tools - Microsoft · API Design –Model First Method Auto Generated NO YES (Auto docs manually fine-tuned) Model First Tool - Features A powerful editor, visually

Thank You!Questions?


Recommended