《SOA Testing.ppt》由会员分享,可在线阅读,更多相关《SOA Testing.ppt(47页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、SOA TestingAhamad Patan8th Sept Agenda SOA Overview SOA Testing An End to End ApproachTesting Web Service APIsAPI Testing StrategiesExerciseTesting Web Service Applications SOA Testing Challenges SOA Test Automation Approach QA SessionSOA OverviewWhat is SOA?Service-Oriented Architecture (SOA) is an
2、 architectural style. Applications built using an SOA style deliver functionality as services that can be used or reused when building applications.SOA ContinuedSOA in other terms A service-oriented architecture is essentially a collection of services Services are based on heterogeneous technologies
3、.Application functions are modularized and presented as services.A service is an implementation of a well-defined business functionality.Service interface is independent of the implementation.SOA ContinuedServices are platform independent, self describing interfaces (XML)Messages are formally define
4、d Services can be provided on any platformSOA and WebservicesnSOA is not Webservices, but web services are the preferred standards-based way to realize SOA .nWeb services are software systems designed to support interoperable machine-to-machine interaction over a network. This interoperability is ga
5、ined through a set of XML-based open standards, such as WSDL, SOAP, and UDDI. These standards provide a common approach for defining, publishing, and using web services. SOA and Webservices continuednInteroperability is the most important principle of SOA. This can be realized through the use of web
6、 services, as one of the key benefits of web services is interoperability, which allows different distributed web services to run on a variety of software platforms and hardware architectures.Webservices basicsWSDL Web Service(J2EE, PL/SQL,.NET,C/C+,Legacy )Web ServiceClient(J2EE, .NET,PL/SQL )Point
7、s to descriptionDescribesServiceFindsServiceSOAPPoints to serviceUDDI RegistrySOA TestingnTesting Web Service APIsnTesting Web Service ApplicationsTesting Web Service APIsFollowing types of testing needs to be performedFunctionalityPerformanceRe-usabilitySecurityInteroperabilityComplianceBackward co
8、mpatibilityTesting web service APIsFunctional TestingAPI TestingDetect errors at an early stage, right from the requirements level.Ensure that real-world test data is usedAutomate test case execution to improve productivityTesting web service APIsPerformance TestingnWeb Services have high usage and
9、high reuse opportunities. Example: A service has been identified as serving 10000 concurrent users with 5 sec of response time. Typically, services are server side components that do not have a front end. It is therefore useful to have a sample GUI interface that can be used to load test the service
10、 from a web client.Testing web service APIsReusability TestingThe more a service gets reused, the greater the impact associated with its downtime will be.Make sure that the APIs would work in all possible business scenarios, thus ensuring consumability Testing web service APIsSecurity TestingWeb Ser
11、vices are exposed to the outside world, this fact opens up a host of vulnerabilities, such as DOS (denial-of-service) attacks, penetration, high volumes of spam data, etc. Typical security policies have to be enforced at the network level to create bullet proof SOA. Specific test cases aimed at targ
12、eting these policies need to be designed to fully test SOA security.Testing web service APIsSecurity TestingA denial-of-service attack (DoS attack) is an attempt to make a computer resource unavailable to its intended users.Prevent an Internet site or service from functioning efficiently, temporaril
13、y or indefinitely. Consumption of computational resources, such as bandwidth, disk space, or processor timeCrash the operating system itself. Testing web service APIsSecurity TestingTesting - Simulate denial-of-service attacksPopular denial-of-service mitigation products from Arbor NetworksTesting w
14、eb service APIsInteroperability TestingThe ability of two or more systems or components to exchange information and to use the information that has been exchanged.Involves different technology platforms and development tools. Developers use many different tools to generate the contracts (WSDL) and m
15、odify them in the process. Testing web service APIsInteroperability TestingTesting should be tested on different technology platforms. Testing web service APIsCompliance TestingTesting to determine whether we meet some specified standardsValidating WSDL definitions Validating SOAP request/response m
16、essagesTesting web service APIsBackward Compatibility TestingAs businesses evolve, changes may required in the Web Services, but some consumers may want to continue the old services. The challenge is to make sure that old service consumers are still supported. SOA Testing ChallengesSOA Testing Chall
17、engesMajor Challenges: No user interface for the Web Services Difficult to create Real time applications Test Data should be close to the end user environment Infinite consumers possible SOA Testing Challenges Test Automation Client Simulators (Message simulation) Service Simulators Automatic test d
18、ata creation Choosing the right test automation tool Maintaining pool of testing resources with SOA domain knowledgeSOA Test Automation ApproachTraditional Testing Tools GUI Testing ApproachIn House Test Tools Web Service Testing ToolsSOA Test Automation ApproachTraditional Testing Tools Web Service
19、s SOAP requests needs to be generated manually or using a supported third party vendor testing tool Integrating traditional functionality testing tool and other such third party tool is not feasible due to its nature and limitations A mix of manual and automated process is an additional overhead Its
20、 a time consuming and expensive effortSOA Test Automation ApproachGUI Testing Approach Web Service is UI less application. GUI application should be developed Web service interface changes demands often GUI changes Web Services security testing that requires encrypted & singed data is not possible O
21、verall cost involved is very high for testing,development & maintenance effortsSOA Test Automation ApproachIn House Test Tools Focus is drawn towards developing & maintaining the test tools than the actual testing In-house test tool itself need to undergo testing to ensure it is coded to the specifi
22、cations Dependency on in-house tools will impact test schedules & quality of the deliverable in demanding situations Time Consuming and expensive approach SOA Test Automation ApproachWeb Services Testing Tools Provides robust, reliable, scalable and interoperable solution Best fit for UI less testin
23、g Provides a solution for load testing Test data generation for any WSDL version is possible and easily maintainable. Depending on existing legacy systems & back-end applications, web services test tools can be tweaked by developing / modifying test scripts to provide an E2E solution for backward co
24、mpatibility Unlike any other traditional testing tool, the cost involved is very minimal.ExamplenA Web Service maps user input IP addresses to countriesnString findCountry(String ip)ExampleTest PlanDescriptionInput ValueExpected ResultValid ip address10.177.223.253IndiaValid Ipv6 address3ffe:1900:45
25、45:3:200:f8ff:fe21:67cfUSInvalid address12.54.12.32.77.88Error, Not a valid inputExample Strategy 1Suppose this API belongs to the class IPHelper.IPHelper iph = new IPHelper();String result1 = Iph.findCountry(“10.177.223.253”);If (result1.equals(“India”)System.out.println(“Test1 Passed”);ElseSystem.
26、out.println(“Test1 Failed”);Example Strategy 2Store the data in a xml file10.177.223.253India3ffe:1900:4545:3:200:f8ff:fe21:67cf US12.54.12.32.77.88Invalid InputExample Strategy 2Read the xml file as test data input.Parse the xml file into an Object(xmlObject)IPHelper iph = new IPHelper();For (int I
27、 =0; IxmlObject.length; I+)String result1 = Iph.findCountry(xmlObject.input);If (result1.equals(xmlObject.expectedresult)System.out.println(“Test” + I + “Passed”);ElseSystem.out.println(“Test” + I + “Failed”);ExercisenWeb Service APInGives the current temparature of the city in required unitsnFloat
28、getTemparature(String City, Char Unit)nUnit can be F(Farenheit) or C(Celsius)nWrite a test plan Better come up with unique test cases.Description input1input2Expected ResultExercisenSome Unique Test CasesnCase Sensitivity bangalore, f, c, F, CExercisenSome Unique Test CasesnMultiple names for a same
29、 city Mumbai, BombayExercisenSome Unique Test CasesnCity name contains space New DelhiExercisenSome Unique Test CasesnSame city name in many countries Hyderabad(Ind), Hyderabad(Pakistan)ExercisenSome Unique Test CasesnCity Name contains Single Quote Gizzards CoveExercisenSome Unique Test CasesnCity
30、Name contains Same string repeated Zu ZuExercisenSome Unique Test CasesnThe City is in North/South Pole should return negative value for the expected resultExercisenSome Unique Test CasesnCity Name is very Long string - Guangzhou in southern China, Name of the city LLANFAIRWLLGWYNGLLGOGERYYCHWYRNDRO
31、BWILLLLANTYSILIOGOGOGOCHnIn New Zealand, Name of the city - TaumatawhakatangihangakouuauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahuTesting web service Applications nFunctional Testing nServices specifically designed to function as independent entities may work perfectly well in isolati
32、on, but might not function as expected when integrated into applications due to underlying platform and network specific issues.nConsider a sequence of web service calls made to various web services This should not affect the functionality. nSince SOA involves a lot of asynchronous communication acr
33、oss systems, it is possible that messages will not reach their destinations in an orderly fashion because of delays in processing at the service provider. Some systems will respond quickly, and some slowly, depending on the load at any given point in time. Testing web service Applications nIntegrati
34、on Testing nTesting the composite application that is built using sub-systems or modules that are independent of the rest of the system. Testing web service Applications nPerformance nWhen a composite application is being tested for load, stress, it is important to observe the throughput of the web service to see if a bottleneck occurs.Questions or Comments?nQuestions or Comments?nThanks