Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DevOps and the letter soup: TDD, CI, CD and CD

DevOps and the letter soup: TDD, CI, CD and CD

In recent years we see the popularity of new techniques to speed up the delivery of reliable and functional software. Unit testing (TDD) and integration tests, code quality metrics, continuous integration servers (CI), continuous delivery (CD), continuous deployment (CD) and other methods to add value to your software.

With so many options, many are lost on how to do this mixture. As a recipe for soup, we need to put the ingredients in specific order to get excellence. In this talk I will discuss all the necessary stages, their minimum requirements and tips for your software deliver quality with speed.

Marcelo Pinheiro

October 17, 2015
Tweet

More Decks by Marcelo Pinheiro

Other Decks in Technology

Transcript

  1. DevOps and the letter soup: TDD, CI, CD and CD

    Marcelo Pinheiro http://salizzar.net - @salizzar - https://github.com/salizzar
  2. $ whoami • Fireman / Problem Solver / Programmer since

    2000 • Ruby, Python, Golang, Java, C#, Classic ASP, PHP, Coldfusion, Erlang and others • Fought, made coffee, negotiated deadlines • DevOps Engineer • HIRE ME! :)
  3. In a large stock pot, over medium-low heat, heat olive

    oil and saute garlic for 2 to 3 minutes. Add onion and saute for 4 to 5 minutes. Add celery and carrots, saute for 1 to 2 minutes.
  4. Much people believe that preparing a soup is simply add

    all things in a saucepan. BUT IS NOT.
  5. Like a soup, to deliver software fast with quality and

    agility you must follow a chronological order.
  6. TDD: Test-Driven Development • How you grant your software works

    without bugs? • How secure you are while refactoring some code? • TDD for the rescue! • Write code to test your code • The evolution: BDD (Behaviour-Driven Development) • Captain Obvious: based on behaviour of you want to test
  7. TDD: Test-Driven Development • You need to define a quality

    target for each application • For new applications, be aggressive: at least 95% • For legacy applications, write unit tests FOR EACH bug to be solved or new feature without define a target. Baby steps • With time, your application will be more reliable
  8. Integration Tests • OK, you’ve wrote some unit tests and

    your code is more safe… but anyway it can have bugs or not work. • You need to use Integration Tests! • Set of tools to run and test if your application have the desired behaviour • Ruby, Java, Python, etc • You can use some Service as a Software (SaaS) • Runscope
  9. Code Metrics & Quality • Well, your unit tests and

    integration works! Good! • But… the code is well written? • Working code ≠ good code • As the same with Integration Tests, you have libraries or SaaS solutions • Remember, good code is good Jorge Perlingeiro
  10. Extra: Application Monitoring • You can monitor some behaviours with

    useful libraries or services • Memory, CPU, response time, error rating • Create alerts when something is wrong • My tips: • Newrelic • PagerDuty
  11. Add chicken broth, water and tomato sauce, bring to boil,

    stirring frequently. If desired add red wine at this point. Reduce heat to low and add kidney beans, green beans, spinach leaves, zucchini, oregano, basil, salt and pepper. Simmer for 30 to 40 minutes, the longer the better.
  12. TDD or BDD / Integration Tests / Code Metrics &

    Quality / Application Monitoring are good. But how I can plug it into my daily work?
  13. Continuous Integration • What is Continuous Integration? • A workflow

    where after you commits the code, a server process it and automate things • Unit tests • Integration Tests • Code Metrics & Quality • Reports Generation • A barrier when your app breaks something
  14. Continuous Integration • OK, but where the options? • Custom

    solutions: • Jenkins • Thoughtworks Go • SaaS solutions: • Circle CI • Codeship
  15. Fill a medium saucepan with water and bring to a

    boil. Add macaroni and cook until tender. Drain water and set aside.
  16. Continuous Delivery • What is Continuous Delivery? • A workflow

    where after all things that Continuous Integration does, you can deliver ready software to production *manually* • Artefact generation • tarballs • OS packages (rpm, deb) • Artefact publishing • Bintray • Artifactory • Your repository
  17. Continuous Delivery • If you are here, you are among

    the bests • A LOT OF COMPANIES TRIES TO ARRIVE HERE BUT FAILS • It’s hard to map all company software requirements • More bigger is the company, more challenges • You need to standardise software distribution
  18. Continuous Delivery • More than the technological stuff, you need

    to evolve other teams • Operations • Operations Support • Products Team • WE ALL ARE A TEAM INSIDE THE SAME BOAT • A culture work must be created
  19. Once pasta is cooked and soup is heated through place

    2 tablespoons cooked pasta into individual serving bowls. Ladle soup on top of pasta and sprinkle Parmesan cheese on top. Spray with olive oil and serve.
  20. Continuous Deployment • What is Continuous Deployment? • A workflow

    where after all things that Continuous Delivery does, but automagically.
  21. Continuous Deployment • It’s HARD. • You need to get

    feedback about your Continuous Delivery process • You need to get confidence with your development & operations teams • You need to think about rollback automation • How to track a successful deploy? Or a rollback?
  22. Continuous Deployment “I maintain that truth is a pathless land,

    and you cannot approach it by any path whatsoever, by any religion, by any sect.” - Jiddu Krishnamurti