Publicidad
Publicidad

Más contenido relacionado

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

Publicidad

Más de NETFest(20)

Publicidad

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

  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. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Theory .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  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. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Typical test pyramid .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  5. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Typical test pyramid .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  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. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Where to start? .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Start with Integration test for Happy path!
  8. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Practice .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  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. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 OK, we need some basic theory
  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. Тема доклада Тема доклада Тема доклада .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. Тема доклада Тема доклада Тема доклада .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. Тема доклада Тема доклада Тема доклада .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. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Everything is clear. Let’s start programming!
  16. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 But, let’s imaging the solution first…
  17. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Solution. Vision .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Component diagram
  18. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Solution. Vision .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Activity diagram
  19. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Where to start? .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Start with Integration test for Happy path!
  20. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Step 1: Basic solution .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  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. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Step 2: Infrastructure & Scaling prototype .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  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. Тема доклада Тема доклада Тема доклада .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. Тема доклада Тема доклада Тема доклада .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. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Instead of conclusion…
  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!
Publicidad