Click here to load reader
Upload
peter-arato
View
1.226
Download
0
Embed Size (px)
DESCRIPTION
How to test in Drupal. Short and brief presentation.
Citation preview
Testing
In Drupal
Reasons of testing
● Find bugs● Semantics (not for syntax)● Function● Class● API● Service
● Ensure workflow – user stories● Make less work for us ;)
Goodies
● Automation● Speed (code, grid)● Triggered tests (Hudson)● Bug → solution → test● TDD● Safer refactoring
Types
● Unit● Functional● Ad-hoc
Ad-hoc
● On demand● Random● Unreliable
Unit test
● Checks● Code● Behavior● Integrity
● Elements● SetUp● TearDown● Test● Assertion
– Value– Message
● Test sets
Unit test libs
● PHPUnit (PHP)● http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html
● JUnit (Java)● NUnit (C#)● Simpletest (PHP)
Functional test
● UI● Text● Widgets (button, form, ...)
● Behavior● Workflow● Browser
Functional test libs
● Selenium● Core● Plugins (Eclipse, Firefox)● RC● Grid
● Castle
Drupal + test
● Simpletest (unit + ~functional)● D6 → use Simpletest module● D7 → in core● Subclass DrupalWebTestCase
● In case of OpenAtrium: AtriumWebTestCase
Drupal + Simpletest
● Start test (WebUI or script)● Create new environment● Run tests● Clear environment
DEMO
Links
● http://en.wikipedia.org/wiki/Test-driven_development● http://www.phpunit.de/● http://xunitpatterns.com/● http://www.drupal.org/project/simpletest● http://qa.drupal.org/