• No results found

WSDL-DSL + WSToolKit

N/A
N/A
Protected

Academic year: 2021

Share "WSDL-DSL + WSToolKit"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

WSDL-DSL + WSToolKit

full automatization of Web Services testing

Laura M. Castro

University of A Coruña

Jun 10, 2015 EUC (tutorial)

(2)

What is a ‘web service’?

■ Nowadays, anything and everything claims to be a WS ■ Conservative characterization:

ä Integration mechanism with third-party components/systems ä Interaction over the internet (HTTP)

(3)

How are WS used/tested?

■ You are given an API description in a computable format, plus a with clear definition of its semantics, and both are stable and work as indicated

ä From the API description you can (automatically) generate

your integration stubs, then implement the logic according to said semantics

ä We want at least the same for testing!

(4)

How are WS used/tested?

■ You are given an API description in a computable format, plus a with clear definition of its semantics, and both are stable and work as indicated

ä From the API description you can (automatically) generate

your integration stubs, then implement the logic according to said semantics

ä We want at least the same for testing!

(5)

How are WS used/tested?

■ You are given an API description in a computable format, plus a with clear definition of its semantics, and both are stable and work as indicated

ä From the API description you can (automatically) generate

your integration stubs, then implement the logic according to said semantics

ä We want at least the same for testing!

(6)
(7)
(8)

VoDKATV: the past

■ API description and semantics in PDF format ■ New PDF version when changes occurred

■ Lots of effort put into reviewing document, applying changes, designing & writing unit tests

(9)

WSToolkit

Offers: avoid all the boilerplate code

Push-button technology for property-based testing a WS ä Saves a lot of effort

ä Improves using QC over unit tests

Requires: an API description in a computable format (WSDL)

■ Available at:

(10)

WSToolkit

Offers: avoid all the boilerplate code

Push-button technology for property-based testing a WS ä Saves a lot of effort

ä Improves using QC over unit tests

Requires: an API description in a computable format (WSDL [+XSD])

■ Available at:

(11)

WSToolkit: VoDKATV demo

1. Use XSD file to obtain HRL withdata definitions

2. Use WSDL, XSD and HRL files to obtainwrapper for WS 3. Use WSDL, XSD to obtain QC generators

4. Use WSDL, XSD, Erlang wrapper, and QC generators to obtainQC test model

(12)

WSToolkit: VoDKATV demo

(1)

write_hrl:write_hrl_file("vodkatv.xsd", "vodkatv.hrl").

(13)

WSToolkit: VoDKATV demo

(1)

write_hrl:write_hrl_file("vodkatv.xsd", "vodkatv.hrl").

(14)

WSToolkit: VoDKATV demo

(2)

write_sut_api:write_sut_api("vodkatv.hrl", "vodkatv.wsdl", "vodkatv.xsd", "http://10.20.19.102:8082/vodkatv", "vodkatv_sut.erl").

(15)

WSToolkit: VoDKATV demo

(2)

write_sut_api:write_sut_api("vodkatv.hrl", "vodkatv.wsdl", "vodkatv.xsd", "http://10.20.19.102:8082/vodkatv", "vodkatv_sut.erl").

(16)

WSToolkit: VoDKATV demo

(3)

write_data_gen:write_data_generators_to_file( "vodkatv.xsd", "vodkatv.wsdl", "vodkatv.erl").

(17)

WSToolkit: VoDKATV demo

(3)

write_data_gen:write_data_generators_to_file( "vodkatv.xsd", "vodkatv.wsdl", "vodkatv.erl").

(18)

WSToolkit: VoDKATV demo

(4)

write_eqc_statem:write_eqc_statem( "vodkatv.wsdl", "vodkatv.xsd", "vodkatv.hrl", "vodkatv_sut", tuple | non_tuple, "vodkatv_eqc.erl").

(19)

WSToolkit: VoDKATV demo

(4)

write_eqc_statem:write_eqc_statem( "vodkatv.wsdl", "vodkatv.xsd", "vodkatv.hrl", "vodkatv_sut", tuple | non_tuple, "vodkatv_eqc.erl").

(20)

Beyond WSToolkit

■ You still need todo something: semantics ä If you have them in OCL, you can close the circle

(ask us if you’re interested!)

(21)

Beyond WSToolkit

■ You still need todo something: semantics ä If you have them in OCL, you can close the circle

(ask us if you’re interested!)

(22)

Improving data generation

■ WS data can include a number ofconstraints: ä optional information

ä number of ocurrences ä patterns for content ä etc.

■ We want to take into account these contraints before generating the data, not afterwards

(23)

Improving data generation

int_list_gt(N) -> list(int_gt(N)). int_gt(N) -> ?SUCHTHAT(M, int(), M>N). > eqc_gen:sample(sample:int_list_gt(100)). ** exception exit: "SUCHTHAT failed to find

(24)

WSDL-DSL

■ We created a DSL with a WSDL-flavour to improve data generation for testing web services

■ It is a stand-alone add-on to the WSToolkit

ä you can use it even if you only need data generation

(i.e. if you write your own properties, or unit tests)

■ Available at:

(25)

WSDL-DSL: VoDKATV demo

vodkatv.xsd

<xsd:element name="rooms"> <xsd:complexType>

<xsd:sequence>

<xsd:element name="roomId" type="xsd:string" />

<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1" /> </xsd:sequence>

</xsd:complexType> </xsd:element>

WSDL-DSL

wsdlType(tag("rooms",

xlist(tag("room", [ tag("roomId", string()), minOccurs(0,maxOccurs(1,tag("description", string())))])))).

(26)

WSDL-DSL: VoDKATV demo

WSDL-DSL pretty printing <rooms> <room> <roomId>82s</roomId> <description></description> </room> <room>

<roomId>x 26K6pEL </roomId> <description>G </description> </room> <room> <roomId> 2</roomId> <description></description> </room> <room> <roomId>fxQel(d3n</roomId> </room> </rooms>

(27)

Conclusions

■ If you have a web service and you have a WSDL, take advantageof WSToolkit + WSDL-DSL

■ If you have a web service and you don’t have a WSDL, ask for it, now you know howusefulit can be

■ If you have a web service, and a WSDL thatchanges WSToolkit can also help with that (ask us!)

(28)

Conclusions

■ Use them, report your issues, contribute! ■ andthanksfor listening!! :-)

References

Related documents

Such a collegiate cul- ture, like honors cultures everywhere, is best achieved by open and trusting relationships of the students with each other and the instructor, discussions

DBO Contractor: Civil Engineer, Plant Safety Engineer X X X DBO Contractor, Water Authority Incorporation of design features into project plans to be verified

After calling the credit bureaus to report the identity crime, follow-up by writing a letter to each one and send it certified mail, return receipt requested along with a copy of

In order to optimize his entry, he went to the five minute bar chart looking for an entry formation that might get him short ahead of the actual breakout of the fifteen minute

Blood tests: Please tell your doctor about your treatment with Privigen ® prior to any blood

Transport-level security is normally used in conjunction with X.509 credentials for authentication, but can also be used without such credentials to provide message protection

client file access protocol file reads/ writes meta−data reads/writes applications file I/O block I/O disk Network client protocol applications file I/O block.. I/O Block

Carotid body tumors present as a palpable mass in anterolateral aspect of the neck causing splaying of the external carotid artery (ECA) and internal carotid artery (ICA).. CBTs