SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Testing in Drupal
        An Introduction
Who Am I?

Simon Roberts
IT Consultant,
Taniwha Solutions
Using PHP since ~1996
Using Drupal since 2005
http://drupal.org/user/33667


First used SimpleTest at Drupalcon Szeged
Testing Sprint
Who Am I?

Before the Drupalcon, I’d only had the
most casual of looks at Testing in Drupal
Have used JUnit etc previously
Was able to provide useful tests to
Drupal Core inside a couple of hours!!
You can too!
What was SimpleTest?


PHP Testing Framework
Integrated as a contributed module in
D5 + D6
Integrated in core for Drupal 7 (sortof)
Implements Automated Testing
Why Automated Testing?

Define exactly what the code should do
  Easier development
  Easier to refactor code
  Less debugging
  Less mistakes
  More fun!!
Why Automated Testing?


  Document Bugs
$xss = '<script>alert(quot;xssquot;)</script>';
$edit = array(
  'title' => $xss,
);
$node = $this->drupalCreateNode($edit);
$this->drupalGet('node/' . $node->nid . '/edit');
$this->assertNoRaw($xss, t('Harmful tags are escaped.'));
Why Automated Testing?


Document Bugs
  Prevent regressions
  Quality Assurance
  Better Software
Safety net!
Why Automated Testing?

Once a test is written, it will likely be
run many many times
Every time it is run, it verifies that the
code is still working
If it catches even one bug, it has “paid
for itself” - High value
Can be used to help reproduce problems
Testing in Drupal Core
Dries (and Drupal!) has made Testing a high priority
for Drupal 7
http://buytaert.net/drupal-7-timeline
                                                                            The actual Drupal 6 Timeline

Effective Test coverage allows us to compress the “fix”
phase of a Drupal release (code freeze)




            The Drupal 7 timeline assuming that we fully embrace testing.


Note: These dates are going to be delayed anyway - slower migration to Drupal 6
             than expected (eg: CCK, Views, Panels. drupal.org)
Not just for Drupal Core!
so... how does it work?

.test files
    Contain test classes
    Test classes extend the SimpleTest class
        well, not exactly
    Use Helper methods to:
        Simulate user actions
        Check behavior
No, really... how does it work?




 Let me show you...
What’s Left To Do?

Outstanding Testing Issues
http://drupal.org/project/issues?
projects=3060&versions=156281&components=simpletest.module,tests


“We currently have 38 tests taken out of
43 for a test coverage of 88%. This will
change when the misnamed tests are
merged.” http://groups.drupal.org/node/9408
References

Webchick’s presentation “Testing Part 1: Intro to
Testing” (Szeged Drupalcon)
http://drupal.org/simpletest
http://groups.drupal.org/testing-qa
   One SimpleTest template to rule them all
   http://groups.drupal.org/node/7731
   Drupal testing patterns
   http://groups.drupal.org/node/15190

Mais conteúdo relacionado

Mais procurados

Continuous delivery - tools and techniques
Continuous delivery - tools and techniquesContinuous delivery - tools and techniques
Continuous delivery - tools and techniquesMike McGarr
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalPhilip Norton
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Eugenio Minardi
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIwajrcs
 
Drupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - DeployDrupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - DeployJohn Smith
 
Capybara testing
Capybara testingCapybara testing
Capybara testingFutureworkz
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ CodeceptionTudor Barbu
 
Test driven development_continuous_integration
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integrationhaochenglee
 
DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學謝 宗穎
 
Drupalcamp Simpletest
Drupalcamp SimpletestDrupalcamp Simpletest
Drupalcamp Simpletestlyricnz
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable productJulian Simpson
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamJoe Ferguson
 
Principles and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyPrinciples and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyMike Brittain
 
PHPUnit with CakePHP and Yii
PHPUnit with CakePHP and YiiPHPUnit with CakePHP and Yii
PHPUnit with CakePHP and Yiimadhavi Ghadge
 
Composer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementComposer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementJoe Ferguson
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8nagpalprachi
 
Put an end to regression with codeception testing
Put an end to regression with codeception testingPut an end to regression with codeception testing
Put an end to regression with codeception testingJoe Ferguson
 
Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Shivam Bharadwaj
 

Mais procurados (20)

Continuous delivery - tools and techniques
Continuous delivery - tools and techniquesContinuous delivery - tools and techniques
Continuous delivery - tools and techniques
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And Drupal
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)
 
Integration testing - A&BP CC
Integration testing - A&BP CCIntegration testing - A&BP CC
Integration testing - A&BP CC
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CI
 
Drupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - DeployDrupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - Deploy
 
Capybara testing
Capybara testingCapybara testing
Capybara testing
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ Codeception
 
Test driven development_continuous_integration
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integration
 
DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學
 
Drupalcamp Simpletest
Drupalcamp SimpletestDrupalcamp Simpletest
Drupalcamp Simpletest
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
 
Selenium
SeleniumSelenium
Selenium
 
Principles and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyPrinciples and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at Etsy
 
PHPUnit with CakePHP and Yii
PHPUnit with CakePHP and YiiPHPUnit with CakePHP and Yii
PHPUnit with CakePHP and Yii
 
Composer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementComposer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency Management
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
 
Put an end to regression with codeception testing
Put an end to regression with codeception testingPut an end to regression with codeception testing
Put an end to regression with codeception testing
 
Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?
 

Semelhante a Testing In Drupal

Simple test drupal7_presentation_la_drupal_jul21-2010
Simple test drupal7_presentation_la_drupal_jul21-2010Simple test drupal7_presentation_la_drupal_jul21-2010
Simple test drupal7_presentation_la_drupal_jul21-2010Miguel Hernandez
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowPhilip Norton
 
Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Joel Farris
 
2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratiehcderaad
 
Hadoop testing workshop - july 2013
Hadoop testing workshop - july 2013Hadoop testing workshop - july 2013
Hadoop testing workshop - july 2013Ophir Cohen
 
Automated php unit testing in drupal 8
Automated php unit testing in drupal 8Automated php unit testing in drupal 8
Automated php unit testing in drupal 8Jay Friendly
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios
 
Automated testing in Drupal
Automated testing in DrupalAutomated testing in Drupal
Automated testing in DrupalArtem Berdishev
 
30 days or less: New Features to Production
30 days or less: New Features to Production30 days or less: New Features to Production
30 days or less: New Features to ProductionKarthik Gaekwad
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Max De Marzi
 
Testing practicies not only in scala
Testing practicies not only in scalaTesting practicies not only in scala
Testing practicies not only in scalaPaweł Panasewicz
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal infoSynapseindiappsdevelopment
 
Test Driven Development with Sql Server
Test Driven Development with Sql ServerTest Driven Development with Sql Server
Test Driven Development with Sql ServerDavid P. Moore
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development IntroductionNguyen Hai
 
Simpletest - A beginners guide
Simpletest - A beginners guideSimpletest - A beginners guide
Simpletest - A beginners guideEd Conolly
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroSteven Pignataro
 

Semelhante a Testing In Drupal (20)

Simple test drupal7_presentation_la_drupal_jul21-2010
Simple test drupal7_presentation_la_drupal_jul21-2010Simple test drupal7_presentation_la_drupal_jul21-2010
Simple test drupal7_presentation_la_drupal_jul21-2010
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To Swallow
 
Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!
 
2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie
 
Hadoop testing workshop - july 2013
Hadoop testing workshop - july 2013Hadoop testing workshop - july 2013
Hadoop testing workshop - july 2013
 
Automated php unit testing in drupal 8
Automated php unit testing in drupal 8Automated php unit testing in drupal 8
Automated php unit testing in drupal 8
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
 
Automated testing in Drupal
Automated testing in DrupalAutomated testing in Drupal
Automated testing in Drupal
 
30 days or less: New Features to Production
30 days or less: New Features to Production30 days or less: New Features to Production
30 days or less: New Features to Production
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1
 
Testing practicies not only in scala
Testing practicies not only in scalaTesting practicies not only in scala
Testing practicies not only in scala
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
Hacking core
Hacking coreHacking core
Hacking core
 
Python and test
Python and testPython and test
Python and test
 
Test Driven Development with Sql Server
Test Driven Development with Sql ServerTest Driven Development with Sql Server
Test Driven Development with Sql Server
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development Introduction
 
Simpletest - A beginners guide
Simpletest - A beginners guideSimpletest - A beginners guide
Simpletest - A beginners guide
 
AvenDATA and Devops
AvenDATA and DevopsAvenDATA and Devops
AvenDATA and Devops
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
Testing 101
Testing 101Testing 101
Testing 101
 

Mais de Ryan Cross

Introduction to Content Marketing Strategy for Drupal
Introduction to Content Marketing Strategy for Drupal Introduction to Content Marketing Strategy for Drupal
Introduction to Content Marketing Strategy for Drupal Ryan Cross
 
DrupalCon Wrap Up
DrupalCon Wrap UpDrupalCon Wrap Up
DrupalCon Wrap UpRyan Cross
 
Sydney Drupal News Feburary 2013
Sydney Drupal News Feburary 2013Sydney Drupal News Feburary 2013
Sydney Drupal News Feburary 2013Ryan Cross
 
Drupal news 2012 October
Drupal news 2012 OctoberDrupal news 2012 October
Drupal news 2012 OctoberRyan Cross
 
Sydney Drupal News June 2012
Sydney Drupal News June 2012Sydney Drupal News June 2012
Sydney Drupal News June 2012Ryan Cross
 
Sydney Drupal News April 2012
Sydney Drupal News April 2012Sydney Drupal News April 2012
Sydney Drupal News April 2012Ryan Cross
 
Sydney Drupal News August 2012
Sydney Drupal News August 2012Sydney Drupal News August 2012
Sydney Drupal News August 2012Ryan Cross
 
Sydney Drupal News July 2012
Sydney Drupal News July 2012Sydney Drupal News July 2012
Sydney Drupal News July 2012Ryan Cross
 
Sydney Drupal News February 2012
Sydney Drupal News February 2012Sydney Drupal News February 2012
Sydney Drupal News February 2012Ryan Cross
 
Sydney Drupal News May 2012
Sydney Drupal News May 2012Sydney Drupal News May 2012
Sydney Drupal News May 2012Ryan Cross
 
Sydney Drupal News September 2012
Sydney Drupal News September 2012Sydney Drupal News September 2012
Sydney Drupal News September 2012Ryan Cross
 
Sydney Drupal News March 2012
Sydney Drupal News March 2012Sydney Drupal News March 2012
Sydney Drupal News March 2012Ryan Cross
 
Lightning Talk: Drupal Feeds
Lightning Talk: Drupal FeedsLightning Talk: Drupal Feeds
Lightning Talk: Drupal FeedsRyan Cross
 
Sydney Drupal News February 2012
Sydney Drupal News February 2012Sydney Drupal News February 2012
Sydney Drupal News February 2012Ryan Cross
 
Sydney Drupal News March 2012
Sydney Drupal News March 2012Sydney Drupal News March 2012
Sydney Drupal News March 2012Ryan Cross
 
Drupal's Roadmap: The Magic 8 Ball
Drupal's Roadmap: The Magic 8 BallDrupal's Roadmap: The Magic 8 Ball
Drupal's Roadmap: The Magic 8 BallRyan Cross
 
Converting Static Html To Drupal Theme
Converting Static Html To Drupal ThemeConverting Static Html To Drupal Theme
Converting Static Html To Drupal ThemeRyan Cross
 
Modify a Theme
Modify a ThemeModify a Theme
Modify a ThemeRyan Cross
 

Mais de Ryan Cross (20)

Introduction to Content Marketing Strategy for Drupal
Introduction to Content Marketing Strategy for Drupal Introduction to Content Marketing Strategy for Drupal
Introduction to Content Marketing Strategy for Drupal
 
DrupalCon Wrap Up
DrupalCon Wrap UpDrupalCon Wrap Up
DrupalCon Wrap Up
 
Sydney Drupal News Feburary 2013
Sydney Drupal News Feburary 2013Sydney Drupal News Feburary 2013
Sydney Drupal News Feburary 2013
 
Drupal news 2012 October
Drupal news 2012 OctoberDrupal news 2012 October
Drupal news 2012 October
 
Sydney Drupal News June 2012
Sydney Drupal News June 2012Sydney Drupal News June 2012
Sydney Drupal News June 2012
 
Sydney Drupal News April 2012
Sydney Drupal News April 2012Sydney Drupal News April 2012
Sydney Drupal News April 2012
 
Sydney Drupal News August 2012
Sydney Drupal News August 2012Sydney Drupal News August 2012
Sydney Drupal News August 2012
 
Sydney Drupal News July 2012
Sydney Drupal News July 2012Sydney Drupal News July 2012
Sydney Drupal News July 2012
 
Sydney Drupal News February 2012
Sydney Drupal News February 2012Sydney Drupal News February 2012
Sydney Drupal News February 2012
 
Sydney Drupal News May 2012
Sydney Drupal News May 2012Sydney Drupal News May 2012
Sydney Drupal News May 2012
 
Sydney Drupal News September 2012
Sydney Drupal News September 2012Sydney Drupal News September 2012
Sydney Drupal News September 2012
 
Sydney Drupal News March 2012
Sydney Drupal News March 2012Sydney Drupal News March 2012
Sydney Drupal News March 2012
 
Lightning Talk: Drupal Feeds
Lightning Talk: Drupal FeedsLightning Talk: Drupal Feeds
Lightning Talk: Drupal Feeds
 
Sydney Drupal News February 2012
Sydney Drupal News February 2012Sydney Drupal News February 2012
Sydney Drupal News February 2012
 
Sydney Drupal News March 2012
Sydney Drupal News March 2012Sydney Drupal News March 2012
Sydney Drupal News March 2012
 
Drupal's Roadmap: The Magic 8 Ball
Drupal's Roadmap: The Magic 8 BallDrupal's Roadmap: The Magic 8 Ball
Drupal's Roadmap: The Magic 8 Ball
 
Converting Static Html To Drupal Theme
Converting Static Html To Drupal ThemeConverting Static Html To Drupal Theme
Converting Static Html To Drupal Theme
 
Panels 2 Demo
Panels 2 DemoPanels 2 Demo
Panels 2 Demo
 
Modify a Theme
Modify a ThemeModify a Theme
Modify a Theme
 
Drupal Basics
Drupal BasicsDrupal Basics
Drupal Basics
 

Último

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Último (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
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
 
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
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
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)
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 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
 
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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
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?
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Testing In Drupal

  • 1. Testing in Drupal An Introduction
  • 2. Who Am I? Simon Roberts IT Consultant, Taniwha Solutions Using PHP since ~1996 Using Drupal since 2005 http://drupal.org/user/33667 First used SimpleTest at Drupalcon Szeged Testing Sprint
  • 3. Who Am I? Before the Drupalcon, I’d only had the most casual of looks at Testing in Drupal Have used JUnit etc previously Was able to provide useful tests to Drupal Core inside a couple of hours!! You can too!
  • 4. What was SimpleTest? PHP Testing Framework Integrated as a contributed module in D5 + D6 Integrated in core for Drupal 7 (sortof) Implements Automated Testing
  • 5. Why Automated Testing? Define exactly what the code should do Easier development Easier to refactor code Less debugging Less mistakes More fun!!
  • 6. Why Automated Testing? Document Bugs $xss = '<script>alert(quot;xssquot;)</script>'; $edit = array( 'title' => $xss, ); $node = $this->drupalCreateNode($edit); $this->drupalGet('node/' . $node->nid . '/edit'); $this->assertNoRaw($xss, t('Harmful tags are escaped.'));
  • 7. Why Automated Testing? Document Bugs Prevent regressions Quality Assurance Better Software Safety net!
  • 8. Why Automated Testing? Once a test is written, it will likely be run many many times Every time it is run, it verifies that the code is still working If it catches even one bug, it has “paid for itself” - High value Can be used to help reproduce problems
  • 9. Testing in Drupal Core Dries (and Drupal!) has made Testing a high priority for Drupal 7 http://buytaert.net/drupal-7-timeline The actual Drupal 6 Timeline Effective Test coverage allows us to compress the “fix” phase of a Drupal release (code freeze) The Drupal 7 timeline assuming that we fully embrace testing. Note: These dates are going to be delayed anyway - slower migration to Drupal 6 than expected (eg: CCK, Views, Panels. drupal.org)
  • 10. Not just for Drupal Core!
  • 11. so... how does it work? .test files Contain test classes Test classes extend the SimpleTest class well, not exactly Use Helper methods to: Simulate user actions Check behavior
  • 12. No, really... how does it work? Let me show you...
  • 13. What’s Left To Do? Outstanding Testing Issues http://drupal.org/project/issues? projects=3060&versions=156281&components=simpletest.module,tests “We currently have 38 tests taken out of 43 for a test coverage of 88%. This will change when the misnamed tests are merged.” http://groups.drupal.org/node/9408
  • 14. References Webchick’s presentation “Testing Part 1: Intro to Testing” (Szeged Drupalcon) http://drupal.org/simpletest http://groups.drupal.org/testing-qa One SimpleTest template to rule them all http://groups.drupal.org/node/7731 Drupal testing patterns http://groups.drupal.org/node/15190