Drupal and testing (2010 - 2011 / 2)

1,453 views

Published on

How to test in Drupal. Short and brief presentation.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,453
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Drupal and testing (2010 - 2011 / 2)

  1. 1. Testing In Drupal
  2. 2. Reasons of testing ● Find bugs ● Semantics (not for syntax) ● Function ● Class ● API ● Service ● Ensure workflow – user stories ● Make less work for us ;)
  3. 3. Goodies ● Automation ● Speed (code, grid) ● Triggered tests (Hudson) ● Bug → solution → test ● TDD ● Safer refactoring
  4. 4. Types ● Unit ● Functional ● Ad-hoc
  5. 5. Ad-hoc ● On demand ● Random ● Unreliable
  6. 6. Unit test ● Checks ● Code ● Behavior ● Integrity ● Elements ● SetUp ● TearDown ● Test ● Assertion – Value – Message ● Test sets
  7. 7. Unit test libs ● PHPUnit (PHP) ● http://www.phpunit.de/manual/3.4/en/writing-tests-f ● JUnit (Java) ● NUnit (C#) ● Simpletest (PHP)
  8. 8. Functional test ● UI ● Text ● Widgets (button, form, ...) ● Behavior ● Workflow ● Browser
  9. 9. Functional test libs ● Selenium ● Core ● Plugins (Eclipse, Firefox) ● RC ● Grid ● Castle
  10. 10. Drupal + test ● Simpletest (unit + ~functional) ● D6 → use Simpletest module ● D7 → in core ● Subclass DrupalWebTestCase ● In case of OpenAtrium: AtriumWebTestCase
  11. 11. Drupal + Simpletest ● Start test (WebUI or script) ● Create new environment ● Run tests ● Clear environment
  12. 12. DEMO
  13. 13. Links ● http://en.wikipedia.org/wiki/Test-driven_develo ● http://www.phpunit.de/ ● http://xunitpatterns.com/ ● http://www.drupal.org/project/simpletest ● http://qa.drupal.org/

×