注册 / 登录

Testing Microservices: Tips, Tricks, and Tools

分会场:  测试实践/测试工具链建设/大前端&移动端

 

案例来源 :

案例讲师

Scott McMaster

Grab Engineering Lead

Dr. Scott McMaster is an Engineering Lead at Grab on the GrabAds platform, building and providing technical direction for teams in Seattle, Sinagpore, and Ho Chi Minh City. Prior to coming to Grab, Dr. McMaster worked for Google, Microsoft, Amazon, and some smaller startups, as well as teaching as an adjunct professor of computer science and software engineering at Seattle University and the University of Washington. He has a Ph.D. in Computer Science from the University of Maryland. His expertise and interests include software architecture, design, and testing. Dr. McMaster has authored two ebooks on automated testing currently available on Amazon.com.

扫描二维码分享案例

 

案例简述

 

Traditionally, web applications have been developed in a single programming language and code that is built, deployed and scaled as one (probably large) “monolithic” unit. More recently, engineering teams are moving away from monolithic applications and turning to microservices. Microservice architectures allow teams to independently develop and deploy smaller software services (even in different programming languages) that are easier to understand and safer to modify. These smaller services integrate with each other not by code compilation but rather by sending remote procedure calls (using, for example, REST or gRPC) at runtime. As a result, microservice architectures have many more runtime dependencies and interconnections. These interconnections present new challenges for software testing. In this talk, we will discuss various techniques for unit and integration testing when using microservice architectures. Instead of making extensive use of interfaces and mock or stub objects, we

 

案例目标

 

※Introduction and Motivation We will discuss where web application architecture has been and where it is going, with a focus on what this means for software testing. a)Monolithic Web Applications i)Drawbacks of the Monolith Large, single applications built from the same codebase and deployed as one unit were long the state of the art in web applications. But they come with some significant downsides, which we will touch on here. b)Microservice Architecture i)Benefits of Microservices More recently, companies such as Amazon, Netflix, and Google have led the way in pioneering a new style of architecture – microservices – characterized by a large number of smaller services that communicate over remote procedure calls to build complex functionality. Microservices address several of the drawbacks of the monolith. c)Microservice Testing Considerations i)Unit Testing Challenges ii)Integration Testing Challenges While microservices provide significant benefits in terms of software development and deployment, they also introduce new problems of software testing. We will consider this in both the unit and integration testing contexts. ※Sample Application a)Architecture b)How We Would Like to Test the Sample Application This section will introduce a sample application – getting stock quotes in different currencies – that is built with a microservices approach. Testing this application will motivate the rest of the talk.

 

成功(或教训)要点

 

Challenge #1: Unit Testing Our Microservices a)Testing Code with Third-Party Service Dependencies i)Traditional Approach with Mocks and Stubs ii)Newer Approach With Proxy Server Typically, testing code that calls a third-party web service is, first and foremost, a software design problem that we solve by introducing interfaces and mocks/stubs for unit testing. But this approach can lead to unnecessarily complex code. Instead, we will see how we can run an embedded proxy server to mimic the behavior of the third-party service during our unit tests. Challenge #2: Integration Testing Our Microservices. a)Testing Our Microservices Together on a Single Machine i)Tradition

 

案例ROI分析

 

即将上线。

 

案例启示

 

a)Microservices Change the Way We Test b)Testing Microservices Doesn’t Have to be Difficult! Microservices provide many benefits to developers and teams, but they also present new testing challenges. With the right tools and techniques, we can address these challenges and end up with more robust, well-tested web applications.

 

领取大会PPT

我要参会

大会全套演讲PPT

立即领取

大会即将开幕,点击抢票!

我要参会