SlideShare a Scribd company logo
Automated
Performance
Testing
Lars Thorup
ZeaLake Software Consulting


May, 2012
Who is Lars Thorup?

●   Software developer/architect
    ●   C++, C# and JavaScript
    ●   Test Driven Development

●   Coach: Teaching agile and
    automated testing

●   Advisor: Assesses software
    projects and companies

●   Founder and CEO of
    BestBrains and ZeaLake
We want to know when performance drops
●   ...or improves :-)

●   Examples
    ●   this refactoring means the cache is no longer used for lookups
    ●   introducing this database index on that foreign key is way faster

●   Write a test to measure performance
var stopwatch = Stopwatch.StartNew();
for (int i = 0; i < 200; ++i)
{
    var url = string.Format("Vote?text={0}", Guid.NewGuid());
    var response = client.DownloadString(url);
    Assert.That(response, Is.True);
}
stopwatch.Stop();


●   When and how should the test fail?
We cannot use assert for this
           Assert.That(requestsPerSecond, Is.InRange(40, 50));


●   But the resulting time can vary widely
    ●   range too narrow: many false negatives
    ●   range too broad: many false positives
Use trend curves instead




●   Does not fail automatically :-(
    ●   unless we add automated trend line analysis

●   Need manual inspection
    ●   weekly, before every release
    ●   and it takes only 10 seconds

●   So the feedback is not fast
    ●   but shows which commit caused the performance issue
Demo: TeamCity from JetBrains
●   Make the tests output their results
          stopwatch.Stop();
          PerformanceTest.Report(stopwatch.ElapsedMilliseconds);


●   In an .xml file
         <build>
           <statisticValue key='Voting' value='667'/>
           <statisticValue key='PerfGetEvent' value='3689'/>
         </build>


●   Configure TeamCity to convert the data to graphs

●   Read more here
    ●   http://www.zealake.com/2011/05/19/automated-performance-trends/
Demo: Jenkins
●   Make the tests output their results in CSV files

●   Use the Plot plugin

More Related Content

PDF
Extreme Programming - to the next-level
PDF
Introduction to Automated Testing
PDF
Fast end-to-end-tests
PDF
Put "fast" back in "fast feedback"
PDF
UPC Plone Testing Talk
PDF
Becoming a better programmer - unit testing
PDF
Drulenium - Testing Made Easy
PPTX
Project management frameworks for software developing
Extreme Programming - to the next-level
Introduction to Automated Testing
Fast end-to-end-tests
Put "fast" back in "fast feedback"
UPC Plone Testing Talk
Becoming a better programmer - unit testing
Drulenium - Testing Made Easy
Project management frameworks for software developing

What's hot (20)

PDF
Improve the deployment process step by step
PDF
Why You Should Start Using Docker
PPTX
Develop 4 Developers
PPTX
That worked before
PPTX
QA Automation testing online training
PDF
Unit testing
PPTX
Agile Testing in Enterprise: Way to transform - SQA Days 2014
PPT
How engineering practices help business
PDF
testmon for Python
PDF
Automated Testing of Web Applications
PPTX
Test Automation Canvas
PPT
icebreakerwithdevops-150218112943-conversion-gate02
ODP
OpenNTF Essentials
PDF
SeleniumCamp 2015 Andrii Soldatenko
PPTX
Team wide testing
PDF
Agile Testing
PPTX
Selenium done right
PDF
Automating The New York Times Crossword by Phil Wells
PDF
User story workflow (eng)
PPTX
Dot all 2019 | Testing with Craft | Giel Tettelar
Improve the deployment process step by step
Why You Should Start Using Docker
Develop 4 Developers
That worked before
QA Automation testing online training
Unit testing
Agile Testing in Enterprise: Way to transform - SQA Days 2014
How engineering practices help business
testmon for Python
Automated Testing of Web Applications
Test Automation Canvas
icebreakerwithdevops-150218112943-conversion-gate02
OpenNTF Essentials
SeleniumCamp 2015 Andrii Soldatenko
Team wide testing
Agile Testing
Selenium done right
Automating The New York Times Crossword by Phil Wells
User story workflow (eng)
Dot all 2019 | Testing with Craft | Giel Tettelar
Ad

Similar to Automated Performance Testing (20)

PDF
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
PDF
Test driven development_continuous_integration
PDF
Yet Another Continuous Integration Story
ODP
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
PDF
Javascript unit testing with QUnit and Sinon
PDF
Introduction to test_driven_development
PDF
Unit testing legacy code
PDF
Good practices for debugging Selenium and Appium tests
PPTX
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
PDF
Test and Behaviour Driven Development (TDD/BDD)
PDF
Metrics by coda hale : to know your app’ health
PDF
Beyond Parallelize and Collect by Holden Karau
PDF
Testing and validating spark programs - Strata SJ 2016
KEY
improving the performance of Rails web Applications
PPTX
Apex code Benchmarking
PPTX
Corporate AGILE & SDLC Best Practices - Part1.pptx
PDF
Gatling Performance Workshop
DOC
Sanjay Sharma
PDF
Writing Tests with the Unity Test Framework
PDF
Unit Testing - The Whys, Whens and Hows
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Test driven development_continuous_integration
Yet Another Continuous Integration Story
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
Javascript unit testing with QUnit and Sinon
Introduction to test_driven_development
Unit testing legacy code
Good practices for debugging Selenium and Appium tests
Beyond unit tests: Deployment and testing for Hadoop/Spark workflows
Test and Behaviour Driven Development (TDD/BDD)
Metrics by coda hale : to know your app’ health
Beyond Parallelize and Collect by Holden Karau
Testing and validating spark programs - Strata SJ 2016
improving the performance of Rails web Applications
Apex code Benchmarking
Corporate AGILE & SDLC Best Practices - Part1.pptx
Gatling Performance Workshop
Sanjay Sharma
Writing Tests with the Unity Test Framework
Unit Testing - The Whys, Whens and Hows
Ad

More from Lars Thorup (13)

PDF
100 tests per second - 40 releases per week
PDF
SQL or NoSQL - how to choose
PDF
Super fast end-to-end-tests
PDF
Advanced Javascript Unit Testing
PDF
Advanced QUnit - Front-End JavaScript Unit Testing
PDF
Database Schema Evolution
PDF
Advanced Jasmine - Front-End JavaScript Unit Testing
PDF
Continuous Integration for front-end JavaScript
PDF
Agile Contracts
PDF
High Performance Software Engineering Teams
PDF
Elephant Carpaccio
PDF
Automated Testing for Embedded Software in C or C++
PDF
Unit Testing in JavaScript with MVC and QUnit
100 tests per second - 40 releases per week
SQL or NoSQL - how to choose
Super fast end-to-end-tests
Advanced Javascript Unit Testing
Advanced QUnit - Front-End JavaScript Unit Testing
Database Schema Evolution
Advanced Jasmine - Front-End JavaScript Unit Testing
Continuous Integration for front-end JavaScript
Agile Contracts
High Performance Software Engineering Teams
Elephant Carpaccio
Automated Testing for Embedded Software in C or C++
Unit Testing in JavaScript with MVC and QUnit

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Machine learning based COVID-19 study performance prediction
PPT
Teaching material agriculture food technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence
Machine learning based COVID-19 study performance prediction
Teaching material agriculture food technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Per capita expenditure prediction using model stacking based on satellite ima...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Reach Out and Touch Someone: Haptics and Empathic Computing
Understanding_Digital_Forensics_Presentation.pptx
Modernizing your data center with Dell and AMD
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Automated Performance Testing

  • 2. Who is Lars Thorup? ● Software developer/architect ● C++, C# and JavaScript ● Test Driven Development ● Coach: Teaching agile and automated testing ● Advisor: Assesses software projects and companies ● Founder and CEO of BestBrains and ZeaLake
  • 3. We want to know when performance drops ● ...or improves :-) ● Examples ● this refactoring means the cache is no longer used for lookups ● introducing this database index on that foreign key is way faster ● Write a test to measure performance var stopwatch = Stopwatch.StartNew(); for (int i = 0; i < 200; ++i) { var url = string.Format("Vote?text={0}", Guid.NewGuid()); var response = client.DownloadString(url); Assert.That(response, Is.True); } stopwatch.Stop(); ● When and how should the test fail?
  • 4. We cannot use assert for this Assert.That(requestsPerSecond, Is.InRange(40, 50)); ● But the resulting time can vary widely ● range too narrow: many false negatives ● range too broad: many false positives
  • 5. Use trend curves instead ● Does not fail automatically :-( ● unless we add automated trend line analysis ● Need manual inspection ● weekly, before every release ● and it takes only 10 seconds ● So the feedback is not fast ● but shows which commit caused the performance issue
  • 6. Demo: TeamCity from JetBrains ● Make the tests output their results stopwatch.Stop(); PerformanceTest.Report(stopwatch.ElapsedMilliseconds); ● In an .xml file <build> <statisticValue key='Voting' value='667'/> <statisticValue key='PerfGetEvent' value='3689'/> </build> ● Configure TeamCity to convert the data to graphs ● Read more here ● http://www.zealake.com/2011/05/19/automated-performance-trends/
  • 7. Demo: Jenkins ● Make the tests output their results in CSV files ● Use the Plot plugin