Test Smarter Not Harder - how to design tests for continuous delivery
MelissaBenua
31 views
52 slides
Jul 10, 2024
Slide 1 of 52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
About This Presentation
Imagine: as soon as any developed functionality is submitted into the code repository, it is automatically subjected to the appropriate battery of tests and then released straight into the wild. Setting up the pipeline to do just that has become commonplace, but most organizations hit the same stumb...
Imagine: as soon as any developed functionality is submitted into the code repository, it is automatically subjected to the appropriate battery of tests and then released straight into the wild. Setting up the pipeline to do just that has become commonplace, but most organizations hit the same stumbling block: just what IS the appropriate battery of tests? Automated build pipelines don't always lend themselves well to the traditional stages of testing. In this hands-on tutorial, Melissa will introduce testers to the key principles of test case and test suite design that apply to organizations big and small to allow them to take full advantage of the pipeline's capabilities without introducing unnecessary bottlenecks. Testers will learn how to make highly reliable tests that run fast and preserve just enough information to let the team determine exactly what went wrong and how to reproduce the error locally. They will also explore how to reduce overlap while still maintaining adequate test coverage, about what test areas might be most beneficial to combine into a single suite, and what areas might benefit most from being completely broken out.
Size: 6.05 MB
Language: en
Added: Jul 10, 2024
Slides: 52 pages
Slide Content
Test smarter, not harder! how to design test suites for continuous delivery STAREAST 2024 Melissa Benua / Head of Platform Engineering, mParticle
About Me Melissa Benua Sr Director of Engineering, Platform mParticle Get in touch! [email protected] @ queenofcode Follow my work! https://www.linkedin.com/in/mbenua/ https://www.slideshare.net/MelissaBenua/ https://github.com/queen-of-code/ https://www.queenofcode.net @ queenofcode
Imagine: as soon as any developed functionality is submitted into the code repository, it is automatically subjected to the appropriate battery of tests and then released straight into the wild. Setting up the pipeline to do just that has become commonplace, but most organizations hit the same stumbling block: just what IS the appropriate battery of tests? Automated build pipelines don't always lend themselves well to the traditional stages of testing. In this hands-on tutorial, Melissa will introduce testers to the key principles of test case and test suite design that apply to organizations big and small to allow them to take full advantage of the pipeline's capabilities without introducing unnecessary bottlenecks. Testers will learn how to make highly reliable tests that run fast and preserve just enough information to let the team determine exactly what went wrong and how to reproduce the error locally. They will also explore how to reduce overlap while still maintaining adequate test coverage, about what test areas might be most beneficial to combine into a single suite, and what areas might benefit most from being completely broken out. @queenofcode
Navigation @ queenofcode
continuous delivery what is it and why does it matter? @queenofcode
@ queenofcode PRE-MERGE POST-MERGE Code & Test Deploy & Test Deploy & Test Peer Review Monitor & Alert
@ queenofcode PRE-MERGE POST-MERGE Code & Test Deploy & Test Deploy & Test Peer Review Monitor & Alert Local Dev Env / Ephemeral QA Env Pre-Production / Production
@queenofcode
@ queenofcode PRE-MERGE POST-MERGE Code & Test Deploy & Test Deploy & Test Peer Review Monitor & Alert Local Dev Env / Ephemeral QA Env Pre-Production / Production
01 Unit Tests 02 Automated Tests 03 Manual Tests Functional Test Case Pyramid @queenofcode
Unit Test Guidelines @queenofcode Does not cross application boundaries Should support parallelism Textual `Input -> Output` validation Does NOT leave the box
Beyond Unit Tests @queenofcode Build Compile change against main Execute unit tests Deploy Deploy change to testing environment Execute integration tests Validate Execute UI + load tests Manual signoff Monitoring signoff Project structure? Moving parts? Functional boundaries? Shared resources? Mocking potential?
Automated Test Guidelines (Integration) @queenofcode Crosses application boundaries Does not require manual intervention Simple `Input -> Output` validation Follows user application flow
Semi-Automated to Manual Test Guidelines @queenofcode Crosses many boundaries Requires manual intervention or setup Difficult validation (not pass/fail) Validates complex scenarios
More Definitions @queenofcode
Exercise: Test Cases @queenofcode How should we test our photo gallery? All ideas are good ideas!
Smart Test Case Principles what makes a test case ‘smart’?
Test Case principles @queenofcode
Speed @queenofcode
Speed @queenofcode Build Failure? UI Test Failure?
Reliability @queenofcode
Reliability @queenofcode
Specificity @queenofcode
Specificity @queenofcode
Proceed With Caution @queenofcode
Exercise: Smart Test Cases @queenofcode Out of all our test ideas, which ones aren’t specific, speedy, or repeatable? Are there some we just shouldn’t do?
Monitoring and reporting what just happened?
Code Health @queenofcode
If your site crashes on the internet but isn’t monitored, is it really down??? @queenofcode
Pillars of Observability @queenofcode
Logging vs Metrics @queenofcode Text Log File? Graph?
Metric Types @queenofcode Rate Success Requests Per Second Failure Requests Per Second Events Per Second Histogram Request Latency Database Latency 60 75 50 90 Gauge Max items in queue Bytes in use
Using Metrics @queenofcode
Metrics and Alerts @queenofcode
Metrics and Automation @queenofcode void Call(ref int A, ref int B) { A = DoWork (); B = DoOtherWork (); CallsCounter.Increment (); }
Exercise: Monitoring @queenofcode How should we monitor our photo gallery? What should we focus on to backstop our testing efforts?
Smart Test Pipeline design what kind of tests are successful in cd?
Example Service Architecture @queenofcode
Test Flow @queenofcode Build Change 01 Compile Code Run Unit Tests Create Code Package 02 Deploy Package 03 Validate Product 04 Package code Create Docker image Deploy app / start Docker container Run Auto Tests Run Manual Tests Validate monitors
@queenofcode
Example suite breakdown @queenofcode
Example Suite Breakdown @queenofcode
Pair code changes to appropriate tests! @queenofcode
Integration Test Matrix – Login SCENARIO @queenofcode
Integration Test Matrix – API Scenario @queenofcode
Tips and Tricks @queenofcode
Exercise: Mapping Cases to Categorized Suites @queenofcode What should we run? When should we run it? How long should we wait?