{"id":61,"date":"2004-11-24T18:45:34","date_gmt":"2004-11-24T08:45:34","guid":{"rendered":"http:\/\/thekua.com\/rant\/?p=61"},"modified":"2005-05-06T06:49:02","modified_gmt":"2005-05-05T20:49:02","slug":"when-a-unit-test-is-not-a-unit-test","status":"publish","type":"post","link":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/","title":{"rendered":"When a Unit Test is not a Unit Test"},"content":{"rendered":"<p>The term &#8216;unit test&#8217; was being thrown about today at work but so many things about its context were just plain wrong. Just because our testing framework is called xUnit and each method happens to be called testX doesn\u00ef\u00bf\u00bdt make it a unit test. People have spent (far too much) time attempting to classify all types of tests coming up with categories like functional, acceptance, integration, or unit-integration tests. In my humble opinion, I tend to think of all tests falling along a spectrum, with unit tests (those that test just enough) on one end and the functional\/acceptance tests (those that test too much) on the other. <\/p>\n<p>Each test along this spectrum is important but the speed and quality of these tests will be one of the factors that determine how fast you can change or add to your code base. By all means, slower, bigger tests further along in the spectrum can be substituted for faster, lighter unit tests, but its consequences usually lead to a project that is less agile and more waterfall-driven.<\/p>\n<p>Here are a few signs that your tests may be masquerading as something more than just (better, and faster) unit tests:<\/p>\n<ul>\n<li>Your application must be \u00ef\u00bf\u00bddeployed\u00ef\u00bf\u00bd to run some of your tests;<\/li>\n<li>A user must interpret console output or some other type of result for the test to fail;<\/li>\n<li>Each test takes too much time to run (it should be possible to many of these within a second);<\/li>\n<li>Excessive amounts of set up are required for each test (a smell that this might be integration test and\/or testing too much); and<\/li>\n<li>Tests cannot be run without some external resource (such as a database, specific computer or some file);<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The term &#8216;unit test&#8217; was being thrown about today at work but so many things about its context were just plain wrong. Just because our testing framework is called xUnit and each method happens to be called testX doesn\u00ef\u00bf\u00bdt make it a unit test. People have spent (far too much) time attempting to classify all [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[39],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-technical","tag-work-related"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>When a Unit Test is not a Unit Test - thekua.com@rest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"When a Unit Test is not a Unit Test - thekua.com@rest\" \/>\n<meta property=\"og:description\" content=\"The term &#8216;unit test&#8217; was being thrown about today at work but so many things about its context were just plain wrong. Just because our testing framework is called xUnit and each method happens to be called testX doesn\u00ef\u00bf\u00bdt make it a unit test. People have spent (far too much) time attempting to classify all [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/\" \/>\n<meta property=\"og:site_name\" content=\"thekua.com@rest\" \/>\n<meta property=\"article:published_time\" content=\"2004-11-24T08:45:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2005-05-05T20:49:02+00:00\" \/>\n<meta name=\"author\" content=\"Patrick\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Patrick\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/\"},\"author\":{\"name\":\"Patrick\",\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/#\\\/schema\\\/person\\\/6de103b28f96be3f1f4dc25db357c6ae\"},\"headline\":\"When a Unit Test is not a Unit Test\",\"datePublished\":\"2004-11-24T08:45:34+00:00\",\"dateModified\":\"2005-05-05T20:49:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/\"},\"wordCount\":295,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/#\\\/schema\\\/person\\\/6de103b28f96be3f1f4dc25db357c6ae\"},\"keywords\":[\"Work-Related\"],\"articleSection\":[\"Work Related\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/\",\"url\":\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/\",\"name\":\"When a Unit Test is not a Unit Test - thekua.com@rest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/#website\"},\"datePublished\":\"2004-11-24T08:45:34+00:00\",\"dateModified\":\"2005-05-05T20:49:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/2004\\\/11\\\/when-a-unit-test-is-not-a-unit-test\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thekua.com\\\/rant\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"When a Unit Test is not a Unit Test\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/#website\",\"url\":\"https:\\\/\\\/thekua.com\\\/rant\\\/\",\"name\":\"thekua.com@rest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/#\\\/schema\\\/person\\\/6de103b28f96be3f1f4dc25db357c6ae\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thekua.com\\\/rant\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/#\\\/schema\\\/person\\\/6de103b28f96be3f1f4dc25db357c6ae\",\"name\":\"Patrick\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/pat-kua-head.png\",\"url\":\"https:\\\/\\\/thekua.com\\\/rant\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/pat-kua-head.png\",\"contentUrl\":\"https:\\\/\\\/thekua.com\\\/rant\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/pat-kua-head.png\",\"width\":400,\"height\":400,\"caption\":\"Patrick\"},\"logo\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/rant\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/pat-kua-head.png\"},\"sameAs\":[\"http:\\\/\\\/www.thekua.com\"],\"url\":\"https:\\\/\\\/thekua.com\\\/rant\\\/author\\\/patrick\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"When a Unit Test is not a Unit Test - thekua.com@rest","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/","og_locale":"en_US","og_type":"article","og_title":"When a Unit Test is not a Unit Test - thekua.com@rest","og_description":"The term &#8216;unit test&#8217; was being thrown about today at work but so many things about its context were just plain wrong. Just because our testing framework is called xUnit and each method happens to be called testX doesn\u00ef\u00bf\u00bdt make it a unit test. People have spent (far too much) time attempting to classify all [&hellip;]","og_url":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/","og_site_name":"thekua.com@rest","article_published_time":"2004-11-24T08:45:34+00:00","article_modified_time":"2005-05-05T20:49:02+00:00","author":"Patrick","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Patrick","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/#article","isPartOf":{"@id":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/"},"author":{"name":"Patrick","@id":"https:\/\/thekua.com\/rant\/#\/schema\/person\/6de103b28f96be3f1f4dc25db357c6ae"},"headline":"When a Unit Test is not a Unit Test","datePublished":"2004-11-24T08:45:34+00:00","dateModified":"2005-05-05T20:49:02+00:00","mainEntityOfPage":{"@id":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/"},"wordCount":295,"commentCount":4,"publisher":{"@id":"https:\/\/thekua.com\/rant\/#\/schema\/person\/6de103b28f96be3f1f4dc25db357c6ae"},"keywords":["Work-Related"],"articleSection":["Work Related"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/","url":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/","name":"When a Unit Test is not a Unit Test - thekua.com@rest","isPartOf":{"@id":"https:\/\/thekua.com\/rant\/#website"},"datePublished":"2004-11-24T08:45:34+00:00","dateModified":"2005-05-05T20:49:02+00:00","breadcrumb":{"@id":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/thekua.com\/rant\/2004\/11\/when-a-unit-test-is-not-a-unit-test\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thekua.com\/rant\/"},{"@type":"ListItem","position":2,"name":"When a Unit Test is not a Unit Test"}]},{"@type":"WebSite","@id":"https:\/\/thekua.com\/rant\/#website","url":"https:\/\/thekua.com\/rant\/","name":"thekua.com@rest","description":"","publisher":{"@id":"https:\/\/thekua.com\/rant\/#\/schema\/person\/6de103b28f96be3f1f4dc25db357c6ae"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thekua.com\/rant\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/thekua.com\/rant\/#\/schema\/person\/6de103b28f96be3f1f4dc25db357c6ae","name":"Patrick","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thekua.com\/rant\/wp-content\/uploads\/2025\/12\/pat-kua-head.png","url":"https:\/\/thekua.com\/rant\/wp-content\/uploads\/2025\/12\/pat-kua-head.png","contentUrl":"https:\/\/thekua.com\/rant\/wp-content\/uploads\/2025\/12\/pat-kua-head.png","width":400,"height":400,"caption":"Patrick"},"logo":{"@id":"https:\/\/thekua.com\/rant\/wp-content\/uploads\/2025\/12\/pat-kua-head.png"},"sameAs":["http:\/\/www.thekua.com"],"url":"https:\/\/thekua.com\/rant\/author\/patrick\/"}]}},"_links":{"self":[{"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":0,"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"wp:attachment":[{"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thekua.com\/rant\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}