Topics In Demand
Notification
New

No notification found.

Blog
Scope of Testing Microservices

June 22, 2017

1126

0

testing-microservices

Microservices is not a new thought. It is used for more than a decade; now by giants such as Facebook, Amazon, and Google. Google calls out more than 70 microservices results when you search for it on Google.

Testing Microservices

A microservices architecture consists of focused small services that together create a whole application or task. Every instance of a microservices represents a single responsibility within your application. The real advantage is that these services are independent of one another, which makes them independently deployable and testable.

Scope of Testing Microservices

1.Unit Testing

The scope of unit testing is internal to the service. In terms of volume of tests, they are the largest in number. Unit tests should ideally be automated, depending on the development language and the framework within the service.

2.Contract Testing

Contract testing should treat each microservice as a black box and all the services must be called independently and their responses must be verified. Any dependencies of the service, allow the service to function but do not interact with any other services. This helps avoid any complicated behavior that may be caused by external calls and turn the focus on performing the tests on a single service.

A “contract” is a service call referred by the consumer contract testing where a specific result or output is expected for certain inputs. Every consumer must receive the same results from a service over time, even if the service changes. There should be the flexibility to add more functionality as required to the responses later. However, these additions must not break the service functionality. If the service is designed in this manner, it will stay robust over longer durations and the consumers will not be required to modify their code to take into account the changes made later on.

3.Integration Testing

Verification of the services that have been individually tested must be performed. This critical part of microservices architecture testing depends on the proper functioning of inter-service communications. Service calls must be made with integration to external services, including error and success cases. Integration testing thus validates that the system is working together seamlessly and that the dependencies between the services are present as expected.

4.End-To-End Testing

End-to-end testing verifies that the entire process flows work correctly, including all service and DB integration. Thorough testing of operations that affect multiple services ensures that the system works together as a whole and satisfies all requirements. Frameworks like JBehave (framework for behavior driven development) help automates Functional testing by taking user stories and verifying that the system behaves as expected.

5.UI/Functional Testing

User interface testing is the testing of the highest order as it tests the system as an end-user would use it. Testing of this level must feel like a user trying to interact with the system. All the databases, interfaces, internal and third-party services must work together seamlessly to produce the expected results.

Subscribe to stay updated about software testing.


That the contents of third-party articles/blogs published here on the website, and the interpretation of all information in the article/blogs such as data, maps, numbers, opinions etc. displayed in the article/blogs and views or the opinions expressed within the content are solely of the author's; and do not reflect the opinions and beliefs of NASSCOM or its affiliates in any manner. NASSCOM does not take any liability w.r.t. content in any manner and will not be liable in any manner whatsoever for any kind of liability arising out of any act, error or omission. The contents of third-party article/blogs published, are provided solely as convenience; and the presence of these articles/blogs should not, under any circumstances, be considered as an endorsement of the contents by NASSCOM in any manner; and if you chose to access these articles/blogs , you do so at your own risk.


© Copyright nasscom. All Rights Reserved.