SlideShare a Scribd company logo
1 of 62
Warming up to  modular testing ,[object Object],[object Object]
Who is this guy ,[object Object],[object Object],[object Object]
What we'll cover ,[object Object],[object Object],[object Object],[object Object]
The Harness
Harness to run the show ,[object Object],[object Object],[object Object]
./bin/micro_test ,[object Object],[object Object],[object Object]
./bin/micro_test ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
TAP::Harness can ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Common test functions
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Arcos::Test
[object Object],[object Object],[object Object],Arcos::Test  Convenience Methods
[object Object],[object Object],[object Object],[object Object],[object Object],Arcos::Test  Affecting the Environment
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Arcos::Test  Checking the Environment
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Arcos::Test  Checking the Environment
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Arcos::Test  Checking the Environment
Test::Class
[object Object],Test::Class  Method Attributes  Test(4)
[object Object],[object Object],Test::Class  Method Attributes  Test(4)
[object Object],[object Object],[object Object],Test::Class  Method Attributes  Test(4)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Test::Class  Method Attributes  Test(4)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Test::Class  Method Attributes  Test(no_plan)
[object Object],[object Object],Test::Class  Method Attributes  Test(startup)
[object Object],[object Object],[object Object],[object Object],Test::Class  Method Attributes  Test(startup)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Test::Class  Method Attributes  Test(startup)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Test::Class  Method Attributes  Test(startup)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Test::Class  Method Attributes  Test(startup)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Test::Class  Method Attributes  Test(startup)
Inheritance in your tests
[object Object],Arcos::Test::Class
[object Object],[object Object],Arcos::Test::Class
[object Object],[object Object],Arcos::Test::Class
[object Object],[object Object],[object Object],[object Object],Arcos::Test::Class
[object Object],[object Object],[object Object],[object Object],[object Object],Arcos::Test::Class
Arcos::Test::Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arcos::Test::Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Inherited Forms, with Inherited Tests ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arcos::Form::Test the parent ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
An example of inherited tests ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Inheritance Example
We still have .t files  t/register_form.t ,[object Object]
We still have .t files  t/contact_official_form.t ,[object Object],[object Object],[object Object],[object Object],[object Object]
We still have .t files  t/contact_official_form.t ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
We still have .t files  t/contact_official_form.t ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
We still have .t files  t/contact_official_form.t ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
return to skip ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
plan to skip ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
TEST_METHOD ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
TEST_METHOD ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
a lot of reuse ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bonus slides
TODO tests ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
pausing to look around ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
calling plan from Arcos::Test ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Additional Resources
Additional Resources ,[object Object],[object Object],[object Object],[object Object],[object Object]
Thank you for your time!

More Related Content

Recently uploaded

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Warming up to Modular Testing (YAPC::NA::2009)

Editor's Notes

  1. grab a list of .t files then create a TAP::Harness object now have the harness run the tests
  2. the harness object can take arguments in new(). can try with verbose -- ok for every passing test.   The merge option on new merges STDOUT and STDERR -- this is most useful when using TAP::Harness::Archive -- you know, for submitting to a Smolder server.
  3. We do some setup in our harness before we get to running any test code. If ARCOS_ROOT isn't set, calculate it from harness path. We modify the PERL5LIB to add our application lib. Try loading Arcos module and bail if cannot.
  4. We do some setup in our harness before we get to running any test code. If ARCOS_ROOT isn't set, calculate it from harness path. We modify the PERL5LIB to add our application lib. Try loading Arcos module and bail if cannot.
  5. We do some setup in our harness before we get to running any test code. If ARCOS_ROOT isn't set, calculate it from harness path. We modify the PERL5LIB to add our application lib. Try loading Arcos module and bail if cannot.
  6. Go ahead and add more BEGIN blocks Our code also needs pointed to an instance (any instance) within our configuration. Pick the first one if none is already set.
  7. Arcos sets a version string. This Arcos Script will see if we're running as the right system user and become them with calls to setuid() and setgid() We do more here, but that's beyond the scope of this talk.
  8. You've all seen Getopt::Long's GetOptions() We use it to pull in command line parameters to our harness. There are a handful more than are listed here database passwords a test_pollution flag
  9. “ try” -- Colorized results depends on terminal support. if your tests can be run in parallel without interfering with one another, TAP::Harness can handle it.
  10. Spread is only part of what island_mode.t exercises, so skip instead of skip_all
  11. Here is a sample showing the individual test assertions you're used to seeing : ok, like, etc. We capture the stdout and stderr with a backticks execute and check the results. We use some of the data to pull a job from the database, retrieve the associated contribution, and check its contact information.
  12. open_handler.t tests that we properly handle the image requests from end users opening emails. no_plan is still a plan. If apache is not running, none of this test is going to be useful. so we skip_all.
  13. .
  14. .
  15. use base 'Test::Class'; json_success and json_failure are calls to json_contains('success') and json_lacks('success) respectively.
  16. Here we can see the common definition of methods that will be shared by the children.   x_create_form has the Test(startup) attribute, so it will be run before the regular test methods.  The 3 parameter notes how many tests are within that method. The form_db_class() method is used in the x_create_form() call to setup the form before the tests begin.  Here it is empty string, the children must override with a proper value. ContactOfficial forms need some additional elements, but Register forms do not.
  17. Because it is inherited, the tc_startup method can be completely overridden, or merely augmented if the call to SUPER is included.
  18. This script performs a couple checks before calling runtests. These are common across many of our tests and are defined in Arcos::Test. needs_running_apache checks if apache is running and attempts to start it if not. If apache cannot be started, the test would skip with the following code: Test::More::plan(skip_all => 'Could not start Arcos Apache/mod_perl server');
  19. We also stop our Arcos job queue daemon for this test. We want to be able to inspect jobs as they're inserted into the queue, before they're processed.
  20. Now we restart the queue so that it functions normally for other tests.
  21. While developing tests it may be convenient to go ahead and skip particular test methods.     Calls to return() will be interpreted as a skip.     A string can be passed to provide a reason for skipping the rest of that method.
  22. In run scripts it's often best to just skip the whole module worth of tests if some conditions do not exist. ContributionTestMode is imported from Arcos::Conf Do add descriptive instructions to your messages, if you're doing something unusual in part of your tests.
  23. This environment variable can save you time while developing your tests.   Its value restricts which of the subroutines with the Test attribute are run. The startup and shutdown subroutines are still going to be called. In a large file with many tests, this can help you iterate quickly when making and checking modifications to specific subroutines.
  24. You can treat it as a string, but it is a regex and can perform more complicated matching. Here we're running any Test methods that either start with a_ or with b_ in their names. (possibly show how often I use it: “ history | grep TEST_METHOD”)
  25. Many of our report modules have a common ancestor in Arcos::Report::SiteEvents These reports all provide Listing of forms, Downloading CSV data, It was only natural to use inheritance to gain some reuse in the testing code too.  
  26. We don't do much with marking tests as TODO in our suite. Here is how you can.
  27. Lots of our tests are interacting with the web interface of Arcos. Often it is nice to get a failing test to stop for a bit before cleaning up and removing all of the evidence during shutdown. I find myself adding this little fragment all the time. Put the pause code in your shutdown method if you want to be able to use it with any routine you're putting into TEST_METHOD. Examples: * a new column is added to a listing screen. * the test isn't including a timestamp into the form names, and is choking because the database hasn't been cleared between runs.
  28. Our run scripts make use of some reused routines in Arcos::Test.  needs_run_daily is one of those cases. Be nice and put the instructions into the skip messages for running the conditional parts of your unusual tests.   The external vendor had a limitation on the number of requests they could receive before an over-limit error was returned. We didn't want these tests running on each developers laptops even once daily. We wanted these tests to run a maximum of once daily in our automated test environment.
  29. My resource for learning this material was an existing codebase. Hopefully these other resources will be helpful to you.