Web Services SOA Testing Made Easy

15
Software Confidence. Achieved. Sunday, March 08, 2009 1 Web Services/SOA Testing Made Easy www.cigital.com [email protected] +1.703.404.9293 Meera Subbarao Senior Software Consultant [email protected]

Transcript of Web Services SOA Testing Made Easy

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 1/15

Software Confidence. Achieved.

Sunday, March 08, 2009 1

Web Services/SOA TestingMade Easy

[email protected]+1.703.404.9293

Meera Subbarao

Senior Software [email protected]

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 2/15

© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential. 2Sunday, March 08, 2009

Web!Services!Are!Everywhere!!

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 3/15

© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

Testing!Challenges

3Sunday, March 08, 2009

! No User Interface

! Combination of SeveralComponents

! Integration Layers! Coverage

! Security

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 4/15

© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

Why!SoapUI?

4Sunday, March 08, 2009

!

WSDL Service Inspection! REST Service Inspection

! WSDL Service Invocation

!REST Service Invocation

! Web Service Development and Validation

! Web Service Functional Testing

! Web Service Load Testing! Web Service Simulation

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 5/15

© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

Functional!Web!Services!Testing! Create a Web Service Test from SOAP request

! Add Assertions to a test

! Run your web service test!

! Generating Test Suites

! Test Suite Runner 

! Test Cases

! Test Case Actions

! The TestCase Editor 

5Sunday, March 08, 2009

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 6/15

© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

SoapUI!And!Groovy

6Sunday, March 08, 2009

! Scripting your test with Groovy! The Groovy Script Editor 

! Add a Properties step

! Read back from the properties file and assignthe values to the properties step

! Script Execution

!

Groovy Script Examples! SoapUI GroovyUtils

! Parse the response from the request usingGroovy and assert

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 7/15© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

Groovy!Examples

7Sunday, March 08, 2009

today = new Date()sdf = new java.text.SimpleDateFormat("yyyy-MM-dd")todayStr = sdf.format(today)

groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

holder = groovyUtils.getXmlHolder("LatLonListZipCode - Request1#Response")listLatLonOut = holder.getNodeValue( "//listLatLonOut" )latlonNode = groovyUtils.getXmlHolder(listLatLonOut)latlon = latlonNode.getNodeValue("//latLonList")

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 8/15© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

SoapUI!and!Ant! Command line tools

! com.eviware.soapui.tools.SoapUITestCaseRunner 

! Generating JUnit Reports

! Reporting and Exporting Functional Web Service Tests

8Sunday, March 08, 2009

<property name="soapui-location" location="C:/dev/soapUI-2.5/bin"/><property name="soapui.project.file" location="Weather-soapui-project.xml"/>

<target name="soapuiTests" depends="init"><exec dir="${soapui-location}" executable="cmd.exe">

<arg line="/c testrunner.bat -f${soapui-report-dir} -j -r -a ${soapui.project.file}"/></exec>

</target>

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 9/15© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

SoapUI and JUnit

9Sunday, March 08, 2009

<junitreport todir="${soapui-report-dir}"><fileset dir="${soapui-report-dir}">

<include name="TEST-*.xml" /></fileset>

<report format="frames" todir="${soapui.html.dir}" /></junitreport>

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 10/15

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 11/15© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

Code!Coverage!Tools

11Sunday, March 08, 2009

Java• Cobertura

• Clover  

.NET

• NCover  

• Clover.NET

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 12/15© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

Using!Cobertura!With!Ant

12Sunday, March 08, 2009

! Instrument your code

! Deploy instrumented code

! Run Tests

! Generate Reports

! Generate coverage report

<target name="instrument" depends="build"><cobertura-instrument datafile="${cobertura-data-dile}" todir="{classes.dir}">

< fileset name="**/*.class" /></fileset>

</cobertura-instrument></target>

<target name="coverage-report“<cobertura-report datafile="${cobertura-data-file}" srcdir="${src.dir}destdir="${coverage.xml.dir}" format="xml" /><cobertura-report datafile="${cobertura-data-file}" srcdir="${src.dir}"destdir="${coverage.html.dir}" />

</target>

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 13/15© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

Continuous!Integration

13Sunday, March 08, 2009

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 14/15© 2006 Cigital Inc. All Rights Reserved. Proprietary and Confidential.

Integration!With!Hudson

14Sunday, March 08, 2009

! Configure Hudson Job

! Force a Build

! Publish the CoverageReport

!

Publish the SoapUI JUnitReports

8/14/2019 Web Services SOA Testing Made Easy

http://slidepdf.com/reader/full/web-services-soa-testing-made-easy 15/15© 2006 Cigital Inc All Rights Reser ed Proprietar and Confidential

Having!Trouble?

Sunday March 08 2009

[email protected]