{"id":495,"date":"2021-07-03T12:34:25","date_gmt":"2021-07-03T04:34:25","guid":{"rendered":"https:\/\/swordofmorning.com\/?p=495"},"modified":"2025-10-09T13:55:52","modified_gmt":"2025-10-09T05:55:52","slug":"logical-coverage","status":"publish","type":"post","link":"https:\/\/swordofmorning.com\/index.php\/2021\/07\/03\/logical-coverage\/","title":{"rendered":"\u903b\u8f91\u8986\u76d6"},"content":{"rendered":"<h2>\u4e00\u3001\u95ee\u9898\u5b9e\u4f8b<\/h2>\n<p>&emsp;&emsp;\u770b\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<pre><code class=\"language-python\">if (A and B)    #Judge 1\n    # do sth 1\nif (C or D)     #judeg 2\n    # do sth 2<\/code><\/pre>\n<h2>\u4e8c\u3001\u8986\u76d6<\/h2>\n<h3>2.1 \u8bed\u53e5\u8986\u76d6<\/h3>\n<p>&emsp;&emsp;\u8ba9\u4e0a\u8ff0\u7684DS1\u548cDS2\u90fd\u80fd\u6267\u884c\u5373\u53ef\uff1a<\/p>\n<ul>\n<li>A(ture), B(true), C(true), D(true)<\/li>\n<\/ul>\n<h3>2.2 \u5224\u5b9a\u8986\u76d6<\/h3>\n<p>&emsp;&emsp;\u6bcf\u4e2a\u5224\u5b9a\u5206\u652f\u81f3\u5c11\u7ecf\u5386\u4e00\u6b21\u771f\u3001\u5047\u5206\u652f\u3002\u5bf9\u4e8e\u4e0a\u8ff0\u6761\u4ef6\uff0c\u6211\u4eec\u53ea\u8981\u8ba9J1\u548cJ2\u90fd\u5b58\u5728\u771f\u3001\u5047\u5404\u4e00\u6b21\u5373\u53ef\uff1a<\/p>\n<ul>\n<li>A(true), B(true), C(true), D(true)<\/li>\n<li>A(false), B(false), C(false), D(false)<\/li>\n<\/ul>\n<p>&emsp;&emsp;\u5176\u4e2d\u5404\u53c2\u6570\u503c\u53ef\u4ee5\u53d8\u5316\uff0c\u53ea\u8981\u8ba9J1\u548cJ2\u90fd\u8fdb\u884c\u8fc7\u771f\u5047\u5224\u65ad\u5373\u53ef\u3002<\/p>\n<h3>2.3 \u6761\u4ef6\u8986\u76d6<\/h3>\n<p>&emsp;&emsp;\u8ba9\u6761\u4ef6ABCD\u90fd\u80fd\u53d6\u5230\u4e00\u6b21\u771f\u5047\u5373\u53ef\uff0c\u5373A\u5e94\u8be5\u53d6\u5230true\u548cfalse\u4e24\u79cd\uff0c\u5176\u4ed6\u7684\u6761\u4ef6\u4e5f\u4e00\u6837\uff1a<\/p>\n<ul>\n<li>A(true), B(true), C(true), D(true)<\/li>\n<li>A(false), B(false), C(false), D(false)<\/li>\n<\/ul>\n<p>&emsp;&emsp;\u8fd9\u6837\u6211\u4eec\u5c31\u7ed9\u6240\u6709\u6761\u4ef6\u53d6\u4e86t\/f\uff0c\u6ee1\u8db3\u6761\u4ef6\u8986\u76d6\u3002<\/p>\n<h3>2.4 \u5224\u5b9a\u6761\u4ef6\u8986\u76d6<\/h3>\n<p>&emsp;&emsp;\u540c\u65f6\u6ee1\u8db3\u5224\u5b9a\u8986\u76d6\u548c\u6761\u4ef6\u8986\u76d6\u3002<\/p>\n<ul>\n<li>A(true), B(true), C(true), D(true) # \u6240\u6709\u6761\u4ef6ture\u8986\u76d6\uff0c\u540c\u65f6\u6ee1\u8db3J1\u771f\u3001J2\u771f<\/li>\n<li>A(false), B(false), C(false), D(false) # \u6240\u6709\u6761\u4ef6false\u8986\u76d6\uff0c\u540c\u65f6\u6ee1\u8db3J1\u5047\u3001J2\u5047<\/li>\n<\/ul>\n<h3>2.5 \u6761\u4ef6\u7ec4\u5408\u8986\u76d6<\/h3>\n<p>&emsp;&emsp;\u5224\u5b9a\u6761\u4ef6\u4e4b\u95f4\u7684\u7b1b\u5361\u5c14\u79ef\uff0c\u5373A{true, false} x B{true, false} x c{true, false} x D{true, false}<\/p>\n<ol>\n<li>A(true), B(true), C(true), D(true)<\/li>\n<li>A(true), B(true), C(true), D(false)<\/li>\n<li>A(true), B(true), C(false), D(true)<\/li>\n<li>A(true), B(true), C(true), D(false)<\/li>\n<li>\u7565<\/li>\n<\/ol>\n<h3>2.6 \u8def\u5f84\u8986\u76d6<\/h3>\n<p>&emsp;&emsp;\u5224\u5b9a\u5206\u652fJ\u4e4b\u95f4\u7684\u7b1b\u5361\u5c14\u79ef\uff0cJ1{true, false} x J2{ture, fasle}\uff1a<\/p>\n<ul>\n<li>A(true), B(true), C(true), D(true) # \u6ee1\u8db3(true, true)<\/li>\n<li>A(true), B(true), C(false), D(false) # \u6ee1\u8db3(true, false)<\/li>\n<li>A(false), B(false), C(true), D(true) # \u6ee1\u8db3(false, true)<\/li>\n<li>A(false), B(false), C(false), D(false) # \u6ee1\u8db3(false, false)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u95ee\u9898\u5b9e\u4f8b &emsp;&emsp;\u770b\u4e2a\u4f8b\u5b50\uff1a if (A and B) #Judge 1 # do sth 1 if (C o &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/495"}],"collection":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":6,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/495\/revisions"}],"predecessor-version":[{"id":504,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/495\/revisions\/504"}],"wp:attachment":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/media?parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/categories?post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/tags?post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}