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

Test Automation Strategy for Legacy System.

Avatar for Mariya Mariya
November 02, 2019

Test Automation Strategy for Legacy System.

Avatar for Mariya

Mariya

November 02, 2019
Tweet

More Decks by Mariya

Other Decks in Technology

Transcript

  1. 2 Few words about Me Grodno, 2019 Artur Basak Programmer,

    ex-Lead UI Engineer at Lition Energy Developing, Implementing and Testing User Interfaces more than 9 years. Passionate about Web, Human-Computer Interaction and Automated Testing. /artur.basak /arturbasak /front-end-in-regions-grodno
  2. 3 Lition Energy Project Grodno, 2019 Lition Energy Lition Energy

    is an innovative electricity provider that connects consumers directly with renewable energy producers - without detours and unnecessary additional costs. On our digital platform, members choose their green power plant quickly and easily themselves.
  3. 5 Backend: Need Help! SOS! Grodno, 2019 Need Help! SOS!

    Frame from «Game of Thrones» series
  4. 6 Backend on High-Level Grodno, 2019 DataBase Ethereum Client External

    Services Frontends (SSR, SPA) Backend WS HTTP/SOAP HTTP SQL Jobs HTTP
  5. 7 Backend on Low-Level Don’t start with a monolith Grodno,

    2019 … when your goal is a microservices architecture Stefan Tilkov (c) https://martinfowler.com/article s/dont-start-monolith.html
  6. 8 Backend on Low-Level Initial State • Legacy Codebase •

    Callback Hell • No DB Migrations • No Tests! • No Lints! • Not Styled! Grodno, 2019 Frame from «Game of Thrones» series
  7. 12 Anatomy of Integration Test Grodno, 2019 Router / Handler

    Controller / Middleware DAL DB Test Input / Test Output
  8. 13 Anatomy of System Test Grodno, 2019 Router / Handler

    Controller / Middleware DAL DB Test Input / Test Output DB Mock Check fact that mock was called
  9. 15 System under Testing Grodno, 2019 DataBase Ethereum Client External

    Services System Tests Backend WS HTTP/SOAP SQL Jobs HTTP HTTP
  10. 16 Right Way for Test Coverage Grodno, 2019 Assert(js) 2018

    Conference. Screen from @aarondjents Twitter 100% ~80%
  11. 17 Delta Coverage Grodno, 2019 «Herb Derby came up with

    the notion of delta coverage - what coverage does this test provide that's unique? Tests with zero delta coverage should be deleted unless they provide some kind of communication purpose.» Kent Beck, «Is TDD dead? #4» https://martinfowler.com/articles/is-tdd-dead
  12. 18 Test Tools Grodno, 2019 Jest https://www.npmjs.com/pa ckage/supertest https://www.npmjs.com/ package/jest

    1.Already used on Frontend Side 2.Backend Team have no Experience with Tests 3.All inside Box 1.Test Executor 2.Test Doubles (Spies, Mocks, Stubs) 3.Expectation Functions 4.Test Coverage Report 4.Most Popular Supertest
  13. 21 System Test for Logout End-point Grodno, 2019 1.Create Query

    Mockup 2.Setup Query Mockup 3.Compare result & expectations
  14. 24 Jest Test Configs Grodno, 2019 Unit TestBed Integration TestBed

    Integration Tests System Tests Unit Tests https://docs.npmjs.com/cli/run-script https://www.docker.com http://knexjs.org
  15. 27 System under Testing Grodno, 2019 DataBase Service Mock Unit

    Tests System Tests Integration Tests Backend HTTP/SOAP SQL HTTP Origin Service Contract Tests
  16. 30 Contract Test Grodno, 2019 1.Make real request to external

    service 2.Compare response and fixtures data
  17. 31 Testing Pyramid in Practice Grodno, 2019 85% 13% 2%

    Unit Tests - 897 Integration Tests - 142 Contract Tests - 16
  18. 32 Test Coverage in Practice Grodno, 2019 0 1250 2500

    3750 5000 6250 Statements - 89.18% Branches - 80.13% Functions - 93.84% Lines - 89.16% Not Covered Covered
  19. 33 Links & Additions Grodno, 2019 • https://medium.com/front-end-in-regions-grodno • Lition,

    написанный на React.js • Доступность веб-интерфейсов. Что это и как? • https://medium.com/lition-blog • Lition and Reactjs [DevBlog] • Layout of Trading Platform [DevBlog] • What does blockchain mean for frontenders? [DevBlog] • Tests & Docs for Lition frontend [DevBlog] https://github.com/archik408/GROCON19
  20. 34 Thank You and Have fun! GROCON 2019 Grodno, 2019

    Frame from «Game of Thrones» series