{"id":7520,"date":"2024-11-18T13:53:05","date_gmt":"2024-11-18T04:53:05","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=7520"},"modified":"2024-11-25T13:24:00","modified_gmt":"2024-11-25T04:24:00","slug":"%e3%83%86%e3%82%b9%e3%83%88%e3%83%bb%e3%82%ab%e3%83%90%e3%83%ac%e3%83%83%e3%82%b8%ef%bc%88%e3%83%86%e3%82%b9%e3%83%88%e7%b6%b2%e7%be%85%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/7520","title":{"rendered":"\u30c6\u30b9\u30c8\u30fb\u30ab\u30d0\u30ec\u30c3\u30b8\uff08\u30c6\u30b9\u30c8\u7db2\u7f85\uff09"},"content":{"rendered":"<ul>\n<li><a href=\"\/tech\/index.php\/archives\/7520#C0\">C0 : statement coverage<\/a><\/li>\n<li><a href=\"\/tech\/index.php\/archives\/7520#C1\">C1 : branch coverage<\/a><\/li>\n<li><a href=\"\/tech\/index.php\/archives\/7520#C2\">C2 : condition coverage<\/a><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h3 id=\"sample\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n<pre class=\"lang:c decode:true \" >statement1;\r\nif ((x == 0) || (y == 0)) {\r\n  statement2;\r\n}<\/pre>\n<h3 id=\"C0\">C0 : statement coverage (\u547d\u4ee4\u7db2\u7f85)<\/h3>\n<p>\u5168\u3066\u306e\u547d\u4ee4\u6587(statements)\u3092\u7db2\u7f85\u3059\u308b\u3053\u3068\u3002<\/p>\n<h4>\u7db2\u7f85\u6761\u4ef6\u306e\u4f8b<\/h4>\n<p><a href=\"#sample\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/a> \u306e statement1 \u3068 statement2 \u3092\u5404\uff11\u56de\u4ee5\u4e0a\u3001\u30c6\u30b9\u30c8\u6761\u4ef6\u3067\u7db2\u7f85\u3059\u308b\u3053\u3068\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>&nbsp;<\/th>\n<th style=\"text-transform: none;\">x<\/th>\n<th style=\"text-transform: none;\">y<\/th>\n<\/tr>\n<tr>\n<td>C0\u30c6\u30b9\u30c8\u6761\u4ef61<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"C1\">C1 : branch coverage (\u5206\u5c90\u7db2\u7f85)<\/h3>\n<p>\u5168\u3066\u306e\u6761\u4ef6\u5206\u5c90(branch)\u3092\u7db2\u7f85\u3059\u308b\u3053\u3068\u3002<\/p>\n<h4>\u7db2\u7f85\u6761\u4ef6\u306e\u4f8b<\/h4>\n<p><a href=\"#sample\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/a> \u306e if\u6587\u306e\u4e2d\u306b\u300c\u5206\u5c90\u3059\u308b\u30b1\u30fc\u30b9\u300d\u3068\u300c\u5206\u5c90\u3057\u306a\u3044\u30b1\u30fc\u30b9\u300d\u306e\u4e21\u65b9\u306e\u6761\u4ef6\u3092\u7db2\u7f85\u3059\u308b\u3053\u3068\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>&nbsp;<\/th>\n<th style=\"text-transform: none;\">x<\/th>\n<th style=\"text-transform: none;\">y<\/th>\n<\/tr>\n<tr>\n<td>C1\u30c6\u30b9\u30c8\u6761\u4ef61<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>C1\u30c6\u30b9\u30c8\u6761\u4ef62<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u6b21\u306e\u4f8b\u3067\u306f C0 \u3082 C1 \u3082\u30c6\u30b9\u30c8\u6761\u4ef6\u306f\u540c\u3058\u3067\u3042\u308b\u3002<\/p>\n<pre class=\"lang:c decode:true \" >statement1;\r\nif ((x == 0) || (y == 0)) {\r\n  statement2;\r\n} else {\r\n  statement3;\r\n}<\/pre>\n<h3 id=\"C2\">C2 : condition coverage (\u6761\u4ef6\u7db2\u7f85)<\/h3>\n<p>\u5168\u3066\u306e\u6761\u4ef6\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u7db2\u7f85\u3059\u308b\u3053\u3068\u3002<\/p>\n<h4>\u7db2\u7f85\u6761\u4ef6\u306e\u4f8b<\/h4>\n<p><a href=\"#sample\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/a> \u306e \u8ad6\u7406\u548c\u306e\u4e21\u8fba\u306e\u6761\u4ef6\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u7db2\u7f85\u3059\u308b\u3053\u3068\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>&nbsp;<\/th>\n<th style=\"text-transform: none;\">x<\/th>\n<th style=\"text-transform: none;\">y<\/th>\n<\/tr>\n<tr>\n<td>C2\u30c6\u30b9\u30c8\u6761\u4ef61<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>C2\u30c6\u30b9\u30c8\u6761\u4ef62<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>C2\u30c6\u30b9\u30c8\u6761\u4ef63<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>C2\u30c6\u30b9\u30c8\u6761\u4ef64<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>C0 : statement coverage C1 : branch coverage C2 : condition coverage<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-7520","post","type-post","status-publish","format-standard","hentry","category-memo"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/7520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=7520"}],"version-history":[{"count":18,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/7520\/revisions"}],"predecessor-version":[{"id":7539,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/7520\/revisions\/7539"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=7520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=7520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=7520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}