Testing in Micro-services
Architecture
Varuna Srivastava
Bangalore
August 22nd 2015
Agenda
• Why MicroServices
• Monolithic to MicroServices Architecture
• Challenges In Testing
• Demo using MockServer
No Free Lunch
API
Monolithic Enterprise to Microservice Architecture
Multiple services work together as a system…. ..to provide
business feature
Traditional Testing Approach
New Perspective in Testing
Validating small component
Persist
ence
CertificationAddress
Micro Service Interactions
Certification
Address
Payment
Challenges
• Dependency Management
• Tackle a Session
• Distributed System Complexity (Decentralized Database)
• Managing Test Data
• Contract Documentation
#1 Dependency Management
Dependency Management
Dependency Management
#2 Session Management
Session Management
#3 Decentralized Database
#4
• Mock Test Data Service environment specific
#5 Contract Documentation
Address Contract Documentation
SnowCrash
snowcrash Address.md
•
• Aglio -i Address.md –o Address.html
Dredd Address.md
Some Tricks
• Focus on one service end point at a time
• Define the boundary of test
• Make sure services are designed to support different content type.
Mock Server
Microservices Testing
Microservices Testing
Microservices Testing

Microservices Testing

Editor's Notes

  • #2 Good Afternoon Everyone!! Hope u had a enjoyed lunch I am Varuna Let’s have a quick Glance of agenda
  • #10 A micro-service represents a small piece of business logic. By nature it is atomic. thus it can be designed, developed, deployed independently. As it encapsulates business logic, this unit must be tested and certified.
  • #11 Orchestration Services consume one or more micro-services and/or Orchestration Services to achieve a greater goal.
  • #12 Little control on how the API’s will be used No control on how services are Orchestrated used in Combination Public API’s are foreever Better get it first time
  • #13 Gradle combines the power and flexibility of Ant with dependency management of maven into a more effective way to build.
  • #16 Java DSL for easy testing of REST services Testing and validating REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain. Consider a scenario when you are making a payment it is been asked to add a billing address.. Creating a new cookies whenever user logs in. So in a flow when your making payment now u logs in
  • #20 API mock to take your API for a spin--without writing any code. Iterate, rinse & repeat. Coding can wait until you know what your developers really need.
  • #21 API mock to take your API for a spin--without writing any code. Iterate, rinse & repeat. Coding can wait until you know what your developers really need.
  • #22 Snow Crash – parsing the markdown Aglio – rendering the markdown in an html format (it needs node.js installed on your machine) Dredd – testing the documentation  Dredd for validation