{"id":657,"date":"2017-10-06T12:02:00","date_gmt":"2017-10-06T04:02:00","guid":{"rendered":"https:\/\/woohuiren.me\/blog\/acceptanceintegration-tests-only\/"},"modified":"2017-10-06T12:12:34","modified_gmt":"2017-10-06T04:12:34","slug":"acceptanceintegration-tests-only","status":"publish","type":"post","link":"https:\/\/woohuiren.me\/blog\/acceptanceintegration-tests-only\/","title":{"rendered":"Acceptance\/integration tests only&#8230;?"},"content":{"rendered":"<p>I came into this thinking initially when I read the late Pieter Hintjen\u2019s books. He was against numbers\/coverage percentage and said that testing should be focused on APIs. This ensures that the components that works and ignores how individual components function on their own. And also results in less tests with a broad API coverage. He puts what he says into practice and as you can see, ZeroMQ has quite a low \u201ccoverage percentage\u201d of around 60% (it used to be that low).<\/p>\n<p>With my recent reading of \u201cContinuous Delivery\u201d, things seem to point towards focusing on integration testing. And it also mentioned about treating our software as a blackbox, giving it input and expecting correct outputs. Of course, failure modes or unhappy paths should be tested too. But it never explicitly stated that we shouldn\u2019t do unit tests, just that we should only write tests for things that are repeated (expected input, expected output).<\/p>\n<p>Does unit tests even matter anymore? Do they just simply cost too much, and that only integration and acceptance tests matter?<\/p>\n<p>I too, feel and think that we should just cover APIs and not cover individual components. To me, individual components might change quite often and even functionalities\/requirements might change sometimes, resulting in even more changes in the individual components. Writing tests for individual components that change often is costly. The costs just seem too much to be bothered and we should just focus on getting the right output from some input. Perhaps this is because I deal mostly with high level programming languages or web.<\/p>\n<p>What do you think? Am I wrong or do you think so too?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I came into this thinking initially when I read the late Pieter Hintjen\u2019s books. He was against numbers\/coverage percentage and said that testing should be focused on APIs. This ensures that the components that works and ignores how individual components function on their own. And also results in less tests with a broad API coverage. &hellip; <a href=\"https:\/\/woohuiren.me\/blog\/acceptanceintegration-tests-only\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Acceptance\/integration tests only&#8230;?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[36,2,5],"tags":[158,157,159],"class_list":["post-657","post","type-post","status-publish","format-standard","hentry","category-fruit-for-thought","category-information-technology","category-programming","tag-integration-testing","tag-testing","tag-unit-testing"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/657"}],"collection":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/comments?post=657"}],"version-history":[{"count":1,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/657\/revisions"}],"predecessor-version":[{"id":658,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/657\/revisions\/658"}],"wp:attachment":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/media?parent=657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/categories?post=657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/tags?post=657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}