Preface
- What makes this book unique?
- Who should read this book?
- How to read this book?
- Send me feedback
1Introduction
- 1.1Performance Testing vs Load Testing
- 1.2Benefits of Load Testing for web apps
- 1.3Why effective load testing is more necessary than ever?
- 1.4Reality Check
- 1.5Why do most projects do load testing poorly?
- 1.6Load Testing Approaches
- 1.6.1HTTP Protocol-based load testing
- 1.6.2Real browser-based load testing
- 1.7Review
2Practical Load Testing
- 2.1Load Testing Trends
- 2.1.1Approach: Protocol-based ⇒ Browser-based
- 2.1.2Who is doing load testing: one performance testing team ⇒ individual projects
- 2.1.3Tools: Expensive commercial proprietary ⇒ Free and open-source scripting
- 2.1.4Execution frequency: A few times ⇒ Early and frequently
- 2.1.5Execution mindset: Long and Regid ⇒ Short and Relax
- 2.2Success Factors
- 2.3Practical Load Testing
- 2.3.1The Team Owns it
- 2.3.2Starting small, Starting today
- 2.3.3Do it often as a part of CT
- 2.3.4Make every load testing short, less stringent
- 2.3.5Focus on the main, then the rest load testing targets
- 2.3.6The Process
- 2.4Case Study: How will I load test Census Australia?
- 2.4.1Prerequisite
- 2.4.2Process
- 2.4.3The Cost
- 2.4.4Why does it work?
- 2.4.5FAQ
- 2.5Review
3Protocol-based Performance and Load Testing
- 3.1How does Protocol-based testing works?
- 3.2Simple Performance/Load Testing Exercise
- 3.3Scripting with Mechanize
- 3.3.1Preparation
- 3.3.2Performance Testing
- 3.3.3Simple Load Testing
- 3.3.4Compare load results
- 3.3.5Failure to load test AJAX
- 3.4Load testing with JMeter
- 3.4.1Performance Testing
- 3.4.2Load Testing
- 3.5Handcrafted scripts vs GUI tools
- 3.6Review
4Test Syntax Framework
- 4.1RSpec
- 4.1.1Install and Run RSpec tests
- 4.1.2A performance test in RSpec
- 4.2Avoid Gherkin
- 4.3Review
5First Functional Performance Test
- 5.1Test Design
- 5.2Install Testing Tool
- 5.3New Performance Test Project
- 5.4Run the blank test
- 5.5Create test steps
- 5.5.1Create test steps manually
- 5.5.2Using TestWise Recorder
- 5.5.3Test case
- 5.6Add measurements
- 5.6.1Measure timings in Ruby
- 5.7Headless browser mode
- 5.8Compare performance testing results
- 5.9Measure AJAX operations
- 5.10Functional Test vs Functional Performance Test
- 5.11Review
6Performance Test Plan
- 6.1Scope of work
- 6.2Testing execution approach
- 6.3Automation framework
- 6.3.1Protocol based frameworks
- 6.3.2Browser based frameworks
- 6.4Scripting language
- 6.5Test Syntax framework
- 6.6Test Creation: Recording vs Handcrafting
- 6.7Automation Tools
- 6.7.1Be efficient
- 6.7.2Preview browser-based tests
- 6.8Measurements
- 6.8.1Operation types for measurements
- 6.8.2Determine operations for timing
- 6.9Test executions and Reporting
- 6.10Review
7Continuous Performance Testing
- 7.1Why run performance tests in CT server
- 7.2Set up BuildWise Server
- 7.3Execute performance tests in a CT server
- 7.3.1Prerequisite
- 7.3.2Set a CT build project
- 7.3.3Trigger a CT run
- 7.3.4View Build result
- 7.3.5Continuous Execution
- Create your own CT performance testing project
- 7.4Case Study - Performance Testing WhenWise’s Reset
- 7.5Review
8Load Test Plan
- 8.1Load Testing Scenarios
- 8.2Determine the number of VUs required
- 8.3Generate Load
- 8.4Load Testing Metrics
- 8.5Define Success Criteria
- 8.6Parallel Execution in a CT server
- 8.7Execution Control
- 8.7.1Testing What?
- 8.7.2With how much load?
- 8.8Review
9Continuous Load Testing
- 9.1Generate Load from the command line
- 9.2How does Continuous Load Testing work?
- 9.2.1Benefits
- 9.2.2How can this approach handle a large load, e.g. 10000 concurrent users?
- 9.3Build Agents
- 9.3.1Build Agent Machines
- 9.3.2Install BuildWise agent software
- 9.3.3Configure first build agent
- 9.3.4Verify software on an Agent machine
- 9.3.5Verify Test Execution in an Agent
- 9.3.6Configure - Pre Execution (optional)
- 9.3.7Clone multiple build agents
- 9.4Set up Load Testing project
- 9.5Review
10Custom Load Testing Execution
- 10.1Control which tests to run
- 10.1.1Focused Scenario(s)
- 10.1.2Mix Scenarios
- 10.2Prepare Execution
- 10.3A Quick Test Run with one Build Agent
- 10.3.1Build Agent Specifiction Affects Performance
- 10.4Control the Load
- 10.4.1Set VU count
- 10.4.2Set test execution time
- 10.4.3Increase the load gradually
- 10.5Set Success Criteria
- 10.5.1Overall failure rate
- 10.5.2Indvidual Operation Timings
- 10.6Monitor Execution
- 10.7Case Study: Load Testing User Login
- 10.7.11 VU
- 10.7.23 VUs
- 10.7.36 VUs
- 10.7.49 VUs
- 10.7.512 VUs
- 10.7.6Report
- 10.7.7Analyse
- 10.7.8What’s next?
- 10.7.9Review
- 10.8Case Study: Mixed Scenarios
- 10.8.1Create a new Build Project by Clone
- 10.8.2Test Scripts
- 10.8.3Debug Operation Failure
- 10.8.4Report
11Identifying Flaws and Performance issues
- 11.1Functional Flaws
- 11.1.1Design Flaw
- 11.1.2Race conditions
- 11.2Non-Functional
- 11.2.1Website Crash
- 11.2.2Software Inefficient
- 11.2.3Deployment/Infrastructure Flaw
- 11.3Feedback Time is Critical
- 11.4Performance/Load Improvement Suggestions
- 11.5Review
12Continuous Testing Lab
- 12.1Costing Factor
- 12.2Start Small, Start Today
- 12.3Reliable
- 12.4Ongoing Mainteance
- 12.4.1Execution Environment
- 12.4.2BuildWise Agent
- 12.4.3App related
- 12.5Optimize For Speed
- 12.5.1Recommendations
- 12.6Review
13Maintaining Load Test Scripts
- 13.1Reusable functions and Page Objects
- 13.1.1Page Object Models
- 13.1.2Reusable Helper Functions
- 13.2Test Refactoring
- 13.3Coding conventions
- 13.4AJAX in Load Tests
- 13.5Review
14Best Practices
- 14.1Run a warm-up script first
- 14.2Using faster Selenium operations
- 14.2.1Prefer a faster locator
- 14.2.2Avoid Selecting an option by Index
- 14.2.3Reuse already located element
- 14.2.4Submit form instead of clicking a submit button
- 14.2.5Asserting page content using source
- 14.3Speed up non-operational steps
- 14.3.1Mimimize test data
- 14.3.2Using JavaScript to enter text data
- 14.4Avoid Conflicts
- 14.4.1Stabilise load scripts with randomization
- 14.4.2Leave no side effects
- 14.5Review
Appendix: TestWisely
- Test Scripts on Github
- Verify: Run tests on TestWise
- Set up a CT Lab on TestWisely and Run Performance/Load Tests
- Sign up TestWisely
- Set up Wizard
- Set up Build Projects
- Performance Testing
- Protocol-based
- Browser-based
- Execution
- Load Testing
- Allocate Build Agents
- A Run of Load Testing on TestWisely’s BuildWise
- How do Build Agents support different Apps?
- Test Scripts on Build Agents
- Update BuildWise Agent Configuration
- FAQ
Resources
- Books
- Tools
- Online Resource