SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
Let's make this test suite run faster!
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
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
      Ethereal
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
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
Who am I?



        David Gageot

      CTO algodeal.com
      The Crowd Sourced
      Quant Hedge Fund

              @dgageot
            javabien.net

Mais conteúdo relacionado

Mais procurados

Docker security configuration
Docker security configurationDocker security configuration
Docker security configurationJohn Kinsella
 
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
 
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
 

Mais procurados (12)

Docker security configuration
Docker security configurationDocker security configuration
Docker security configuration
 
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
 
Try harder or go home
Try harder or go homeTry harder or go home
Try harder or go home
 
Selenium
SeleniumSelenium
Selenium
 
Http
HttpHttp
Http
 
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)
 
Bsides tampa
Bsides tampaBsides tampa
Bsides tampa
 

Destaque

Let's make this test suite run faster - Paris JUG 2011
Let's make this test suite run faster - Paris JUG 2011Let's make this test suite run faster - Paris JUG 2011
Let's make this test suite run faster - Paris JUG 2011David Gageot
 
Parcours Facilitateur professionnel de dynamiques collaboratives
Parcours Facilitateur professionnel de dynamiques collaborativesParcours Facilitateur professionnel de dynamiques collaboratives
Parcours Facilitateur professionnel de dynamiques collaborativesFormapart
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot FrameworkPekka Klärck
 
Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Frameworklaurent bristiel
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introductionlaurent bristiel
 
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
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'tsPekka Klärck
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework IntroductionPekka Klärck
 

Destaque (11)

Let's make this test suite run faster - Paris JUG 2011
Let's make this test suite run faster - Paris JUG 2011Let's make this test suite run faster - Paris JUG 2011
Let's make this test suite run faster - Paris JUG 2011
 
Parcours Facilitateur professionnel de dynamiques collaboratives
Parcours Facilitateur professionnel de dynamiques collaborativesParcours Facilitateur professionnel de dynamiques collaboratives
Parcours Facilitateur professionnel de dynamiques collaboratives
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Framework
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
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
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 

Semelhante a Let's make this test suite run faster! SoftShake 2010

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
 
Load testing with vs 2013
Load testing with vs 2013Load testing with vs 2013
Load testing with vs 2013Fahad Shiekh
 
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
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahooguestb1b95b
 
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
 
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
 
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
 
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
 
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
 
System hardening - OS and Application
System hardening - OS and ApplicationSystem hardening - OS and Application
System hardening - OS and Applicationedavid2685
 
Gatling - JUGL, 2012-09-13
Gatling  - JUGL, 2012-09-13Gatling  - JUGL, 2012-09-13
Gatling - JUGL, 2012-09-13Nicolas Rémond
 
2012 04-19 theory-of_operation
2012 04-19 theory-of_operation2012 04-19 theory-of_operation
2012 04-19 theory-of_operationbobwolff68
 
Node.js Community Benchmarking WG update
Node.js Community  Benchmarking WG updateNode.js Community  Benchmarking WG update
Node.js Community Benchmarking WG updateMichael Dawson
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETBen Hall
 

Semelhante a Let's make this test suite run faster! SoftShake 2010 (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
 
Load testing with vs 2013
Load testing with vs 2013Load testing with vs 2013
Load testing with vs 2013
 
Agility Requires Safety
Agility Requires SafetyAgility Requires Safety
Agility Requires Safety
 
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
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahoo
 
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...
 
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,...
 
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
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
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
 
System hardening - OS and Application
System hardening - OS and ApplicationSystem hardening - OS and Application
System hardening - OS and Application
 
Concurrency patterns
Concurrency patternsConcurrency patterns
Concurrency patterns
 
Testing w-mocks
Testing w-mocksTesting w-mocks
Testing w-mocks
 
Gatling - JUGL, 2012-09-13
Gatling  - JUGL, 2012-09-13Gatling  - JUGL, 2012-09-13
Gatling - JUGL, 2012-09-13
 
SQL Server On SANs
SQL Server On SANsSQL Server On SANs
SQL Server On SANs
 
2012 04-19 theory-of_operation
2012 04-19 theory-of_operation2012 04-19 theory-of_operation
2012 04-19 theory-of_operation
 
Node.js Community Benchmarking WG update
Node.js Community  Benchmarking WG updateNode.js Community  Benchmarking WG update
Node.js Community Benchmarking WG update
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 

Último

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Último (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Let's make this test suite run faster! SoftShake 2010

  • 1. Let's make this test suite run faster!
  • 2. Let's make this test suite run faster! Why? What for ? http://farm1.static.flickr.com/158/349497988_fb751a5e3a_z.jpg
  • 3. You test early and often Don’t you? http://farm1.static.flickr.com/97/246816211_573c2901e1_z.jpg?zz=1
  • 4. Continuous integration, continuous testing... ...even continuous deployment http://vator.tv/images/attachments/150609195630ctd.gif
  • 5. Testing often Often means waiting a lot http://farm3.static.flickr.com/2505/3772118924_11fe195ef1.jpg
  • 6. Your coding room doesn’t have to look like this What for ? http://upload.wikimedia.org/wikipedia/commons/3/3f/ Nespresso_boutique.JPG
  • 7. Tests can be fast Even if lines of code keep growing
  • 8. Easy! Let’s distribute across multiple hudson servers
  • 9. It doesn’t have to be complicated I’ll share a few simple tricks
  • 10. It can make your product better Simple to test, means simple to write, deploy and USE Photo: http://www.flickr.com/photos/zoutedrop/2317065892/
  • 11. How can we accelerate the tests? The Cheater The Lazy The Brave http://all-the-movies.cowblog.fr/images/arton1122.jpg
  • 12. The Cheater The Lazy The Brave http://all-the-movies.cowblog.fr/images/arton1122.jpg
  • 13. Buy a faster machine Tests are cpu/memory bound http://farm1.static.flickr.com/28/93569705_1c562b413a_z.jpg?zz=1
  • 14. 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
  • 15. Use all the cores parallel build with maven3 mvn -T1 clean install : 5:05s mvn -T4 clean install : 3:10s
  • 16. Use all the cores parallel build with maven3
  • 17. Use all the cores For JUnit/TestNG tests .
  • 18. The Cheater The Lazy The Brave http://all-the-movies.cowblog.fr/images/arton1122.jpg
  • 19. Delete redundant tests It’s so simple, we don’t do it... http://geekandpoke.typepad.com/geekandpoke/images/2008/04/24/ turingtest.jpg
  • 20. Even better, delete dead code To delete yet other useless tests http://farm1.static.flickr.com/58/191393602_3d9b643ab0_z.jpg
  • 21. Work in a sandbox The network is too slow In-memory database: H2 Behaves more like MySql than Hsqldb
  • 22. It’s Not only SQL If going with NoSQL, take a server that can run in-process eg. Voldemort
  • 24. Everything local and in-memory Files Apache VFS (Virtual File System) Spring Resource... As a bonus, tests will run smoother .
  • 25. The Cheater The Lazy The Brave http://all-the-movies.cowblog.fr/images/arton1122.jpg
  • 26. 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
  • 27. 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
  • 28. 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
  • 29. Or mock the slowest layers eg. functional test with Spring and Mockito
  • 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. Who am I? David Gageot CTO algodeal.com The Crowd Sourced Quant Hedge Fund @dgageot javabien.net