The document discusses web services, distinguishing between REST and SOAP, with REST being faster, more efficient, and secure. It explains the concept of microservices and their benefits in a service-oriented architecture, as well as testing methodologies including unit, contract, integration, and UI functional testing. Additionally, it introduces automation tools such as Rest Assured and Karate for testing microservices and IoT applications.
What is WebServices ?
• IA web service is a function that can be accessed by other programs
over the web (Http)
• Example: I can go to maps.google.com, and type in my home
address, and see a map of where I live in my browser.
3.
REST vs SOAP
•REST allows a greater variety of data formats, whereas SOAP only
allows XML.
• REST is generally faster and uses less bandwidth.
• REST is simple to handle than SOAP.
• REST more secure as compared to SOAP as it can be integrated with
any security protocol.
• REST is very restrictive than SOAP.
• REST runs on HTTP where SOAP runs on XML
5.
How we dotesting Web Services
• Read theWDSL file obtain information such as End Point, Parameters
and Expected Response.
• Use tools such as SOAP UI, ReadyAPI, SOAP Sonar, Fiddler or POST
MAN
• Send requests with different parameters and checks for response.
• Should do positive as well as exploratory (negative) test onWeb
Services.
6.
Test Automation ofWeb Services
• Web Service testing should be automated if its viable.
• There are different tool sets to automateWeb Services test
What is aMicroservice ?
Micro Services is also a form of a Service Oriented Architecture which now talk of the town.
In a Micro Services Architecture (MCA) there are many autonomous service components,
which are called processors that communicate each other via an HTTP channel.This is also
called inter process communication.
These services are;
· Developed in different programming languages and uses different databases
· They can be easily added/replaced or removed within the architecture
· They can be easily plugged to user interfaces
· They can have different context, autonomously developed and integrated
independently
These services architecture helps continues delivery as easily each individual micro service
component can be added to the architecture without interrupting the existing functionality
and interconnections.
· Allows and achieves benefits of scalability
10.
Types of MicroservicesTesting
UnitTesting –This is to test internal working of individual
Micro Services test unit.These can be automated at each
programming level using automated unit testing framework.
ContractTesting –This is to test that each Micro Services unit
adheres to the given functionalities provided in the contract
established. Here each service component is tested
individually as a black box.
IntegrationTesting –This checks that more than one service
communicates each other and provides the desired results
given in the service functional level document.
UI FunctionalTesting –This where services are integrated with a UI
and testing is done via a UI where inputs needed by the Micro
Services are given via the UI and desired output is also tested via a
UI.
How to testIOT?
Test the Web Service the IOT device communicates. Create automation test scripts that will test the
functionality of the IOT application
Jump start Karate
•It’s an Open SourceTool
• Can be integrated to Java as a Maven Project
• Write simple BDD based scenarios
• Most less coding needed
• Anyone can start automation with Karate
20.
Jump start Karate
•Create a Maven Project in your Eclipse and add the following
dependency.
• Do a Clean and Install
21.
Jump start Karate
•Write the following feature file
• Create the following Junit test runner file