Tes esting g Micr croser services: ces: From m Devel elopmen ment to Product ction
Daniel Bryant @danielbryantuk
Tes esting g Micr croser services: ces: From m Devel elopmen - - PowerPoint PPT Presentation
Tes esting g Micr croser services: ces: From m Devel elopmen ment to Product ction Daniel Bryant @danielbryantuk Rube Goldbergs self-operating napkin 26/10/2018 @danielbryantuk Was Rube Goldberg the first microservice architect?
Daniel Bryant @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
spectrum from “YOLO” to seeking absolute correctness
techniques for microservice testing
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
bit.ly/2jWDSF7
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk /lisacrispin.com/2011/11/08/using-the-agile-testing-quadrants/ martinfowler.com/bliki/TestPyramid.html
rise in popularity of microservices…
26/10/2018 @danielbryantuk martinfowler.com/bliki/TestPyramid.html
26/10/2018 @danielbryantuk https://medium.com/@copyconstruct/testing-microservices-the-sane-way-9bb31d158c16 http://distributed-systems-observability-ebook.humio.com/
26/10/2018 @danielbryantuk https://medium.com/@copyconstruct/testing-microservices-the-sane-way-9bb31d158c16
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk https://www.usenix.org/system/files/conference/osdi14/osdi14-paper-yuan.pdf https://www.youtube.com/watch?v=ZMbqbXxRthE
reproduced by a unit test
have prevented 58% of catastrophic failures
26/10/2018 @danielbryantuk https://www.usenix.org/system/files/conference/osdi14/osdi14-paper-yuan.pdf
If your component/integration tests look too complicated, they probably are Coupling and cohesion apply to everything!
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk https://itnext.io/microservice-testing-coupling-and-cohesion-all-the-way-down-a9f100cda523
Representational data is often the weakest link Understand your data ”shape” and volume
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
chaos engineerings (in this order)
26/10/2018 @danielbryantuk https://itnext.io/microservice-testing-coupling-and-cohesion-all-the-way-down-a9f100cda523
Let’s look at some techniques in more depth
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk martinfowler.com/bliki/TestPyramid.html
Contract Tests Focused on system Focused on service/function
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk https://codefresh.io/docker-tutorial/how-to-test-microservice-integration-with-pact/
1. Consumer writes a contract that defines an interaction with the API.
1. For HTTP RPC this is simply request with acceptable params and response 2. Often the contract can be autogenerated from a test
2. Consumer issues a pull request to producer containing the contract 3. Producer runs the SUT (via pipeline) and tests if the contract is valid
1. If yes, then simply accept the pull request 2. If no, then modify the SUT to meet the contract (this often involves inter- team communication), and then accept the pull request
4. Producer deploys (via pipeline), and consumer deploys (via pipeline)
1. Take care in regards to backwards compatibility
26/10/2018 @danielbryantuk
1. 2. 3. 4. 4.
26/10/2018 @danielbryantuk
docs.pact.io
cloud.spring.io/spring-cloud-contract github.com/spring-cloud-samples/spring-cloud-contract-samples
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk www.infoq.com/presentations/contracts-streaming-microservices docs.confluent.io/current/schema-registry/docs/maven-plugin.html
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
When engineers hear the phrase “chaos engineering”
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
When non technical folk hear the phrase “chaos engineering”
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
https://principlesofchaos.org/
26/10/2018 @danielbryantuk
https://chaostoolkit.org/
26/10/2018 @danielbryantuk
https://www.gremlin.com/ https://www.infoq.com/news/2018/10/gremlin-alfi
Tammy Butow’s three prerequisites:
26/10/2018 @danielbryantuk https://www.infoq.com/news/2018/03/resilient-systems-chaos-engineer
26/10/2018 @danielbryantuk https://www.infoq.com/news/2018/03/resilient-systems-chaos-engineer
Tammy Butow’s three prerequisites:
26/10/2018 @danielbryantuk
26/10/2018 @danielbryantuk
attempting to seek absolute correctness
vs post-prod tests (generally business facing and critiquing the product)
techniques for microservice testing
26/10/2018 @danielbryantuk
Twitter: @danielbryantuk Email: daniel.bryant@tai-dev.co.uk
Writing: https://www.infoq.com/profile/Daniel-Bryant Talks: https://www.youtube.com/playlist?list=PLoVYf_0qOYNeBmrpjuBOOAqJnQb3QAEtM
26/10/2018 @danielbryantuk