Quality Assurance
What needs to be tested?
How extensively do I test?
Are 10 unit tests better than 1 integration test?
Should I write tests even if I'm the only developer?
Do I need E2E tests?
Shouldn't the QA engineer write tests for me?
It depends
Codebase size
Team size
(git blame is not enough)
(complexity grows exp.)
Technology
(types? encapsulation? lint?)
Code quality
(refactoring)
$$$
(server is down = millions of $ go to the toilet)
Effective testing
Write test code as you write application code (TDD)
80/20 rule: which 20% of tests will cover 80% of the cases?
Think about testing when you write application code (separation of concerns, DI, service layer, pure functions)
Use tooling - test coverage
Think what code is most crucial
Top to bottom
Test code that...
Is being run the most
Is being used the most
Is complex (math, data processing, async)
Can have edge cases (usually unit tests)
Has a crucial business value (Auth, Payments...)
Unit test
1 unit = function / class
all else is mocked
Integration test
Endpoint test => routing + view/serialization
Component test?
Less mocking
Acceptance test
Series of endpoint tests
visit a URL => interact => check the result
POST /api/register => POST /api/login => GET /api/kingdom
/login => fill the login form => check that I'm on /kingdom
E2E test
Usually via external tool (Selenium, Cypress.io, Puppeteer)
Testing against real backend
qa.app.com
Integration tests
Acceptance tests
E2E tests
Unit tests
Test coverage
Visual testing
Nice, but rarely done:)
QA Q&A
assert(endOfPresentation, true);
assert.greaterThan(satisfactionPct, 90);
Thank you
deck
By Martin Malinda
deck
- 671