{"id":231,"date":"2012-07-05T02:36:53","date_gmt":"2012-07-05T06:36:53","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/acts\/?p=231"},"modified":"2012-07-05T02:36:53","modified_gmt":"2012-07-05T06:36:53","slug":"functional-testing-what-to-test","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/acts\/2012\/07\/05\/functional-testing-what-to-test\/","title":{"rendered":"Functional Testing: what to test?"},"content":{"rendered":"<p>I&#8217;ve been working with <a href=\"http:\/\/www.phpunit.de\/manual\/current\/en\/selenium.html\">PHPUnit&#8217;s SeleniumTestCase<\/a>.  I worked out some good login switching for the two authentication schemes I&#8217;m working with.  Then came time to actually write some tests.  But what to test?  <\/p>\n<p>Unit testing tests a single class.  A singular piece of code or a unit.  I typically write unit tests for Models only.  Integration testing tests the interaction of multiple units or units with multiple resources.  I&#8217;ve been thinking of these as sort of testing the Controller.  That&#8217;s a little simplified, but it&#8217;s not really something I have a framework for with Yii and PHPUnit.  Functional testing likewise has varying definitions.  Some people like to focus on the testing of &#8220;functional requirements of the product&#8221; and some people have a more simplistic view of it, that it&#8217;s just automating tests of the views &#8212; so it can be used as integration testing.  I personally think the former is a better way to look at it, but it also sounds a little douchey to say it out loud.<\/p>\n<p>So I&#8217;m totally agile.  I&#8217;ve got all these user stories.  And all these tasks.  What I&#8217;m doing is writing the functional tests in terms of the user stories and tasks.  This is sort of BDD, except I&#8217;m ignoring the excessive mocking, which basically makes the BDD tests unit tests, and doing the whole shebang at once.  Shebang isn&#8217;t being picked up by spellcheck. #!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working with PHPUnit&#8217;s SeleniumTestCase. I worked out some good login switching for the two authentication schemes I&#8217;m working with. Then came time to actually write some tests. But what to test? Unit testing tests a single class. A singular piece of code or a unit. I typically write unit tests for Models only. [&hellip;]<\/p>\n","protected":false},"author":4571,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63924,63937],"tags":[63996,63987,63998,63999,63992,63997],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-atg","category-yii","tag-agile","tag-bdd","tag-functional-testing","tag-integration-testing","tag-unit-testing","tag-user-stories"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/users\/4571"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/comments?post=231"}],"version-history":[{"count":1,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/posts\/231\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/acts\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}