SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Let's make this test suite run faster!




Paris Java User Group
www.parisjug.org
Copyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique
Let's make this test suite run faster!
               Why?




             What for ?




                                  http://farm1.static.flickr.com/158/349497988_fb751a5e3a_z.jpg
You test early and often
      Don’t you?




                           http://farm1.static.flickr.com/97/246816211_573c2901e1_z.jpg?zz=1
Continuous integration, continuous testing...
      ...even continuous deployment




                                      http://vator.tv/images/attachments/150609195630ctd.gif
Testing often
Often means waiting a lot




                            http://farm3.static.flickr.com/2505/3772118924_11fe195ef1.jpg
Your coding room doesn’t have to look like this




                  What for ?




                                        http://upload.wikimedia.org/wikipedia/commons/3/3f/
                                                                     Nespresso_boutique.JPG
Tests can be fast
Even if lines of code keep growing
Easy!
Let’s distribute across multiple hudson servers
It doesn’t have to be complicated
    I’ll share a few simple tricks
It can make your product better
Simple to test, means simple to write, deploy and USE




                                         Photo: http://www.flickr.com/photos/zoutedrop/2317065892/
How can we accelerate the tests?



     The Cheater
     The Lazy
     The Brave




                                   http://all-the-movies.cowblog.fr/images/arton1122.jpg
The Cheater
The Lazy
The Brave




              http://all-the-movies.cowblog.fr/images/arton1122.jpg
Buy a faster machine
Tests are cpu/memory bound




                         http://farm1.static.flickr.com/28/93569705_1c562b413a_z.jpg?zz=1
Be warned
Single threaded tests get slower over time


    100

     75

     50

     25

      0
          2007   2008   2009   2010




                                      http://farm5.static.flickr.com/4096/4819945812_735744e0fc_z.jpg
Use all the cores
parallel build with maven3




mvn -T1 clean install : 5:05s
mvn -T4 clean install : 3:10s
Use all the cores
parallel build with maven3
Use all the cores
Surefire 2.7.1 For JUnit/TestNG tests




                                       .
The Cheater
The Lazy
The Brave




              http://all-the-movies.cowblog.fr/images/arton1122.jpg
Delete redundant tests
It’s so simple, we don’t do it...




                               http://geekandpoke.typepad.com/geekandpoke/images/2008/04/24/
                                                                                turingtest.jpg
Even better, delete dead code
To delete yet other useless tests




                                http://farm1.static.flickr.com/58/191393602_3d9b643ab0_z.jpg
Work in a sandbox
       The network is too slow


     In-memory database: H2




Behaves more like MySql than Hsqldb
It’s Not only SQL




If going with NoSQL, take a server that
          can run in-process

            eg. Voldemort
In-memory SMTP Server
    SubEtha SMTP
Everything local and in-memory
              Files




Apache VFS (Virtual File System)
      Spring Resource...




                    As a bonus, tests will
                    run smoother
                                             .
The Cheater
The Lazy
The Brave




              http://all-the-movies.cowblog.fr/images/arton1122.jpg
Don’t test business rules in integration tests
      Unit tests is often a better place




                                        http://upload.wikimedia.org/wikipedia/commons/b/bd/
                                                              Contortionist_Ravi_standing.jpg
Don’t test business rules in integration tests
      Unit tests is often a better place
                     Functional test
                    (on a web page)
                          10s




                                             Unit test
                                              0.01s
Take the longer integration test
Break it in one faster integration test
    and a lot of small unit tests




                                   http://farm2.static.flickr.com/1168/3166709586_96f9a3fd95.jpg
Or mock the slowest layers
eg. functional test with Spring and Mockito




                                        Mocks are
                                        not just for
                                         unit tests
Don’t test through the browser
  Selenium is often overkill

                 «But my application is
                      complex!»

               «My users want complex
                      features,
                My users want Ajax»

                 «I need to test browser
                     compatibility!»


                              Photo: http://www.flickr.com/photos/zoutedrop/2317065892/
Really ?




           http://i.zdnet.com/blogs/complexity-and-false-hope.jpg
Complexity has a cost
That you pay each time a test runs




                             http://thehongkongfixereng.files.wordpress.com/2008/07/couteau-suisse.jpg
Test through the browser the strict minimal
     Use javascript unit tests for the rest




                                   http://farm2.static.flickr.com/1168/3166709586_96f9a3fd95.jpg
I tend to be old school
And write server-side code most of the time




                                     http://www.celebridiot.com/wp-content/uploads/2009/06/
                                                                  rick_astley_death_hoax.jpg
One more thing...




Simplify and optimize your code

      Tests will run faster




                                  .
Thank you
   Q/A
www.parisjug.org
Copyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique

Weitere ähnliche Inhalte

Was ist angesagt?

Django strategy-test
Django strategy-testDjango strategy-test
Django strategy-testRoyce Haynes
 
Try harder or go home
Try harder or go homeTry harder or go home
Try harder or go homejaredhaight
 
Advanced Jasmine
Advanced JasmineAdvanced Jasmine
Advanced Jasminejbellsey
 
Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)
Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)
Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)brian d foy
 
How the JDeveloper team test JDeveloper at UKOUG'08
How the JDeveloper team test JDeveloper at UKOUG'08How the JDeveloper team test JDeveloper at UKOUG'08
How the JDeveloper team test JDeveloper at UKOUG'08kingsfleet
 
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in DjangoDjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in DjangoCasey Kinsey
 
Managing Modules Without Going Crazy (NPW 2007)
Managing Modules Without Going Crazy (NPW 2007)Managing Modules Without Going Crazy (NPW 2007)
Managing Modules Without Going Crazy (NPW 2007)brian d foy
 

Was ist angesagt? (11)

Django strategy-test
Django strategy-testDjango strategy-test
Django strategy-test
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
Http
HttpHttp
Http
 
Try harder or go home
Try harder or go homeTry harder or go home
Try harder or go home
 
Selenium
SeleniumSelenium
Selenium
 
Advanced Jasmine
Advanced JasmineAdvanced Jasmine
Advanced Jasmine
 
Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)
Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)
Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)
 
Os Ramirez
Os RamirezOs Ramirez
Os Ramirez
 
How the JDeveloper team test JDeveloper at UKOUG'08
How the JDeveloper team test JDeveloper at UKOUG'08How the JDeveloper team test JDeveloper at UKOUG'08
How the JDeveloper team test JDeveloper at UKOUG'08
 
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in DjangoDjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
 
Managing Modules Without Going Crazy (NPW 2007)
Managing Modules Without Going Crazy (NPW 2007)Managing Modules Without Going Crazy (NPW 2007)
Managing Modules Without Going Crazy (NPW 2007)
 

Andere mochten auch

Let's make this test suite run faster! SoftShake 2010
Let's make this test suite run faster! SoftShake 2010Let's make this test suite run faster! SoftShake 2010
Let's make this test suite run faster! SoftShake 2010David Gageot
 
Parcours Facilitateur professionnel de dynamiques collaboratives
Parcours Facilitateur professionnel de dynamiques collaborativesParcours Facilitateur professionnel de dynamiques collaboratives
Parcours Facilitateur professionnel de dynamiques collaborativesFormapart
 
Git Tours JUG 2010
Git Tours JUG 2010Git Tours JUG 2010
Git Tours JUG 2010David Gageot
 
Git Agile France 2010
Git Agile France 2010Git Agile France 2010
Git Agile France 2010David Gageot
 
Le Facilitateur, un role encore meconnu
Le Facilitateur, un role encore meconnuLe Facilitateur, un role encore meconnu
Le Facilitateur, un role encore meconnuDavid Gageot
 

Andere mochten auch (6)

Let's make this test suite run faster! SoftShake 2010
Let's make this test suite run faster! SoftShake 2010Let's make this test suite run faster! SoftShake 2010
Let's make this test suite run faster! SoftShake 2010
 
Parcours Facilitateur professionnel de dynamiques collaboratives
Parcours Facilitateur professionnel de dynamiques collaborativesParcours Facilitateur professionnel de dynamiques collaboratives
Parcours Facilitateur professionnel de dynamiques collaboratives
 
Git USI 2010
Git USI 2010Git USI 2010
Git USI 2010
 
Git Tours JUG 2010
Git Tours JUG 2010Git Tours JUG 2010
Git Tours JUG 2010
 
Git Agile France 2010
Git Agile France 2010Git Agile France 2010
Git Agile France 2010
 
Le Facilitateur, un role encore meconnu
Le Facilitateur, un role encore meconnuLe Facilitateur, un role encore meconnu
Le Facilitateur, un role encore meconnu
 

Ähnlich wie Let's make this test suite run faster - Paris JUG 2011

Comment j'ai mis ma suite de tests au régime en 5 minutes par jour
Comment j'ai mis ma suite de tests au régime en 5 minutes par jourComment j'ai mis ma suite de tests au régime en 5 minutes par jour
Comment j'ai mis ma suite de tests au régime en 5 minutes par jourCARA_Lyon
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in DjangoKevin Harvey
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahooguestb1b95b
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyondmguillem
 
Distributed Systems at Scale: Reducing the Fail
Distributed Systems at Scale:  Reducing the FailDistributed Systems at Scale:  Reducing the Fail
Distributed Systems at Scale: Reducing the FailKim Moir
 
Load testing with vs 2013
Load testing with vs 2013Load testing with vs 2013
Load testing with vs 2013Fahad Shiekh
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsLuís Bastião Silva
 
2012 04-19 theory-of_operation
2012 04-19 theory-of_operation2012 04-19 theory-of_operation
2012 04-19 theory-of_operationbobwolff68
 
Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012slandelle
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox testsKevin Beeman
 
Gatling - JUGL, 2012-09-13
Gatling  - JUGL, 2012-09-13Gatling  - JUGL, 2012-09-13
Gatling - JUGL, 2012-09-13Nicolas Rémond
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Ondřej Machulda
 
Joomla! Day Poland 2012 - Active Security for Joomla! sites
Joomla! Day Poland 2012 - Active Security for Joomla! sitesJoomla! Day Poland 2012 - Active Security for Joomla! sites
Joomla! Day Poland 2012 - Active Security for Joomla! sitesNicholas Dionysopoulos
 
Framework and Application Benchmarking
Framework and Application BenchmarkingFramework and Application Benchmarking
Framework and Application BenchmarkingPaul Jones
 
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...Cωνσtantίnoς Giannoulis
 
Performance - a challenging craft
Performance  - a challenging craftPerformance  - a challenging craft
Performance - a challenging craftFabian Lange
 
Stop Being Lazy and Test Your Software
Stop Being Lazy and Test Your SoftwareStop Being Lazy and Test Your Software
Stop Being Lazy and Test Your SoftwareLaura Frank Tacho
 

Ähnlich wie Let's make this test suite run faster - Paris JUG 2011 (20)

Comment j'ai mis ma suite de tests au régime en 5 minutes par jour
Comment j'ai mis ma suite de tests au régime en 5 minutes par jourComment j'ai mis ma suite de tests au régime en 5 minutes par jour
Comment j'ai mis ma suite de tests au régime en 5 minutes par jour
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
 
Agility Requires Safety
Agility Requires SafetyAgility Requires Safety
Agility Requires Safety
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahoo
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
 
Distributed Systems at Scale: Reducing the Fail
Distributed Systems at Scale:  Reducing the FailDistributed Systems at Scale:  Reducing the Fail
Distributed Systems at Scale: Reducing the Fail
 
Load testing with vs 2013
Load testing with vs 2013Load testing with vs 2013
Load testing with vs 2013
 
Testing w-mocks
Testing w-mocksTesting w-mocks
Testing w-mocks
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
2012 04-19 theory-of_operation
2012 04-19 theory-of_operation2012 04-19 theory-of_operation
2012 04-19 theory-of_operation
 
Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox tests
 
Gatling - JUGL, 2012-09-13
Gatling  - JUGL, 2012-09-13Gatling  - JUGL, 2012-09-13
Gatling - JUGL, 2012-09-13
 
Concurrency patterns
Concurrency patternsConcurrency patterns
Concurrency patterns
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
 
Joomla! Day Poland 2012 - Active Security for Joomla! sites
Joomla! Day Poland 2012 - Active Security for Joomla! sitesJoomla! Day Poland 2012 - Active Security for Joomla! sites
Joomla! Day Poland 2012 - Active Security for Joomla! sites
 
Framework and Application Benchmarking
Framework and Application BenchmarkingFramework and Application Benchmarking
Framework and Application Benchmarking
 
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
 
Performance - a challenging craft
Performance  - a challenging craftPerformance  - a challenging craft
Performance - a challenging craft
 
Stop Being Lazy and Test Your Software
Stop Being Lazy and Test Your SoftwareStop Being Lazy and Test Your Software
Stop Being Lazy and Test Your Software
 

Kürzlich hochgeladen

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Kürzlich hochgeladen (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Let's make this test suite run faster - Paris JUG 2011

  • 1. Let's make this test suite run faster! Paris Java User Group
  • 2. www.parisjug.org Copyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique
  • 3. Let's make this test suite run faster! Why? What for ? http://farm1.static.flickr.com/158/349497988_fb751a5e3a_z.jpg
  • 4. You test early and often Don’t you? http://farm1.static.flickr.com/97/246816211_573c2901e1_z.jpg?zz=1
  • 5. Continuous integration, continuous testing... ...even continuous deployment http://vator.tv/images/attachments/150609195630ctd.gif
  • 6. Testing often Often means waiting a lot http://farm3.static.flickr.com/2505/3772118924_11fe195ef1.jpg
  • 7. Your coding room doesn’t have to look like this What for ? http://upload.wikimedia.org/wikipedia/commons/3/3f/ Nespresso_boutique.JPG
  • 8. Tests can be fast Even if lines of code keep growing
  • 9. Easy! Let’s distribute across multiple hudson servers
  • 10. It doesn’t have to be complicated I’ll share a few simple tricks
  • 11. It can make your product better Simple to test, means simple to write, deploy and USE Photo: http://www.flickr.com/photos/zoutedrop/2317065892/
  • 12. How can we accelerate the tests? The Cheater The Lazy The Brave http://all-the-movies.cowblog.fr/images/arton1122.jpg
  • 13. The Cheater The Lazy The Brave http://all-the-movies.cowblog.fr/images/arton1122.jpg
  • 14. Buy a faster machine Tests are cpu/memory bound http://farm1.static.flickr.com/28/93569705_1c562b413a_z.jpg?zz=1
  • 15. Be warned Single threaded tests get slower over time 100 75 50 25 0 2007 2008 2009 2010 http://farm5.static.flickr.com/4096/4819945812_735744e0fc_z.jpg
  • 16. Use all the cores parallel build with maven3 mvn -T1 clean install : 5:05s mvn -T4 clean install : 3:10s
  • 17. Use all the cores parallel build with maven3
  • 18. Use all the cores Surefire 2.7.1 For JUnit/TestNG tests .
  • 19. The Cheater The Lazy The Brave http://all-the-movies.cowblog.fr/images/arton1122.jpg
  • 20. Delete redundant tests It’s so simple, we don’t do it... http://geekandpoke.typepad.com/geekandpoke/images/2008/04/24/ turingtest.jpg
  • 21. Even better, delete dead code To delete yet other useless tests http://farm1.static.flickr.com/58/191393602_3d9b643ab0_z.jpg
  • 22. Work in a sandbox The network is too slow In-memory database: H2 Behaves more like MySql than Hsqldb
  • 23. It’s Not only SQL If going with NoSQL, take a server that can run in-process eg. Voldemort
  • 24. In-memory SMTP Server SubEtha SMTP
  • 25. Everything local and in-memory Files Apache VFS (Virtual File System) Spring Resource... As a bonus, tests will run smoother .
  • 26. The Cheater The Lazy The Brave http://all-the-movies.cowblog.fr/images/arton1122.jpg
  • 27. Don’t test business rules in integration tests Unit tests is often a better place http://upload.wikimedia.org/wikipedia/commons/b/bd/ Contortionist_Ravi_standing.jpg
  • 28. Don’t test business rules in integration tests Unit tests is often a better place Functional test (on a web page) 10s Unit test 0.01s
  • 29. Take the longer integration test Break it in one faster integration test and a lot of small unit tests http://farm2.static.flickr.com/1168/3166709586_96f9a3fd95.jpg
  • 30. Or mock the slowest layers eg. functional test with Spring and Mockito Mocks are not just for unit tests
  • 31. Don’t test through the browser Selenium is often overkill «But my application is complex!» «My users want complex features, My users want Ajax» «I need to test browser compatibility!» Photo: http://www.flickr.com/photos/zoutedrop/2317065892/
  • 32. Really ? http://i.zdnet.com/blogs/complexity-and-false-hope.jpg
  • 33. Complexity has a cost That you pay each time a test runs http://thehongkongfixereng.files.wordpress.com/2008/07/couteau-suisse.jpg
  • 34. Test through the browser the strict minimal Use javascript unit tests for the rest http://farm2.static.flickr.com/1168/3166709586_96f9a3fd95.jpg
  • 35. I tend to be old school And write server-side code most of the time http://www.celebridiot.com/wp-content/uploads/2009/06/ rick_astley_death_hoax.jpg
  • 36. One more thing... Simplify and optimize your code Tests will run faster .
  • 37. Thank you Q/A
  • 38. www.parisjug.org Copyright(c) 2010 Paris JUG, Licence CC-Creatives Commons 2.0 France - Paternité - Pas d’utilisation commerciale - Partage des Conditions à l’identique