简体   繁体   English

SOA测试

[英]SOA Testing

SOA测试与传统的应用程序测试有何不同

As each "service-provider" should have a standard, business-oriented interface (usually provided with WSDL technology), then the following properties might be different: 由于每个“服务提供者”应该具有标准的,面向业务的接口(通常提供WSDL技术),因此以下属性可能不同:

  • The services being provided shouldn't change from revision to revision of the modules, unless you are making extensive changes to the business itself. 除非您对业务本身进行大量更改,否则所提供的服务不应从模块的修订更改为修订。

  • A module shouldn't care who it's clients are, which makes module-testing easier. 模块不应该关心它的客户是谁,这使得模块测试更容易。

  • Ideally, the services being consumed are provided by a directory, and not hard-coded into the modules; 理想情况下,所使用的服务由目录提供,而不是硬编码到模块中; if this holds, then testing parts of the system -- some modules but not all -- becomes much easier as well. 如果这有,那么测试系统的一些部分 - 一些模块,但不是全部 - 也变得更容易。

Edit: 编辑:

  • And, as others have pointed out, you need to test conformance to the specification, and not if the present components of the system work with each other. 而且,正如其他人所指出的那样,您需要测试与规范的一致性,而不是系统的当前组件是否相互协作。 For example, a web page might be displayed ok by Internet Explorer, but still not conform to the specification, and thus be unusable with other browsers. 例如,Internet Explorer可能会显示网页,但仍不符合规范,因此无法与其他浏览器一起使用。 When you go SOA, you expect to be able to replace providers of a service seemlessly. 当您使用SOA时,您希望能够无缝地替换服务的提供者。

Typically SOA service tests are black box , where you use only consider the published WSDL contract, however, sometimes it is necessary to make direct validation in databases, especially when there is no capability (operation) that can be used to make the validation. 通常,SOA服务测试是黑盒子 ,您只使用已发布的WSDL协定,但有时需要在数据库中进行直接验证,尤其是在没有可用于进行验证的功能(操作)时。

Also as a modern SOA platforms typically share resources with other service implemetation, it is important to simulate a processing load greater than or equal to the volume of production and evaluate the impact of memory, processing and I/O consumption, avoiding negative impact on services already deployed. 此外,由于现代SOA平台通常与其他服务实现共享资源,因此模拟大于或等于生产量的处理负载并评估内存,处理和I / O消耗的影响,避免对服务的负面影响非常重要。已部署。

The most complex concern is related to contract and implementation evolution, on how to implement new functionality without breaking the existing clients, this can be specially cumbersome because there are syntax and semantic issues, for instance: 最复杂的问题与合同和实现的演变有关,关于如何在不破坏现有客户端的情况下实现新功能,这可能特别麻烦,因为存在语法和语义问题,例如:

  • incompatible syntax: the new contract version can have new element, but cannot have new required elements , because this will break older clients, this kind of problem is usually avoided by running automated tests implemented with both current and new contracts . 不兼容的语法: 新的合同版本可以有新元素,但不能有新的必需元素 ,因为这会破坏旧客户端,通常通过运行使用当前和新合同实现的自动化测试来避免这种问题。
  • validation abstraction: oftentimes, canonical model (xml schemas), are shared with several services in order to avoid type conversion and provide a common business language, they usually do not have all the validation required by all service operations. 验证抽象:通常, 规范模型 (xml模式)与多个服务共享以避免类型转换并提供通用业务语言,它们通常不具备所有服务操作所需的所有验证。 Then, the necessary validation logic is done directly in the service implementation . 然后, 直接在服务实现中完成必要的验证逻辑 If the new version of the service implements a new set of validations that are not in the published contract, the clients must be notified and the scenarios should be tested. 如果新版本的服务实现了一组不在已发布合同中的新验证,则必须通知客户端并测试方案。

The tools I commonly use are: SOAP UI and JMeter , and create custom automated tests using a in house developed framework. 我经常使用的工具是: SOAP UIJMeter ,并使用内部开发的框架创建自定义自动化测试。

The think you must remember is that within an environment where there are a lot of dependencies, you must have all that dependencies mapped and all paths must be tested. 您必须记住的是,在存在大量依赖关系的环境中,必须映射所有依赖关系并且必须测试所有路径。

Having services, they must be used with a lot of clients, so every client should follow the test cases. 拥有服务,它们必须与许多客户一起使用,因此每个客户都应该遵循测试用例。

With services, you also need to pay attention to network issues. 有了服务,您还需要关注网络问题。 Make the traditional tests putting a lot of traffic in the network and switch off to see how it works. 使传统测试在网络中投入大量流量并关闭以查看其工作原理。

Besides that, having services do not require other kind of different approach. 除此之外,拥有服务不需要其他类型的方法。 Just control all the inputs and outputs. 只需控制所有输入和输出。

Few (valuable?) advices: 几个(有价值的?)建议:

The definition of services should lead to the use of Mock framework, to validate your services consumers without relying on the implementation of the providers. 服务的定义应该导致使用Mock框架来验证您的服务消费者,而不依赖于提供者的实现。

Check the robustness of your consumers: what happens when messages are lost, when a service provider is unavailable. 检查消费者的稳健性:当消息丢失,服务提供商不可用时会发生什么。

Soa testing just ensures that all independent services behave in the expected manner, all the while adhering to the input and output contract established by these services. Soa测试只是确保所有独立服务都以预期的方式运行,同时遵守这些服务建立的输入和输出合同。 I found an interesting SOA testing tool and it is FREE SOArite . 我发现了一个有趣的SOA测试工具,它是免费的SOArite

SOA testing can be defined as an extension of traditional testing. SOA测试可以定义为传统测试的扩展。

Similar to that of traditional application where we first do unit testing of components and then component level functionality testing followed by a module level then followed by end to end application testing we have service (which sometimes is a set of components put together to achieve certain task) level unit testing, followed by functional testing, and then a process (composite service or a business process) level testing, end to end integration testing etc. 类似于传统应用程序,我们首先对组件进行单元测试,然后进行组件级功能测试,然后进行模块级别,然后进行端到端应用程序测试,我们提供服务(有时是一组组件,用于完成某些任务) )级别单元测试,然后是功能测试,然后是流程(组合服务或业务流程)级别测试,端到端集成测试等。

As process dwell across different types of services some of which may be wrappers, some services also can have communication constrains load constrains, service level agreements all these complicate the process of testing and these should be considered which coming up with a test strategy. 由于流程停留在不同类型的服务中,其中一些服务可能是包装器,一些服务也可能具有通信约束负载约束,服务级别协议所有这些都使测试过程复杂化,并且应该考虑提出测试策略。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM