Testing for Continuous Delivery

@deadpyxel
Robson Cruz
DevOps Engineer @ Venturus

AGENDA

  • Por que testar?
  • Quando testar?
  • Como testar?

Quality is not an act, it is a habit.

- Aristotle

Intro

  • CI vs CD vs CI/CD
  • O que é qualidade?
  • Mais testes = Bons testes?
  • Commit vs Deploy

O que queremos é um ambiente estável do commit ao deploy!

Existem muitas discussões sobre teste...

The 4 stages of testing

Commit stage

fail fast and fail well.

Nesse passo testes comuns são:

  • Code style checks;
  • FAST unit tests;
  • Static Analysis;
  • Antipattern checks;
  • Data migration...

Acceptance Stage

Define what is releseable.

Nesse ponto são comuns:

  • Integration tests;
  • BDD;
  • Security assessment;
  • Performance tests;
  • Compliance checks;
  • Configuration checking;

Release Stage

Support our release.

Aqui iremos encontrar:

  • Smoke tests;
  • Monitoring and tracking;
  • Canary testing;

Product Stage

Now its time for business.

Nesse ponto, é comum aplicar:

  • A/B tests;
  • Capacity monitoring;
  • Bughunting;
  • Commercial Analysis;
  • Chaos Engineering!!!

Microservices...

are complicated...

Beware

  • Dependencies
  • DeSynchronisation
  • Deprecation of services

What about TDD

Well...it is a dicipline

The rules

  • One SHALL NOT write code that is not to pass a test
  • One SHALL NOT write any more of the failing test, and compilation failures are failures 
  • One SHALL NOT stop writing code when we have a passing test

Remember the mantra

But how?

How do we test and be happy?

Design for testability

Mock as often as possible

Use SOLID principles and DDD

when in doubt, test it out!

Closing words

Continuous Delivery

Dave Farley, um dos grandes nomes da engenharia de software.

Foca em muitos tópicos polêmicos, mas principalmente em como alcançar a tão sonhada Entrega Contínua.

Test & Code

O host é Brian Okken, entrevistando grandes nomes da computação, bem como os mantenedores de múltiplas ferramentas que utilizamos.

Tem conteúdo sobre testes, sobre automatização, sobre design patterns, e muito mais.

Refactoring

A bíblia para quem quer aprender como lidar com código legado, mal escrito ou como sobreviver a um grande processo de refatoração.

Q&A

Obrigado!

Técnicas de Teste para CI/CD

By Robson Cruz

Técnicas de Teste para CI/CD

  • 69