{"id":185,"date":"2008-01-18T08:36:59","date_gmt":"2008-01-18T16:36:59","guid":{"rendered":"http:\/\/www.ericfeminella.com\/blog\/2008\/01\/18\/flex-unit-testsuitehelper\/"},"modified":"2020-03-12T23:00:44","modified_gmt":"2020-03-13T03:00:44","slug":"flex-unit-testsuitehelper","status":"publish","type":"post","link":"https:\/\/www.ericfeminella.com\/blog\/2008\/01\/18\/flex-unit-testsuitehelper\/","title":{"rendered":"Flex Unit TestSuiteHelper"},"content":{"rendered":"<p>Test Driven Development is an essential part of any software project. Leveraging <a href=\"http:\/\/code.google.com\/p\/as3flexunitlib\/\" target=\"_blank\" rel=\"noopener noreferrer\">Flex Unit<\/a> in your Flex and AIR projects is a well known best practice and will inevitably result in less unknowns and provide a much more reliable codebase, however like most things in life that provide value, unit testing comes at a cost: Time.<\/p>\n<p>In general, writing Unit tests is often an overlooked process as it ultimately equates to an additional level of effort (time) in a project plan. However, writing unit tests should not be over looked for a number of reasons, and in my opinion most importantly because it forces developers to understand what problems the code they write are intended to solve, thus resulting in a better understanding of the problem domain.<\/p>\n<p>Now without getting into a lengthy discussion about the benefits of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Test-driven_development\" target=\"_blank\" rel=\"noopener noreferrer\">Test Driven Development<\/a>, as there is plenty of information available on the subject, I am going to focus on how to make it easier in Flex.<\/p>\n<p>Typically when I write a unit test I stub it out and then run the test runner to make sure it fails. I pretty much do this immediately after I write the test and then I see that my test did not come up and realize I never added it to the test suite. Obviously something like adding tests to a test suite can be an automated process which would allow unit tests to be developed a little faster as all that would be needed was to write the test.<\/p>\n<p>So in an effort to simplify the process of adding tests to a test suite I have developed a TestSuiteHelper which is a simple utility class that automates the process of adding unit tests to a test suite. Rather than manually adding each test the TestSuiteHelper will automate the process simply by invoking a static method and passing in the test class from which you need to extract all of the tests.<\/p>\n<p>So if you would like to simplify your team\u00e2\u20ac\u2122s unit testing workflow feel free to utilize the <a href=\"http:\/\/code.ericfeminella.com\/classes\/as3\/TestSuiteHelper.as.html\" target=\"_blank\" rel=\"noopener noreferrer\">TestSuiteHelper<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Test Driven Development is an essential part of any software project. Leveraging Flex Unit in your Flex and AIR projects is a well known best practice and will inevitably result in less unknowns and provide a much more reliable codebase, however like most things in life that provide value, unit testing comes at a cost: Time. In general, writing Unit&#8230; <a class=\"read-more\" href=\"https:\/\/www.ericfeminella.com\/blog\/2008\/01\/18\/flex-unit-testsuitehelper\/\">Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[35,40],"tags":[],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-software-engineering","category-test-driven-development"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":0,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}