How Testing Changed My Life

4,232 views

Published on

Reasoning behind automated testing with a WordPress plugin as an example. Very mild exposure to bears.

Published in: Technology, Business
  • Be the first to comment

How Testing Changed My Life

  1. 1. HOW TESTINGCHANGED MY LIFE Nikolay bachiyski, automatticWordcamp san francisco, aug 13, 2011
  2. 2. Next30 minutes
  3. 3. 0. what?
  4. 4. 1. example plugin
  5. 5. 2. do it yourself!
  6. 6. what?
  7. 7. 0. what?Automated http://www.flickr.com/photos/binaryape/4882162452/
  8. 8. xUnit 0. what?
  9. 9. PHPUnithttp://www.phpunit.de/manual/current/en/ 0. what?
  10. 10. class  WP_Is_Email_Test  extends  WP_UnitTestCase  {        function  test_is_email_only_letters_with_dot_com_domain()  {                $this-­‐>assertEquals(  nb@nikolay.com,  is_email(  nb@nikolay.com  )  );        }                function  test_is_email_should_not_allow_missing_tld()  {                $this-­‐>assertFalse(  is_email(  nb@nikolay  )  );        }                function  test_is_email_should_allow_bg_domain()  {                $this-­‐>assertEquals(  nb@nikolay.bg,  is_email(  nb@nikolay.bg  )  );        }} 0. what?
  11. 11. class  WP_Is_Email_Test  extends  WP_UnitTestCase  {        function  test_is_email_only_letters_with_dot_com_domain()  {                $this-­‐>assertEquals(  nb@nikolay.com,  is_email(  nb@nikolay.com  )  );        }                function  test_is_email_should_not_allow_missing_tld()  {                $this-­‐>assertFalse(  is_email(  nb@nikolay  )  );        }                function  test_is_email_should_allow_bg_domain()  {                $this-­‐>assertEquals(  nb@nikolay.bg,  is_email(  nb@nikolay.bg  )  );        }} 0. what?
  12. 12. 0. what?
  13. 13. Example Plugin WP_Bearify
  14. 14. do it yourself! 2. do it yourself!
  15. 15. Grab the Frameworkhttps://github.com/nb/wordpress-tests soon in core 2. do it yourself!
  16. 16. Please, read http://xunitpatterns.com/ at least Narratives:http://xunitpatterns.com/Book %20Outline.html 2. do it yourself!
  17. 17. PHPUnithttp://www.phpunit.de/manual/current/en/ 2. do it yourself!
  18. 18. PHPUnit in your editorhttps://github.com/meritt/phpunit-tmbundle/ https://github.com/klokane/vim-phpunit 2. do it yourself!
  19. 19. FEAR!
  20. 20. FEAR!
  21. 21. http://www.flickr.com/photos/eebrierley/5394195199/
  22. 22. warm & cozy > FEAR

×