{"id":5565,"date":"2022-02-01T04:56:05","date_gmt":"2022-02-01T04:56:05","guid":{"rendered":"https:\/\/studysection.com\/blog\/?p=5565"},"modified":"2022-02-01T05:15:06","modified_gmt":"2022-02-01T05:15:06","slug":"statement-and-decision-coverage-in-white-box-testing","status":"publish","type":"post","link":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/","title":{"rendered":"Statement and Decision Coverage in White Box Testing"},"content":{"rendered":"<p>The structure of the system&#8217;s software is the basis for white-box <a href=\"https:\/\/studysection.com\/blog\/seven-fundamentals-of-testing\/\">testing<\/a>. It&#8217;s most often used at the component level (so-called unit testing), but it can also be performed at any other test level utilizing the various white-box models of the system.<\/p>\n<p><strong>For instance,<\/strong> <\/p>\n<ul>\n<li>At the integration level, call graphs<\/li>\n<li>At the system level, business processes<\/li>\n<li>At the acceptance testing level, menu structures<\/li>\n<\/ul>\n<h2>Characteristics of White Box Testing:<\/h2>\n<p>The following are some of the most common characteristics of white-box testing techniques:<\/p>\n<ul>\n<li>A test basis, which may comprise code, software architecture, detailed design, or any other source of information about the software&#8217;s structure, is used to generate test conditions, test cases, and test data.<\/li>\n<li>The items tested within a given structure (e.g., the code or interfaces) are used to determine coverage.<\/li>\n<li>Specifications are frequently used as a secondary data source when determining the expected outcome of test cases.<\/li>\n<\/ul>\n<h3>Statement Coverage Testing in White Box Testing:<\/h3>\n<p>White box test cases are developed using the statement coverage technique. This process requires running all of the source code statements at least once. It is used to determine the total number of executed statements in the source code based on the total number of statements in the source code.<br \/>\n<strong>Statement coverage = No of statements Executed \/ Total no of statements in the source code * 100<\/strong><br \/>\nExample:<br \/>\n<code>Read A<br \/>\nRead B<br \/>\nif A>B<br \/>\nPrint \u201cA is greater than B\u201d<br \/>\nelse Print \"B is greater than A\"<br \/>\nendif<br \/>\nSet1 :If A =5, B =2<br \/>\nNo of statements Executed: 5<br \/>\nTotal number of statements in the source code: 7<br \/>\nStatement coverage =5\/7*100 = 71.00 %<br \/>\nSet2 :If A =2, B =5<br \/>\nNo of statements Executed: 6<br \/>\nTotal number of statements in the source code: 7<br \/>\nStatement coverage =6\/7*100 = 85.20 %<\/code><\/p>\n<p>This is purely a white-box method of testing. It examines the software&#8217;s internal coding and infrastructure, and it is the programmer&#8217;s responsibility to do so. This method is ideal for programmers.<\/p>\n<h3>Decision Coverage Testing in White Box Testing:<\/h3>\n<p>Decision coverage, also known as branch coverage, is a testing technique that ensures that each possible branch from each decision point is tested at least once, ensuring that all reachable code is executed.<br \/>\nThat is to imply, every decision is made in both true and false forms. It aids in verifying all of the code&#8217;s branches, ensuring that none of them lead to abnormal application behavior.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2022\/02\/diagram.png\" alt=\"diagram\" \/><\/p>\n<p>In the diagram above, we have three decision points\u2014these are the nodes: (1, 2), (3), and (6). Each of them has two outgoing transitions; hence altogether, we have six test conditions to cover:<\/p>\n<ul>\n<li>Decision (1, 2) outcome to TRUE <\/li>\n<li>Decision (1, 2) outcome to FALSE <\/li>\n<li>Decision (3) outcome to TRUE <\/li>\n<li>Decision (3) outcome to FALSE <\/li>\n<li>Decision (6) outcome to TRUE <\/li>\n<li>Decision (6) outcome to FALSE<\/li>\n<\/ul>\n<p>The minimum number of test cases achieving the decision coverage is 3.<br \/>\n<strong>Example:<\/strong><\/p>\n<ul>\n<li>Test 1: 1, 2, 9, 10 (covers the test condition 2) <\/li>\n<li>Test 2: 1, 2, 3, 4, 5, 3, 6, 7, 9, 10 (covers the test conditions 1, 3, 4, and 5) <\/li>\n<li>Test 3: 1, 2, 3, 6, 8, 9, 10 (covers the test conditions 1, 4, and 6)<\/li>\n<\/ul>\n<p>The minimal number of test cases, in this case, is 3, because number two of the test conditions 2, 5, and 6 can be exercised in one test case. Notice that we were able to cover both the test conditions 3 and 4 in one test case, taking advantage of the fact that there is a loop in the code,  so we will cover the test condition 3, return, and then, within the next loop iteration, we cover the test condition 4.<\/p>\n<p><small><em>If you have skills in PHP programming and you want to enhance your career in this field, a PHP certification from StudySection can help you reach your desired goals. Both beginner level and expert level <a href=\"https:\/\/www.studysection.com\/php-web-developer-advanced-diploma\">PHP Certification Exams<\/a> are offered by StudySection along with other programming certification exams. <\/em><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The structure of the system&#8217;s software is the basis for white-box testing. It&#8217;s most often used at the component level<\/p>\n","protected":false},"author":1,"featured_media":5566,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[22,759],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Statement and Decision Coverage in White Box Testing - SS Blog<\/title>\n<meta name=\"description\" content=\"The structure of the system&#039;s software is the basis for white-box testing. It&#039;s most often used at the component level.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Statement and Decision Coverage in White Box Testing - SS Blog\" \/>\n<meta property=\"og:description\" content=\"The structure of the system&#039;s software is the basis for white-box testing. It&#039;s most often used at the component level.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Posts on famous people, innovations and educational topics\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/studysection\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-01T04:56:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-01T05:15:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2022\/02\/White-Box.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin-studysection-blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@studysection\" \/>\n<meta name=\"twitter:site\" content=\"@studysection\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin-studysection-blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/\"},\"author\":{\"name\":\"admin-studysection-blog\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\"},\"headline\":\"Statement and Decision Coverage in White Box Testing\",\"datePublished\":\"2022-02-01T04:56:05+00:00\",\"dateModified\":\"2022-02-01T05:15:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/\"},\"wordCount\":537,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"keywords\":[\"testing\",\"White Box\"],\"articleSection\":[\"Learn and Grow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/\",\"url\":\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/\",\"name\":\"Statement and Decision Coverage in White Box Testing - SS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/#website\"},\"datePublished\":\"2022-02-01T04:56:05+00:00\",\"dateModified\":\"2022-02-01T05:15:06+00:00\",\"description\":\"The structure of the system's software is the basis for white-box testing. It's most often used at the component level.\",\"breadcrumb\":{\"@id\":\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/studysection.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Statement and Decision Coverage in White Box Testing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/studysection.com\/blog\/#website\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"name\":\"Blog Posts on famous people, innovations and educational topics\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/studysection.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/studysection.com\/blog\/#organization\",\"name\":\"StudySection\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"contentUrl\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"width\":920,\"height\":440,\"caption\":\"StudySection\"},\"image\":{\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/studysection\",\"https:\/\/twitter.com\/studysection\",\"https:\/\/www.instagram.com\/study.section\/\",\"https:\/\/www.linkedin.com\/company\/studysection\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\",\"name\":\"admin-studysection-blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"caption\":\"admin-studysection-blog\"},\"url\":\"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Statement and Decision Coverage in White Box Testing - SS Blog","description":"The structure of the system's software is the basis for white-box testing. It's most often used at the component level.","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:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/","og_locale":"en_US","og_type":"article","og_title":"Statement and Decision Coverage in White Box Testing - SS Blog","og_description":"The structure of the system's software is the basis for white-box testing. It's most often used at the component level.","og_url":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/","og_site_name":"Blog Posts on famous people, innovations and educational topics","article_publisher":"https:\/\/www.facebook.com\/studysection","article_published_time":"2022-02-01T04:56:05+00:00","article_modified_time":"2022-02-01T05:15:06+00:00","og_image":[{"width":300,"height":200,"url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2022\/02\/White-Box.png","type":"image\/png"}],"author":"admin-studysection-blog","twitter_card":"summary_large_image","twitter_creator":"@studysection","twitter_site":"@studysection","twitter_misc":{"Written by":"admin-studysection-blog","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/#article","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/"},"author":{"name":"admin-studysection-blog","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402"},"headline":"Statement and Decision Coverage in White Box Testing","datePublished":"2022-02-01T04:56:05+00:00","dateModified":"2022-02-01T05:15:06+00:00","mainEntityOfPage":{"@id":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/"},"wordCount":537,"commentCount":0,"publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"keywords":["testing","White Box"],"articleSection":["Learn and Grow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/","url":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/","name":"Statement and Decision Coverage in White Box Testing - SS Blog","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/#website"},"datePublished":"2022-02-01T04:56:05+00:00","dateModified":"2022-02-01T05:15:06+00:00","description":"The structure of the system's software is the basis for white-box testing. It's most often used at the component level.","breadcrumb":{"@id":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/studysection.com\/blog\/statement-and-decision-coverage-in-white-box-testing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/studysection.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Statement and Decision Coverage in White Box Testing"}]},{"@type":"WebSite","@id":"https:\/\/studysection.com\/blog\/#website","url":"https:\/\/studysection.com\/blog\/","name":"Blog Posts on famous people, innovations and educational topics","description":"","publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/studysection.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/studysection.com\/blog\/#organization","name":"StudySection","url":"https:\/\/studysection.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","contentUrl":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","width":920,"height":440,"caption":"StudySection"},"image":{"@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/studysection","https:\/\/twitter.com\/studysection","https:\/\/www.instagram.com\/study.section\/","https:\/\/www.linkedin.com\/company\/studysection"]},{"@type":"Person","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402","name":"admin-studysection-blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","caption":"admin-studysection-blog"},"url":"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/"}]}},"views":3141,"_links":{"self":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/5565"}],"collection":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/comments?post=5565"}],"version-history":[{"count":3,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/5565\/revisions"}],"predecessor-version":[{"id":5570,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/5565\/revisions\/5570"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media\/5566"}],"wp:attachment":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media?parent=5565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/categories?post=5565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/tags?post=5565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}