Service Virtualization and Testing Microservices

Service Virtualization and Testing Microservices

During the last decade of Testing and Quality Assurance , We have often seen or heard the term shift-left. But what is shift-left and I did a bit of studying and interviewing couple of Senior Quality Engineers , broadly they were classified in these three main areas:

  1. Test Pyramid - Often mentioned as test more at unit level , As in a well-architecture model we indeed have more and more logic written at the code- level. Hence the test are written with the code and of course , it is highly maintainable and quicker to execute.
  2. Advent of Cloud - As most of the backend api's are being pushed to cloud these days, the test needs to be run faster, quicker and in a faster feedback mechanism.
  3. UI should be Dumb: Yes, It is true, Most of the engineers indeed said that UI components are tested separately and the validation logic is tested in a separate environment.

In this article we would concentrate on the API - Microservices layer of shifting left strategy using microservices and service virtualization.

No alt text provided for this image

In the above example , In a complex microservice architecture, we have the need to validate the microservices independent of each other. so , we have may need to mock the down stream services and validate them in CI/CD Environment, Below are the steps which could be followed

  1. Create a docker with a mock express server , This server would route the request as per the request made in the compiled code. This would help the QE to run the integration test in local , without the dependency of the actual microservice -(Downstream Services)
  2. Deploy the code to a CI environment, The backend mocks could be deployed on Lambda and the API- Gateway could be used to route the request to a specific mock lambda , dependent services. The QE can test the similar test in a Cloud (AWS in this case) environment.
  3. Publish the code to INT environment, Here the actual services could be tested with the actual downstream , but a health check of the services should suffice as the regression of the services are already performed in the CI environment.

This concept of service virtualization could be used to validate the services in CI/CD environment achieving the objectives of regression and shifting-left.

Please do reach out to me to get a sample of the above working project :)




Srini P.

IT Leader | Bank of America | Deloitte | Merrill Lynch | Navy Veteran | Columbia Masters

4 年

Excellent article Manish!

回复
Puneet Punj

Staff Software Engineer at Commonwealth Bank

4 年

Would love to see it’s working example. Any git repo?

要查看或添加评论,请登录

Manish Mitra的更多文章

  • Importance of Shift Left Paradigm

    Importance of Shift Left Paradigm

    A typical software development process is sequential (1970s-1990s): define requirements, analyse, design, code, test…

    1 条评论
  • Why Mentors are Important!

    Why Mentors are Important!

    Many mentors list their passion for helping others as a strong motivator for their involvement and find great reward in…

    1 条评论

社区洞察

其他会员也浏览了