O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reality. Why we do need it.

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio

Confira estes a seguir

1 de 27 Anúncio

.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reality. Why we do need it.

Do you recall those buzz words like TDD, BDD? Yep, but we know their problems as well!
TDD is too granular. BDD is too coarse-grained.
Unit tests are too chatty. BDD is too abstract.
TDD requires knowledge of implementation details. BDD does not care about implementation at all.
What is in the middle? Integration tests. Let's be Integration driven then! OK, then how to build infrastructure to run Integration tests? Should we start with IaaS first? How to speed up the development and take into account non-foundational requirements like scaling, security borders, isolation, etc. from the very beginning? To answer the questions, we would combine Integration test-based development with serverless (AWS) to solve a typical business task. Based on the example, we would show how to create a solid foundation for further refactoring/refining of the overall solution and concreting it with Unit tests.
Acceptance tests would be left for home exercise ;)

Do you recall those buzz words like TDD, BDD? Yep, but we know their problems as well!
TDD is too granular. BDD is too coarse-grained.
Unit tests are too chatty. BDD is too abstract.
TDD requires knowledge of implementation details. BDD does not care about implementation at all.
What is in the middle? Integration tests. Let's be Integration driven then! OK, then how to build infrastructure to run Integration tests? Should we start with IaaS first? How to speed up the development and take into account non-foundational requirements like scaling, security borders, isolation, etc. from the very beginning? To answer the questions, we would combine Integration test-based development with serverless (AWS) to solve a typical business task. Based on the example, we would show how to create a solid foundation for further refactoring/refining of the overall solution and concreting it with Unit tests.
Acceptance tests would be left for home exercise ;)

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Semelhante a .NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reality. Why we do need it. (20)

Anúncio

Mais de NETFest (20)

Mais recentes (20)

Anúncio

.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reality. Why we do need it.

  1. 1. Тема доклада Тема доклада Тема доклада KYIV 2019 How serverless makes Integration TDD a reality. Why we do need it. Sergey Medvedev Enterprise Architect .NET CONFERENCE #1 IN UKRAINE
  2. 2. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Theory .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  3. 3. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Why do we need testing? .NET CONFERENCE #1 IN UKRAINE KYIV 2019 - Be able to refactor -> can improve code - To detect bugs early -> can validate solution quickly - Be confident in code -> do not be afraid of demo - Be not afraid of code -> be able to refactor
  4. 4. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Typical test pyramid .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  5. 5. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Typical test pyramid .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  6. 6. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Code dissected .NET CONFERENCE #1 IN UKRAINE KYIV 2019 10% of code for 90% of cases – Happy path 90% of code for 10% cases – Sad and Bad paths
  7. 7. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Where to start? .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Start with Integration test for Happy path!
  8. 8. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Practice .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  9. 9. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Part 2. Practice .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Domain: Block chain Goal: Be able to find Nonce to complete block Limitations: - Too many competitors -> performance - Unclear final infrastructure -> prototype Requirements: - Need highly scalable solution - Implementation must follow the standard
  10. 10. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 OK, we need some basic theory
  11. 11. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Bitcoin theory. Simplified Block chain .NET CONFERENCE #1 IN UKRAINE KYIV 2019 More details: https://5minuteblockchain.com/2019/05/10/blockchain/
  12. 12. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Bitcoin theory. Simplified Block structure .NET CONFERENCE #1 IN UKRAINE KYIV 2019 More details: https://5minuteblockchain.com/2019/05/20/blocks-in-bitcoin/
  13. 13. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Bitcoin theory. Simplified Block hash and nonce .NET CONFERENCE #1 IN UKRAINE KYIV 2019 More details: https://en.bitcoin.it/wiki/Block_hashing_algorithm Bitcoin hash: SHA256(SHA256(Block_Header)) where - Block_Header is concatenation of HEX’ed values of the following fields Field Purpose Version Block version number hashPrevBlock 256-bit hash of the previous block header hashMerkleRoot 256-bit hash based on all of the transactions in the block Time As seconds since 1970-01-01T00:00 UTC Bits Current difficulty Nonce 32-bit number (starts at 0, is incremented for each hash. If Nonce overflows - extraNonce portion of the generation transaction is incremented, which changes the Merkle root.
  14. 14. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Bitcoin theory. Simplified Merkle root .NET CONFERENCE #1 IN UKRAINE KYIV 2019 More details: https://5minuteblockchain.com/2019/05/20/blocks-in-bitcoin/
  15. 15. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Everything is clear. Let’s start programming!
  16. 16. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 But, let’s imaging the solution first…
  17. 17. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Solution. Vision .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Component diagram
  18. 18. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Solution. Vision .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Activity diagram
  19. 19. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Where to start? .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Start with Integration test for Happy path!
  20. 20. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Step 1: Basic solution .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  21. 21. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Step 1: Basic solution .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Outcome: • Integration test in "unit test like" style • we know basic interfaces, models, draft project structure • we can "run" the solution!!! • we can split work into at least 2 stream: • protocol research to identify contracts and refine them - IBitcoinClient • continue work on architecture and design for mining - IMiner
  22. 22. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Step 2: Infrastructure & Scaling prototype .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  23. 23. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Step 2: Infrastructure & Scaling prototype .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Outcome: • Established architecture • Approach on how to address key problem - scalability • Can run performance tests • Not afraid to refactor • Can split work into multiple streams • Can validate refactored solution
  24. 24. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Next steps… .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Refactoring goals: • align implementation with standards • write unit tests to address Sad/Bad paths • Improving infrastructure • Etc.
  25. 25. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Key takeaways .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Serverless • Quick infrastructure prototyping • Infrastructure as a Code (IaaC) Integration test: • Focus on end result • Solution scaffolding • Quick solution to run • Early demo to engage business • Framework to develop in parallel by multiple teams with confidence • Write unit tests for stable parts
  26. 26. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Instead of conclusion…
  27. 27. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Don’t know how to proceed – write tests! .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Thanks and have a green tests!

×