
Introduction to Performance and Load Testing.
Performance Testing Fundamentals
Load Testing Types
Introduction to Grafana K6
Setting up the playground environment:
VS Code
Docker Desktop
k6 Binaries
k6 Docker Images
QuickPizza Demo Project
Our first test in javascript for quickly running using k6 binary or docker image to identify basic concepts of k6
CLI Output
Basic Structure
Docker Image
In k6, we have two main concepts: Virtual Users (VUs) and iterations. In this section we will deep dive how to set them up in test scripts!
What about simulating a real life example? How can we be as close to reality as we can?
Build and orchestrate the steps of your load test with stages!
Want to assert APIs? Checks is the way to move forward like in Unit Testing!
Codifying SLOs? Use Thresholds and abort test execution as soon as conditions met!
Importing data from different sources like static fs files is important to keep our tests without hard-coded values.
Review all the different stages of the k6 lifecycle and how it resembles to other functional testing frameworks!
How many parameters and configurations exists in K6 ecosystem. See how to pass them from CLI to run your tests with multiple flavors!
Scenarios configure how VUs and iteration schedules in granular detail. With scenarios, you can model diverse workloads, or traffic patterns in load tests.
Many things can go wrong when a system is in use. On an average day, the system must run numerous operations simultaneously and respond to different requests from a range of users, but there could also be a sudden spike in users or a major event that pushes your system to its limits — or beyond. To prepare for these performance risks, teams use load testing to see how an application or system will perform in a variety of use cases.
In this Lecture we will find out how to push metrics to Time Series DBs and particularly Prometheus. Using Grafana and Prometheus we can now visualise and monitor load testing execution!
In this Lecture we will also experiment with another popular Time Series DB InfluxDB and review how to run k6 within docker compose!
Run your k6 tests in your CI provider. This lecture is dedicated to run on Github Actions Workflows!
The browser module brings browser automation and end-to-end web testing to k6 while supporting core k6 features. It adds browser-level APIs to interact with browsers and collect frontend performance metrics as part of your k6 tests.
The browser module can use all key k6 functionalities, such as Thresholds
Create multiple hybrid scenarios that can run against BE APIs and FE UIs.
Build your own custom metrics for FE related user journeys!
Build you framework with PageObject abstraction design pattern as in typical UI functional testing framework!
Topics that will be covered with this course:
1. Introduction to Performance Testing
Definition and importance of performance testing.
Key objectives: identifying bottlenecks, ensuring reliability, and improving user experience.
Differentiating performance testing from functional testing.
2. Types of Performance Testing
Load Testing: Assessing system behavior under expected user loads.
Stress Testing: Evaluating system limits by pushing beyond normal operating conditions.
Endurance Testing: Testing system behavior under sustained use.
Scalability Testing: Measuring the system's capacity to scale with increased demand.
Spike Testing: Observing how the system handles sudden increases in load.
3. Performance Metrics
Response time, throughput, and latency.
Resource utilization.
Error rates and system capacity.
4. Performance Testing Process
Setting performance goals and requirements.
Creating realistic test scenarios and workloads.
Selecting tools (Grafana K6).
Running tests and monitoring system behavior.
Analyzing results to identify performance bottlenecks.
5. Common Challenges
Simulating realistic user behavior.
Addressing dependencies like UI.
Handling dynamic content and scaling infrastructure.
6. Best Practices
Start performance testing early in the development lifecycle.
Use data from real-world usage patterns.
Automate repetitive tests for efficiency.
7. Case Studies or Examples
Real-world examples of performance testing success stories.
Lessons learned from notable failures.
8. Tools and Trends
Overview of popular performance testing tools.
Emerging trends like AI-driven testing, cloud-based testing, and continuous performance monitoring.