{"id":292936,"date":"2021-01-19T02:20:11","date_gmt":"2021-01-18T18:20:11","guid":{"rendered":"http:\/\/4563.org\/?p=292936"},"modified":"2021-01-19T02:20:11","modified_gmt":"2021-01-18T18:20:11","slug":"%e8%b0%88%e8%b0%88-unit-test%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=292936","title":{"rendered":"\u8c08\u8c08 unit test\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8c08\u8c08 unit test\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e66\u63a5\u4e0a\u6587\uff0c \u8c08\u8c08 code review\uff1a \/t\/693941<\/p>\n<blockquote>\n<ul>\n<li>\u4f18\u70b9\uff1a\u4fdd\u8bc1\u5de5\u7a0b\u8d28\u91cf\u3002API \u7ea7\u522b\u7684 unit test \u3002<\/li>\n<li>\u7f3a\u70b9\uff1a\u8fc7\u91cf\u7684 UT \u53ea\u4f1a\u5bfc\u81f4 API \u4e0d\u597d\u6539\u52a8\uff0c\u6d6a\u8d39\u66f4\u591a\u65f6\u95f4\u524d\u671f\u5f00\u53d1+\u540e\u671f\u7ef4\u62a4<\/li>\n<\/ul>\n<\/blockquote>\n<p>\u6700\u8fd1\u6211\u7684\u6ce2\u5170\u201c\u597d\u5144\u5f1f\u201d\u8111\u58f3\u4e00\u62bd\uff0c\u63d0\u51fa\u8981\u52a0 UT\uff0c\u65e9\u4e0d\u5199\uff0c\u665a\u4e0d\u5199\uff0c\u975e\u5f97 API \u5168\u90fd\u5f04\u5b8c\u4e86\u518d\u5199\u3002\u672c\u6765\u5c31\u662f\u8c01\u5199\u4ee3\u7801\uff0c\u8c01\u5c31\u5e94\u8be5\u52a0 UT \u7684\u4e8b\u60c5\uff0c\u7ed3\u679c\u8fd8\u5f97\u5148\u8ba9\u6211\u63d0\u4e00\u4e2a UT plan \u4e0a\u53bb\u3002<\/p>\n<p>\u7136\u540e\u6211\u5c31\u6539\u4e86\u4e03\u516b\u7248\u672c\u5427\u3002\u4ed6\u6709\u5982\u4e0b\u8981\u6c42<\/p>\n<ul>\n<li> \u539f\u672c\u9879\u76ee\u662f\u6709\u4f9d\u8d56\u4e8e\u4e00\u4e9b\u522b\u7684 lib \u7684\uff08\u540e\u6587\u547d\u540d\u4e3a A.lib \uff09\uff0cA.lib \u4e2d\u6709\u4e00\u4e9b API\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u6784\u5efa\u4e00\u4e2a\u79c1\u6709\u7684\u4f20\u8f93\u534f\u8bae\u3002\n<ul>\n<li>\u6ce2\u5170\u201c\u597d\u5144\u5f1f\u201d\u5e0c\u671b\u6211\u80fd\u628a\u6574\u4e2a A.lib \u90fd Mock \u6389\uff0c\u4f46\u662f\u6211\u5b9e\u9645\u505a\u4e0b\u6765\u53d1\u73b0\uff1a\u5de5\u7a0b\u91cf\u5de8\u5927\uff0c\u5e76\u4e14\u505a\u6cd5\u65e0\u610f\u4e49<\/li>\n<li>\u5982\u679c\u628a A.lib \u6574\u4e2a Mock \u6389\uff0c\u5927\u7ea6\u9700\u8981 Mock \u6389\u4e24\u767e\u591a\u4e2a\u65b9\u6cd5\uff0c\u5e76\u4e14\u90e8\u5206\u6838\u5fc3\u903b\u8f91\u90fd\u662f\u7531 A.lib \u5b9e\u73b0\uff0c\u5b9e\u9645\u4e0a\u7ebf\u8fd8\u662f\u4f1a\u9700\u8981\u7528\u5230 A.lib \uff0cMock \u6389\u540e\uff0c\u63d0\u4f9b\u4e2a\u5047\u7684\u65b9\u6cd5\uff0c\u6709\u4ec0\u4e48\u610f\u4e49\uff1f\u4e07\u4e00 UT \u6ca1\u95ee\u9898\uff0c\u4e0a\u7ebf\u51fa\u4e86\u95ee\u9898\u8c01\u8d1f\u8d23\uff1f<\/li>\n<li>\u6ce2\u5170\u201c\u597d\u5144\u5f1f\u201d\u4e0d\u542c\uff0c\u53ea\u89c9\u5f97\u6211\u4eec\u4e0d\u662f\u6d4b\u8bd5 A.lib \u7684\u903b\u8f91\uff0c\u4e0d\u9700\u8981\u8fd9\u4e9b\u65b9\u6cd5\u3002<\/li>\n<li>\u73b0\u5728\u8fd8\u5728\u4e89\u5435<\/li>\n<\/ul>\n<\/li>\n<li> \u4ee3\u7801 cover \u5230\u6240\u6709 code\n<ul>\n<li>\u8fd9\u4e2a\u662f\u4e2a\u57fa\u672c\u8981\u6c42\u6ca1\u9519\uff0c\u4f46\u662f\u6ce2\u5170\u4eba\u5b9e\u5728\u592a\u5947\u8469\u4e86\uff0c\u903c\u7740\u6211\u63d0\u4e86\u4e00\u5957\u65b9\u6848\uff0c\u8fd9\u5957\u65b9\u6848\u5b8c\u5168\u8fc7\u91cf\u7684 cover \u5230\u6240\u6709\u903b\u8f91\u3002<\/li>\n<li>\u6bd4\u5982 A.c \u4e2d\u65b9\u6cd5\u7528\u4e86 B.h \u7684 API\uff0cA.c \u4e2d\u7684\u6838\u5fc3\u65b9\u6cd5\u5c31\u662f\u64cd\u4f5c B.h \u7684 API \u5b9e\u73b0\u7684\u3002\u7ed3\u679c\u6211\u5199\u597d\u4e86 A.h \u7684 UT\uff0c\u8fd8\u8981\u6211\u5199 B.h \u7684 UT\uff0c\u6211\u89c9\u5f97\u5b8c\u5168\u6ca1\u5fc5\u8981\u3002\u5176\u4e00\u4f1a\u5bfc\u81f4 B.h \u4ee5\u540e API \u4e0d\u597d\u52a8\uff08\u56e0\u4e3a\u5982\u679c\u52a0\u4e0a B.h \u7684 UT \u540e\uff0c\u8981\u6539 B.h \u7684 API \u9700\u8981\u6539\u4e24\u4e2a UT \uff09\uff0c\u5176\u4e8c\u5c31\u662f\u5df2\u7ecf cover \u5230\u4e86\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u9700\u8981\u518d\u5199\u4e00\u904d\uff1f\u662f\u4e0d\u662f\u5728\u6d6a\u8d39\u65f6\u95f4<\/li>\n<\/ul>\n<\/li>\n<li> \u73b0\u5728\u5df2\u7ecf\u63d0\u4e0a\u4e86 80+\u4e2a UT \u4e0a\u53bb\uff0c\u8fd8\u5f97\u52a0\u3002\n<ul>\n<li>\u539f\u5148 Code \u4ee3\u7801\u91cf\u5e76\u4e0d\u5927\uff0c\u51e0\u4e2a.h+.c \u4e00\u8d77\u52a0\u8d77\u6765\u4e00\u73a9\u884c\u5de6\u53f3\u3002<\/li>\n<li>\u73b0\u5728\u7684 UT \u771f\u8981\u5199\u51fa\u6765\uff0c\u5e94\u8be5\u884c\u6570\u548c\u539f\u5148\u4ee3\u7801\u91cf\u6709\u7684\u4e00\u6bd4&#8230;&#8230;&#8230;..<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5199 UT \u4ece\u6765\u90fd\u662f\u597d\u4e8b\u60c5\uff0c\u6ce2\u5170\u201c\u597d\u4e1c\u897f\u201d\u5c31\u662f\u8111\u58f3\u4e0d\u8f6c\u5f2f\u7684\uff0c\u73b0\u5728\u6bcf\u5929\u4e0b\u5348\u5feb\u4e0b\u73ed\u4e86\u5728\u90a3\u5435\u67b6\uff0c\u641e\u5f97\u5927\u5bb6\u90fd\u5f88\u70e6\uff0c\u8fd9\u4e2a UT plan \u63d0\u4e86\u51e0\u5468\u8fd8\u5728\u6539\uff0c\u6211\u771f\u662f\u4f5b\u4e86\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>38<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5134338\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : petercui <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7b2c\u4e00\u70b9\u6211\u7ad9\u201c\u597d\u5144\u5f1f\u201d\u90a3\u8fb9\uff1b\u7b2c\u4e8c\u4e2a\u70b9\u6211\u7ad9\u4f60\u8fd9\u8fb9\uff0c\u7b2c\u4e09\u4e2a\u70b9\u6211\u89c9\u5f97 UT \u672c\u6765\u5c31\u5e94\u8be5\u4e09\u500d\u4e8e\u771f\u6b63\u7684\u4e1a\u52a1\u4ee3\u7801\uff0c\u4f60\u8fd9\u624d\u201c\u6709\u7684\u4e00\u6bd4\u201d\uff0c\u7b80\u76f4\u592a\u5c11\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134339\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : guyeu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6559\u6761\u4e3b\u4e49\u5355\u5143\u6d4b\u8bd5\u5b9e\u8df5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134340\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xylophone21 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u540c\u6c42\u8fd9\u79cd C\/C++\u9879\u76ee\u7684 UT \u5b9e\u8df5\uff0c\u9664\u4e86\u4e3b\u8bf4\u7684\u6253\u6869\u95ee\u9898\uff0cmakefile \u95ee\u9898\u4e0d\u77e5\u9053\u4f60\u4eec\u600e\u4e48\u89e3\u51b3\u7684\uff1f\u6bd4\u5982\u4f60\u7b2c\u4e8c\u6761\u91cc\u8bf4\u7684 A.c \u5728 makefile \u91cc\u672c\u6765\u662f\u4f9d\u8d56 B.o \u6216\u8005 B.lib \u7684\uff0c\u4f46\u65e2\u7136\u8981 UT\uff0c\u90a3\u5c31\u53ea\u80fd\u4f9d\u8d56 MockB.o\uff0c\u751a\u81f3 MockB1.o\uff0cMockB2.o \u7b49\u7b49\uff08\u56e0\u4e3a\u8981 Mock \u4e0d\u540c\u8fd4\u56de\u7684\u60c5\u51b5\uff09\uff0c\u65e2\u7136\u6709\u4e86 MockB.o\uff0c\u90a3\u548c B.o \u80af\u5b9a\u5c31\u4e0d\u80fd\u6253\u5305\u5230\u4e00\u4e2a main \u91cc\u4e86\uff08\u9664\u975e\u5168\u6253\u6210\u52a8\u6001\u5e93\uff0c\u4f46\u52a8\u6001\u5e93\u53c8\u6709\u52a8\u6001\u5e93\u7684\u95ee\u9898\uff09\uff0c\u4e8e\u662f\u53c8\u662f\u4e00\u5806 main\uff0c\u4e00\u5806\u521d\u59cb\u5316\u2026\u2026<\/p>\n<p>\u4ee5\u524d\u6211\u4e00\u76f4\u4ee5\u4e3a UT \u662f\u4e09\u500d\u4e1a\u52a1\u4ee3\u7801\u5c31\u662f\u8fd9\u4e9b\u539f\u56e0\uff0c\u76f4\u5230\u6211\u770b\u4e86 Spring \u91cc\u7684 UT \u6846\u67b6\uff0c\u5404\u79cd Repository \u3001Service \u3001\u7f51\u7edc\u5c42\u7684 Mock\uff0c\u8fd0\u884c\u65f6\u50cf\u6ce8\u5165\u54ea\u4e2a\u6ce8\u5165\u54ea\u4e2a\u3002\u4e0d\u60f3\u6253\u6869\u65f6\u76f4\u63a5\u7528\u771f\u5b9e\u5b9e\u4f8b\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7528\uff08\u6bd4\u5982\u6d4b Service \u65f6\uff0cRepository \u4e0d\u60f3\u6253\u6869\u7684\u8bdd\uff0c\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u771f\u5b9e\u7684 Repository \u51c6\u5907\u5404\u79cd\u6570\u636e\u2014\u2014PS\uff0c\u6211\u4e0d\u77e5\u9053\u8fd9\u79cd\u65b9\u6cd5\u662f\u4e0d\u662f\u4e0d\u591f UT\uff0c\u4f46\u786e\u5b9e\u597d\u7528\uff0c\u8282\u7701\u65f6\u95f4\uff09\u3002\u6240\u4ee5\u5982\u679c\u4e09\u500d\u5de5\u4f5c\u91cf\u662f Spring \u8bf4\u51fa\u6765\u7684\u8bdd\uff0c\u6211\u7b80\u76f4\u6000\u7591\u5728 C\/C++\u754c\uff0c\u8fd9\u4e2a\u5de5\u4f5c\u91cf\u53ef\u80fd\u662f 10 \u500d\uff0c30 \u500d\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134341\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xylophone21 #3 <\/p>\n<p>C \u7684\u8bdd\uff0c\u6709\u4e24\u4e2a\u529e\u6cd5\uff0c\u5176\u4e00\u5c31\u662f MockB.o \u7684\u529e\u6cd5\uff08\u6b63\u5982\u4f60\u81ea\u5df1\u8bf4\u7684\uff09\uff0c\u7b2c\u4e8c\u4e2a\u529e\u6cd5\u662f\u66ff\u6362\u6389 weak symbols\uff0c\u8fd9\u4e2a\u529e\u6cd5\u9700\u8981\u5728 Makefile \u4e2d\u663e\u793a\u58f0\u660e\uff0c\u5e76\u4e14\u53ef\u4ee5\u8ba9\u539f\u6709\u7684.o \u6587\u4ef6\u88ab link \u3002<\/p>\n<p>C++\u7684\u8bdd\u7b80\u5355\u5f88\u591a\uff0c\u5982\u679c\u4f60\u7528 GTest\uff0c\u91cc\u9762\u6709 GMock\uff0c\u8fd9\u662f\u57fa\u4e8e\u6a21\u677f\u7684\uff0c\u5982\u679c\u4f60\u60f3\u7528 GMock \u53bb\u66ff\u6362\u6389 global \u7684\u51fd\u6570\uff0c\u5c31\u5f97\u81ea\u5df1\u52a0\u70b9\u4e1c\u897f\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134342\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @petercui #1 \u4e09\u500d\u7684\u8bdd\uff0c\u6211\u5176\u5b9e\u5f88\u597d\u5947\u4f60\u662f\u5982\u4f55\u505a\u5230\u540e\u671f\u7ef4\u62a4\u7684\uff0c\u5047\u5982\u4f60\u52a8\u4e86\u67d0\u4e2a\u65b9\u6cd5\uff0c\u90a3\u53ef\u80fd\u4f60\u9700\u8981\u6539\u5f88\u591a UT \u3002\u5e76\u4e14\u4f60\u5728\u6539\u4e86 UT \u7684\u540c\u65f6\uff0c\u6709\u53ef\u80fd\u548c\u539f\u5148 UT \u7684\u8bbe\u8ba1\u8005\u60f3\u6cd5\u80cc\u9053\u800c\u9a70\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134343\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : feather12315 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u52a8\u6001\u6ce8\u5165\uff0cx86 \u7528 call \uff08 0xe8 \uff09\u3001jmp \uff08 0xe9 \uff09\u5b9e\u73b0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134344\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : feather12315 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u2026\u5f53\u524d\u5c31\u5728\u5199\u6d4b\u8bd5\u4ee3\u7801\uff0c\u5229\u7528\u5185\u6838\u5b9e\u73b0\u7684 livepatch \u505a\u6ce8\u5165                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134345\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AndyAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5173\u4e8e UT \u963b\u788d\u4fee\u6539\u7684\u95ee\u9898.<br \/>\u5728\u8fdb\u884c\u5927\u8303\u56f4\u7684\u66f4\u6539\u7684\u65f6\u5019\uff0c\u5c31\u5e94\u8be5\u820d\u53bb.<br \/>\u56e0\u4e3a\u6d4b\u8bd5\u7684\u5f88\u591a\u90fd\u662f\u5b9e\u73b0\u7ec6\u8282\uff0c\u800c\u4e0d\u662f\u884c\u4e3a\u672c\u8eab\u5b9e\u73b0\uff0c\u7ec6\u8282\u672c\u6765\u5c31\u53ef\u4ee5\u6539\u7684.<br \/>\u8fd9\u4e2a\u95ee\u9898\u81ea\u4ece UT \u8bde\u751f\u4ee5\u6765\u5c31\u6709\u4e86\uff0c\u4e0a\u4e16\u7eaa 90 \u5e74\u4ee3\u8fd8\u6709\u4eba\u8fd9\u4e48\u8bf4.<br \/>\u8981\u518d\u5199\u5355\u5143\u6d4b\u8bd5\u7684\u540c\u65f6\u4e5f\u8981\u5199\u884c\u4e3a\u6d4b\u8bd5\uff0c\u5f53\u7136\u6709\u5fc5\u8981\u7684\u8bdd\u8fd8\u53ef\u4ee5\u5199\u66f4\u9ad8\u5c42\u7684.<br \/>\u8fd9\u6837\u7684\u8bdd\uff0c\u5982\u679c\u66f4\u6539\u5df2\u7ecf\u660e\u663e\u8d8a\u8fc7\u6d4b\u8bd5\u4e86\uff0c\u90a3\u5c31\u5e94\u8be5\u820d\u5f03.<\/p>\n<p>\u800c\u81f3\u4e8e\u4e07\u4e00\u6d4b\u8bd5\u6ca1\u95ee\u9898\uff0c\u4f46\u4e0a\u7ebf\u4e4b\u540e\u6709\u95ee\u9898\u8be5\u600e\u4e48\u529e\uff0c\u8fd9\u4e2a\u4e5f\u662f\u8001\u95ee\u9898\u4e86\uff0c\u5173\u4e8e\u6d4b\u8bd5\u7684\u4e66\u91cc\u5f88\u591a\u90fd\u8c08\u5230\u4e86.<br \/>\u6709\u70b9\u7c7b\u4f3c\u4e8e\u79d1\u5b66\u5b9e\u9a8c\u7684\u610f\u601d\uff0c\u53d1\u4e2a\u706b\u7bad\u9020\u4e2a\u98de\u673a\u4ec0\u4e48\u7684\uff0c\u4e5f\u90fd\u4e0d\u53ef\u80fd\u5b8c\u5168\u6309\u7167\u73b0\u5b9e\u60c5\u51b5\u6765\u8fdb\u884c\u6d4b\u8bd5\u5185\u5bb9\u6d4b\u8bd5\u5c31\u4e0d\u80fd\u53eb\u6d4b\u8bd5.<\/p>\n<p>\u81f3\u4e8e\u8bba\u8bc1\u7684\u8bdd\u6bd4\u8f83\u504f\u54f2\u5b66\u6240\u4ee5\u5728\u8fd9\u91cc\u6211\u4e5f\u5c31\u4e0d\u5199\u4e86\uff0c\u76f8\u5173\u7684\u4e66\u91cc\u90fd\u6709.<\/p>\n<p>\u6211\u5199\u6d4b\u8bd5\u4e5f\u4e0d\u592a\u4e13\u4e1a\uff0c\u6211\u4e5f\u5728\u8865\u8bfe\uff0c\u611f\u89c9\u5f88\u591a\u4e66\u90fd\u8bb2\u7684\u4e0d\u9519\uff0c\u4e66\u6bd4\u8f83\u8001\uff0c\u4e5f\u6709\u5f88\u591a\u7684\u517b\u5206\uff0c\u5982\u679c\u4e0d\u5438\u53d6\u524d\u4eba\u7684\u7ecf\u9a8c\uff0c\u90a3\u4e48\u5c31\u4f1a\u91cd\u590d\u7684\u65b9\u6848\uff0c90 \u5e74\u4ee3\u5927\u5bb6\u90fd\u9047\u5230\u8fc7\u7684\u9519\u8bef.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134346\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AndyAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @AndyAO #8 \u66f4\u6539\u4e0a\u9762\u4e00\u6bb5\uff0c\u5220\u9664\u6389\u4e0d\u5c0f\u5fc3\u6253\u9519\u4e86\u90e8\u5206<\/p>\n<p>\u800c\u81f3\u4e8e\u4e07\u4e00\u6d4b\u8bd5\u6ca1\u95ee\u9898\uff0c\u4f46\u4e0a\u7ebf\u4e4b\u540e\u6709\u95ee\u9898\u8be5\u600e\u4e48\u529e\uff0c\u8fd9\u4e2a\u4e5f\u662f\u8001\u95ee\u9898\u4e86\uff0c\u5173\u4e8e\u6d4b\u8bd5\u7684\u4e66\u91cc\u5f88\u591a\u90fd\u8c08\u5230\u4e86.<br \/>\u6709\u70b9\u7c7b\u4f3c\u4e8e\u79d1\u5b66\u5b9e\u9a8c\uff0c\u53d1\u706b\u7bad\u9020\u98de\u673a\u90fd\u4e0d\u662f\u6309\u7167\u5b9e\u9645\u60c5\u51b5\u6765\u8fdb\u884c\u6d4b\u8bd5\u7684\uff0c\u4e5f\u90fd\u4e0d\u53ef\u80fd\u5b8c\u5168\u6309\u7167\u73b0\u5b9e\u60c5\u51b5\u6765\u8fdb\u884c\u6d4b\u8bd5.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134347\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : niubee1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5176\u5b9e\u5f88\u591a\u4eba\u4e00\u5f00\u59cb\u90fd\u89c9\u5f97\u5355\u5143\u6d4b\u8bd5\u6d6a\u8d39\u65f6\u95f4\uff0c\u4f46\u662f\u5f88\u591a\u65f6\u5019\u56de\u8fc7\u5934\u6765\u770b\u770b\uff0c\u6ca1\u6709\u5355\u5143\u6d4b\u8bd5\u624d\u662f\u771f\u628a\u65f6\u95f4\u90fd\u5582\u72d7\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134348\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AndyAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @niubee1 #10 <br \/>\u8fd9\u4e0d\u5c31\u662f\u6d4b\u8bd5\u51fa\u52a8\u5f00\u53d1\u5417\uff1f\u76ee\u524d\u7814\u7a76\u8868\u660e\u8fd9\u4e2a\u65b9\u6cd5\u8fd8\u662f\u80fd\u591f\u63d0\u9ad8\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u7684\uff0c\u81f3\u5c11\u4e0d\u4f1a\u53d8\u5dee.[1]<br \/>\u8f6f\u4ef6\u4e1a\u76ee\u524d\u5c31\u662f\u8fd9\u6837\uff0c\u5f88\u591a\u5f88\u591a\u4e0a\u4e16\u7eaa\u90fd\u51fa\u73b0\u4e86\u6982\u5ff5\uff0c\u4f46\u5f88\u591a\u7a0b\u5e8f\u5458\u5374\u6839\u672c\u5c31\u4e0d\u77e5\u9053\uff0c\u6709\u65f6\u5019\u8ba9\u4eba\u611f\u89c9\u633a\u60b2\u54c0\u7684.[2]<br \/>\u591a\u8bfb\u4e66\u600e\u4e48\u5f3a\u8c03\u4e5f\u4e0d\u4e3a\u8fc7.<\/p>\n<p>[1] AndyOram, GregWilson. \u8f6f\u4ef6\u4e4b\u9053[M]. \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e, 2012.<br \/>[2] Barr A . The Problem with Software[C]\/\/ 2018.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134349\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @AndyAO #9 \u90a3\u95ee\u9898\u6765\u4e86\uff0c\u73b0\u5728\u9879\u76ee\u660e\u660e\u53ef\u4ee5\u7528\u5b9e\u9645\u73af\u5883\u6765\u6d4b\u8bd5\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u7528\u5462\uff1f\u8fd8\u5fc5\u987b\u8981 Mock \u4f4f\u73af\u5883\uff0c\u8fd9\u4e0d\u662f\u591a\u6b21\u4e00\u4e3e\uff1f<\/p>\n<p>\u201c\u53d1\u706b\u7bad\u9020\u98de\u673a\u201d\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u6211\u7684\u786e\u8ba4\u53ef\uff0c\u4f46\u62ff\u6765\u548c\u6211\u76ee\u524d\u7684\u60c5\u51b5\u7c7b\u6bd4\uff0c\u5e76\u4e0d\u5408\u9002\u3002<\/p>\n<p>\u4e3e\u4e2a\u6700\u5b9e\u9645\u7684\u4f8b\u5b50\uff0c\u6211\u7684\u4f9d\u8d56\u5e93\u4e2d\u6709\u5927\u9875\u7ba1\u7406\u7684\u5b9e\u73b0\uff0c\u90a3\u73b0\u5728\u6211\u5728\u4e00\u53f0\u6d4b\u8bd5\u673a\u4e0a\uff0c\u662f\u53ef\u4ee5\u7528\u5230\u5927\u9875\u7684\uff0c\u90a3\u6211\u89c9\u5f97\u5c31\u4e0d\u9700\u8981\u7528 Mock \u53bb\u6a21\u62df\uff0c\u5c31\u5f88\u591a\u6b64\u4e00\u4e3e\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134350\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AndyAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sockpuppet9527 #12 <\/p>\n<p>\u8fd9\u771f\u662f\u4e2a\u5e38\u8bc6\u95ee\u9898\uff0c\u4f60\u53ef\u80fd\u4e0d\u592a\u4e86\u89e3\uff0c\u4f46\u662f\u76f8\u5173\u7684\u8d44\u6599\u5e94\u8be5\u4e0d\u96be\u627e\uff0c\u5173\u4e8e\u6d4b\u8bd5\u7684\u4e66\u57fa\u672c\u4e0a\u9996\u5148\u90fd\u4f1a\u8bb2\u8fd9\u4e2a\u95ee\u9898.<\/p>\n<p>\u6211\u6709\u8fd9\u6837\u7684\u5efa\u8bae\uff0c\u4f60\u5148\u628a\u4f7f\u7528 Mock \u7684\u597d\u5904\u627e\u5230\u7136\u540e\u7ed9\u5217\u51fa\u6765\uff0c\u56e0\u4e3a Mock \u662f\u51e0\u4e4e\u6240\u6709\u5355\u5143\u6d4b\u8bd5\u6846\u67b6\u4e2d\u90fd\u8981\u7528\u7684\uff0c\u53ef\u4ee5\u8bf4\u90a3\u662f\u5fc5\u5907\u7684\u4e1c\u897f.<\/p>\n<p>\u6211\u4f30\u8ba1\u8c37\u6b4c\u4e0a\u7684\u8d44\u6599\u5df2\u7ecf\u5f88\u591a\u5f88\u591a\u4e86\uff0c\u56e0\u4e3a\u6211\u770b\u5230\u7684\u4e66\u9996\u5148\u90fd\u8981\u8bb2\u8fd9\u4e2a.<\/p>\n<p>\u5f53\u7136\u4f60\u4eec\u5728\u5b9e\u8df5\u7684\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u8ba9\u4f60\u611f\u89c9\u7279\u522b\u7684\u65e0\u5948\uff0c\u4e0d\u60f3\u5199\u8fd9\u4e2a\u4e1c\u897f\uff0c\u7136\u540e\u4f60\u5bf9\u8fd9\u4e2a\u53ef\u6076\u7684\u4e1c\u897f\u6709\u4e86\u5f88\u5f3a\u70c8\u7684\u60c5\u7eea.<\/p>\n<p>\u8fd9\u4e2a\u662f\u4eba\u4e4b\u5e38\u60c5\uff0c\u6bcf\u4e2a\u4eba\u90fd\u4f1a\u8fd9\u6837\uff0c\u4f46\u4f60\u60f3\u4e00\u4e0b Mock\uff0c\u5e7f\u6cdb\u5b58\u5728\u4e8e\u6240\u6709\u5355\u5143\u6d4b\u8bd5\u6846\u67b6\u4e2d\uff0c\u8fd9\u4e2a\u73b0\u5b9e\u5c31\u77e5\u9053\uff0c\u6bd4\u8d77\u8fd9\u4e2a\u4e1c\u897f\u5b8c\u5168\u6ca1\u7528\u6765\u8bf4\uff0c\u66f4\u5927\u7684\u53ef\u80fd\u662f\u7528\u9519\u4e86\uff0c\u6709\u53e5\u8bdd\u8bf4\u5783\u573e\u662f\u653e\u9519\u7684\u8d44\u6e90\uff0c\u4f55\u51b5\u8fd9\u4e2a\u4e1c\u897f\u663e\u7136\u4e0d\u662f\u5783\u573e.<\/p>\n<p>\u7b49\u4f60\u628a\u597d\u5904\u5217\u51fa\u6765\u4e4b\u540e &#8220;\u73b0\u5728\u9879\u76ee\u660e\u660e\u53ef\u4ee5\u7528\u5b9e\u9645\u73af\u5883\u6765\u6d4b\u8bd5\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u7528\u5462\uff1f\u8fd8\u5fc5\u987b\u8981 Mock \u4f4f\u73af\u5883\uff0c\u8fd9\u4e0d\u662f\u591a\u6b21\u4e00\u4e3e\uff1f&#8221;\u8fd9\u4e2a\u95ee\u9898\u81ea\u7136\u800c\u7136\u5c31\u56de\u7b54\u4e86\uff0c\u90a3\u4e48\u4f60\u4e5f\u5c31\u77e5\u9053\u4e86\uff0cMock \u771f\u6b63\u8981\u89e3\u51b3\u7684\u95ee\u9898\uff0c\u5982\u679c\u67d0\u4e9b\u95ee\u9898\u7684\u786e\u4e0d\u9002\u5408\u5b83\u6765\u89e3\u51b3\uff0c\u90a3\u4e48\u4f60\u4e5f\u5c31\u4e0d\u7528\u518d\u8d39\u5fc3\u4e86.<\/p>\n<p>\u6211\u4e5f\u628a\u4e4b\u524d\u770b\u5230\u7684\u8d44\u6599\u7a0d\u5fae\u6574\u7406\u6574\u7406\u53d1\u5230\u8fd9\u4e0a\u9762\u6765\u4f9b\u4f60\u53c2\u8003\uff0c\u4e5f\u8bb8\u4f1a\u6709\u70b9\u5e2e\u52a9\u6211\u4e5f\u590d\u4e60\u590d\u4e60.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134351\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AndyAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sockpuppet9527 #12 <br \/>\u8fd8\u6709\u6211\u63d0\u5230\u7684\u90a3\u4e2a\u884c\u4e3a\u6d4b\u8bd5\u548c\u5355\u5143\u6d4b\u8bd5\u7684\u533a\u522b\uff0c\u8fd9\u4e2a\u7684\u4e13\u4e1a\u672f\u8bed\u5e94\u8be5\u53eb\u6d4b\u8bd5\u7684\u9897\u7c92\u5ea6\u95ee\u9898.<br \/>\u5f53\u7136\u8f6f\u4ef6\u5de5\u7a0b\u7684\u6570\u636e\u6bd4\u8f83\u6df7\u4e71\uff0c\u76f8\u540c\u6982\u5ff5\u7ecf\u5e38\u6709\u5404\u79cd\u5404\u6837\u7684\u8bcd\uff0c\u4f46\u6211\u89c9\u5f97\u8fd9\u4e2a\u597d\u50cf\u8fd8\u662f\u6bd4\u8f83\u666e\u904d\u7684\u5427.<br \/>\u6211\u662f\u5728\u5199\u884c\u4e3a\u6d4b\u8bd5\u7684\u65f6\u5019\u770b\u5230\u8fc7\u5173\u4e8e\u8fd9\u4e9b\u95ee\u9898\u7684\u8868\u8ff0.<br \/>\u6211\u73b0\u5728\u90fd\u662f\u884c\u4e3a\u6d4b\u8bd5\u548c\u5355\u5143\u6d4b\u8bd5\u90fd\u8981\u5199.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134352\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @AndyAO <\/p>\n<p>#14 \u548c\u884c\u4e3a\u6d4b\u8bd5\u6709\u4ec0\u4e48\u5173\u7cfb\uff0c\u6211\u8fd9\u91cc\u8c08\u7684\u662f\u5355\u5143\u6d4b\u8bd5\u3002<\/p>\n<p>#13 \u8bf4\u5b9e\u8bdd\uff0c\u770b\u4e86\u4e24\u904d\u6211\u90fd\u6ca1\u660e\u767d\u4f60\u5230\u5e95\u60f3\u8bf4\u4ec0\u4e48\u3002\u6211\u518d\u4e3e\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u4f60 alloc \u4e00\u5757\u5185\u5b58\u9700\u8981\u7528 malloc\uff0c\u96be\u9053\u4f60\u5728 UT \u91cc\u9762\u4e5f\u8981\u628a malloc \u8fd9\u4e2a\u51fd\u6570\u7ed9 Mock \u6389\u5417\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134353\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AndyAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sockpuppet9527 #15 <br \/>\u8bf4\u884c\u4e3a\u6d4b\u8bd5\u662f\u4e3a\u4e86\u89e3\u91ca\u4f60\u5173\u4e8e\u5355\u5143\u6d4b\u8bd5\u7684\u95ee\u9898.<br \/>\u56e0\u4e3a\u5355\u5143\u6d4b\u8bd5\u5728\u6709\u4e9b\u4fee\u6539\u7684\u65f6\u5019\u662f\u9700\u8981\u820d\u5f03\u7684,\u4f60\u8bf4\u7684\u90a3\u79cd\u963b\u788d\u4e86\u4fee\u6539\u7684\u4e8b\u60c5,\u672c\u4e0d\u5e94\u8be5\u7531\u5355\u5143\u6d4b\u8bd5\u6765\u627f\u62c5.\u6240\u4ee5\u6839\u672c\u5c31\u662f\u7528\u9519\u4e86\u5730\u65b9.<br \/>\u5982\u679c\u4f60\u8fd9\u90fd\u770b\u4e0d\u61c2\u7684\u8bdd,\u90a3\u6211\u5c31\u4e0d\u8bf4\u4e86,\u4f60\u81ea\u5df1\u591a\u770b\u70b9\u4e66.\u8d44\u6599\u6211\u4e5f\u4e0d\u7ed9\u4f60\u53d1\u4e86.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134354\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hitmanx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6240\u4ee5\u770b\u4e0b\u6765\u81ea\u5df1\u7ed9\u81ea\u5df1\u4ee3\u7801\u52a0\u6d4b\u8bd5\u662f\u6bd4\u8f83\u5408\u9002\u7684\uff0c\u54ea\u4e00\u4e9b\u662f\u9ed1\u76d2\u7684\u529f\u80fd\u6d4b\u8bd5\u80fd\u8986\u76d6\u5230\u7684\uff0c\u54ea\u4e9b\u9700\u8981\u767d\u76d2\u6d4b\u8bd5\u7684\uff0c\u54ea\u4e9b\u9700\u8981 mock\uff0c\u5199\u4ee3\u7801\u7684\u4eba\u5e94\u8be5\u81ea\u5df1\u5fc3\u91cc\u6700\u6709\u6570\uff0c\u751a\u81f3\u54ea\u4e9b\u529f\u80fd\u662f\u4e0d\u5b8c\u6574\u7684\uff0c\u54ea\u90e8\u5206\u4ee3\u7801\u5c06\u6765\u672a\u6765\u662f\u8981\u6269\u5145\u7684\u3002\u8fd9\u4e9b\u53ef\u80fd\u90fd\u5bf9\u6d4b\u8bd5\u7684\u8bbe\u8ba1\u4f1a\u6709\u5f71\u54cd\u3002\u6211\u4e5f\u89c9\u5f97\u6559\u6761\u5730 mock \u6bcf\u4e00\u4e2a\u51fd\u6570\u6216\u8005\u8ba9\u6bcf\u4e00\u884c\u4ee3\u7801\u90fd\u6d4b\u8bd5\u5230\uff0c\u8fdb\u800c\u5927\u91cf\u7684\u9ad8\u5ea6\u8026\u5408\u7136\u800c\u5e76\u6ca1\u6709\u793e\u4e48\u7528\u7684\u6d4b\u8bd5\uff0c\u5176\u5b9e\u53ea\u4f1a\u6d6a\u8d39\u66f4\u591a\u7684\u65f6\u95f4                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134355\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @AndyAO #16 <br \/>\u5728#15 \u63d0\u7684\u662f#13 \u7684\u95ee\u9898\uff0c\u4f60\u5e76\u6ca1\u6709\u4efb\u4f55\u6b63\u9762\u56de\u7b54\u7684\u610f\u601d\u3002\u4f60\u201c\u53d1\u4e0d\u53d1\u8d44\u6599\u201d\u548c\u4f60\u201c\u6709\u6ca1\u6709\u6b63\u9762\u8ba8\u8bba\u201d\u5e76\u65e0\u5173\u7cfb\u3002<\/p>\n<p>\u7136\u540e\u5173\u4e8e\u4f60#8 \u548c#14 \u4e2d\u7684\u201c\u5355\u5143\u6d4b\u8bd5\u5728\u6709\u4e9b\u4fee\u6539\u7684\u65f6\u5019\u662f\u9700\u8981\u820d\u5f03\u201d\u7684\u903b\u8f91\uff0c\u6211\u4e2a\u4eba\u7684\u7ecf\u9a8c\u662f\u77e5\u8bc6\u56e0\u9879\u76ee\u800c\u5f02\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134356\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sockpuppet9527 #18 <\/p>\n<p>\u7ea0\u6b63\uff0c\u201c\u6211\u4e2a\u4eba\u7684\u7ecf\u9a8c\u662f\u77e5\u8bc6\u56e0\u9879\u76ee\u800c\u5f02\u201d -&gt; \u201c\u6211\u4e2a\u4eba\u7684\u7ecf\u9a8c\u662f\u56e0\u9879\u76ee\u800c\u5f02\u201d                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134357\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hitmanx #17 \u5f88\u8ba4\u540c\u60a8\u7684\u89c2\u70b9\uff0c\u4e0d\u540c\u8bbe\u8ba1\u8005\u603b\u662f\u4f1a\u6709\u4e0d\u540c\u7684\u60f3\u6cd5\u3002 \ud83d\ude42                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134358\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xylophone21 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sockpuppet9527 <\/p>\n<p>weak symbols\uff0c\u8fd9\u4e2a\u6211\u7406\u89e3\u5e94\u8be5\u662f\u6307\u628a B.o \u91cc\u7684\u65b9\u6cd5\u5236\u5b9a\u4e3a weak \uff1f\u4f46\u8fd9\u6837 Mock \u4e5f\u53ea\u80fd\u6709\u4e00\u4e2a\u5b9e\u73b0\uff0c\u4e5f\u5c31\u662f\u8bf4\u5bf9\u5e94\u7528\u4f8b 1\uff0c\u9700\u8981 b_foo(1)\u8fd4\u56de 0\uff0c\u800c\u7528\u4f8b 2 \u9700\u8981 b_foo(1)\u8fd4\u56de 1 \u8fd8\u662f\u5f88\u96be\u5b9e\u73b0\uff1f<\/p>\n<p>GMock \u5927\u6982\u653e\u72d7\u627e\u4e86\u4e00\u4e0b\u3002<br \/>\u4ece Google Mock \u7684\u539f\u7406\u91cc\u53ef\u4ee5\u770b\u5230\uff0cGoogle Mock \u53ea\u80fd\u5bf9\u7c7b\u7684\u865a\u51fd\u6570\u505a mock\uff0c\u5e76\u4e14\u8981\u6c42\u88ab\u6d4b\u4ee3\u7801\u4e0d\u80fd\u591f\u76f4\u63a5\u521b\u5efa\u8be5\u7c7b\u7684\u5bf9\u8c61\uff0c\u800c\u662f\u7531\u5916\u754c\u4f20\u8fdb\u53bb\u7684\u3002<br \/>\u6240\u4ee5\u8fd9\u4e2a\u53ef\u80fd\u5f97\u5728\u5f00\u53d1\u9636\u6bb5\u5c31\u5b9a\u4e0b\u89c4\u5219\uff0c\u6bd4\u5982\u865a\u51fd\u6570\uff0c\u4e0d\u80fd\u76f4\u63a5\u521b\u5efa\u5bf9\u8c61\u7b49<\/p>\n<p>@feather12315 <br \/>\u8fd9\u4e2a\u529e\u6cd5\u5012\u662f\u5f88\u6709\u610f\u601d\uff0c\u6709\u6210\u719f\u7684\u6846\u67b6\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134359\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xylophone21 #21 <\/p>\n<p>1. weak symbols \u662f\u7684\uff0c\u6b63\u5982\u4f60\u6240\u8bf4\uff0c\u4f46\u662f\u9ed8\u8ba4\u51fd\u6570\u90fd\u662f weak symbols \u7684<br \/>2. GMock \u6211\u53ea\u7528\u6765\u8fc7 mock global \u7684\u65b9\u6cd5\uff0cmock class \u6211\u6ca1\u6709\u8bd5\u8fc7\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134360\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             c\/c++\u7684\u6d4b\u8bd5\u5199\u8d77\u6765\uff0c\u90a3\u662f\u771f\u7684\u75db\u82e6\uff01\u5c24\u5176\u662f\u7ed9\u4ee5\u524d\u7684 legacy code \u5199\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134361\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : namelosw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5199\u6d4b\u8bd5\u662f\u95e8\u827a\u672f. \u4e0d\u5199\u6d4b\u8bd5\u4e0d\u597d, \u5927\u90e8\u5206\u9879\u76ee\u5199\u4e0d\u597d\u6548\u679c\u66f4\u5dee. \u6211\u89c9\u5f97\u91cd\u8981\u7684\u5c31\u51e0\u4e2a\u65b9\u9762, \u4f46\u662f\u66f4\u591a\u7684\u9700\u8981\u5b9e\u8df5\u548c\u601d\u8003, \u7279\u522b\u662f\u5728\u56e2\u961f\u4e2d\u7684\u5b9e\u8df5(\u56e0\u4e3a\u5f88\u591a\u5199\u6d4b\u8bd5\u5728\u6240\u6709\u4eba\u8111\u888b\u91cc\u7684\u542b\u4e49\u90fd\u4e0d\u4e00\u6837, \u5f88\u591a\u65f6\u5019\u5373\u4fbf\u6d4b\u8bd5\u7b56\u7565\u5f88\u597d, \u6700\u7ec8\u6267\u884c\u4e5f\u4f1a\u5f88\u5dee), \u4f60\u53ef\u4ee5\u7ed3\u5408\u4f60\u7684\u7ecf\u9a8c\u601d\u8003\u4e00\u4e0b:<\/p>\n<p>\u4e00: \u6d4b\u8bd5\u8981\u548c\u4ee3\u7801\u4e00\u8d77\u5199. \u597d\u7684\u6d4b\u8bd5\u90fd\u9700\u8981\u9002\u5408\u6d4b\u8bd5\u7684\u4ee3\u7801\u914d\u5408(\u5e76\u53d1, \u6c99\u76d2, \u66ff\u6362, \u751f\u6210\u6d4b\u8bd5\u7b49\u7b49). TDD \u867d\u7136\u4e0d\u662f\u4e07\u80fd\u7684, \u4f46\u662f\u5f88\u5bb9\u6613\u4fdd\u8bc1\u4ee3\u7801\u662f\u53ef\u6d4b\u7684, \u5373\u4f7f\u4e0d TDD \u4e5f\u8981\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u7acb\u523b\u5199\u6d4b\u8bd5. \u529f\u80fd\u8981\u4e00\u70b9\u4e00\u70b9\u52a0, \u52a0\u4e00\u70b9\u529f\u80fd\u5199\u4e00\u70b9\u6d4b\u8bd5. \u5168\u5199\u5b8c\u4e86\u5199\u6d4b\u8bd5\u5c31\u4f1a\u5bfc\u81f4\u5404\u79cd\u95ee\u9898, \u56e0\u4e3a\u5199\u4ee3\u7801\u7684\u65f6\u5019\u6839\u672c\u6ca1\u8003\u8651\u6d4b\u8bd5.<\/p>\n<p>\u4e8c: \u7c92\u5ea6\u76f8\u5173<\/p>\n<p>\u6d4b\u8bd5\u827a\u672f\u5c31\u5728\u7c92\u5ea6\u63a7\u5236\u4e0a. \u7c92\u5ea6\u5927\u80fd cover \u7684\u4e1a\u52a1\u591a, \u4f46\u662f\u66f4\u6162\u66f4\u4e0d\u7a33\u5b9a. \u7c92\u5ea6\u5c0f\u5bb9\u6613\u5199, \u8dd1\u5f97\u4e5f\u5feb, \u4f46\u662f\u4e0d\u80fd\u53cd\u5e94\u4e1a\u52a1, \u800c\u4e14\u5bfc\u81f4\u4ee3\u7801\u50f5\u5316\u6ca1\u6cd5\u91cd\u6784. \u8868\u9762\u4e0a\u770b\u8d77\u6765\u600e\u4e48 trade off \u90fd\u4e00\u6837, \u4f46\u662f\u5b9e\u9645\u53ef\u4ee5\u6709\u5f88\u591a sweet spot.<\/p>\n<p>\u7c92\u5ea6\u63a7\u5236\u7684\u6838\u5fc3\u76ee\u6807\u5c31\u662f\u5c3d\u91cf\u540c\u65f6\u63d0\u9ad8\u5bf9\u4e1a\u52a1\u7684 coverage \u4e14\u4e0d\u660e\u663e\u727a\u7272\u901f\u5ea6:<\/p>\n<p>\u63d0\u9ad8\u5bf9\u4e1a\u52a1 coverage \u5c31\u662f\u589e\u5927\u7c92\u5ea6, \u610f\u4e49\u662f\u4f60\u7684\u6d4b\u8bd5\u662f\u5bf9\u7740\u4e1a\u52a1\u9700\u6c42\u5199\u7684 &#8211; \u5f88\u591a UT \u662f\u5bf9\u7740\u4ee3\u7801\u5199, \u800c\u4e0d\u662f\u5bf9\u7740\u9700\u6c42\u5199, \u8fd9\u6837\u6539\u4ee3\u7801\u7684\u65f6\u5019\u5c31\u96be\u514d\u5220\u6d4b\u8bd5\u91cd\u5199, \u800c\u5bf9\u7740\u9700\u6c42\u5199\u7684\u597d\u5904\u662f 1) \u4e1a\u52a1\u4e0d\u6539\u7684\u65f6\u5019\u4f60\u4e5f\u53ef\u4ee5\u91cd\u6784\u4ee3\u7801, \u4e0d\u9700\u8981\u6539\u6d4b\u8bd5, \u800c\u4e14\u6d4b\u8bd5\u8fd8\u80fd\u7ee7\u7eed cover, \u8fd9\u6837\u4f60\u5c31\u77e5\u9053\u91cd\u6784\u7684\u65f6\u5019\u4f60\u6ca1\u6539\u9519 2) \u5f88\u5bb9\u6613\u7406\u89e3\u548c\u9605\u8bfb, \u6807\u9898\u672c\u8eab\u90fd\u53ef\u4ee5\u5f53\u6587\u6863\u4e86.<\/p>\n<p>\u4e0d\u660e\u663e\u727a\u7272\u901f\u5ea6, \u5373\u50cf\u4e0a\u9762\u8bf4\u7684\u63d0\u9ad8\u7c92\u5ea6\u4e00\u822c\u90fd\u4f1a\u727a\u7272\u901f\u5ea6, \u6bd4\u5982\u5b8c\u5168\u7aef\u5bf9\u7aef\u5c31\u8981\u628a\u6570\u636e\u5e93\u4e4b\u7c7b\u7684\u5168\u8fde\u8d77\u6765, \u7279\u522b\u96be\u642d\u5efa, \u800c\u4e14\u8fd0\u884c\u7279\u522b\u6162, \u8fd8\u6ca1\u529e\u6cd5\u6bcf\u4e2a\u6d4b\u8bd5\u90fd\u6e05\u7406, \u975e\u5e38\u4e0d\u7a33\u5b9a. \u4f46\u662f\u5f88\u591a\u901a\u7528\u7ec4\u4ef6\u5176\u5b9e\u4e0d\u9700\u8981\u6d4b\u8bd5, \u6240\u4ee5\u53ef\u4ee5\u8ba9\u4ee3\u7801 mock \u6389\u8fd9\u4e9b. \u5178\u578b\u7684\u6bd4\u5982\u4f60\u6d4b\u8bd5\u4e00\u4e2a web server, \u5f88\u591a\u6280\u672f\u6808\u6d4b\u8bd5\u7684\u65f6\u5019\u4f1a\u771f\u7684\u628a server \u8dd1\u8d77\u6765\u76d1\u542c socket, \u90a3\u5176\u5b9e\u5c31\u975e\u5e38\u6d6a\u8d39, \u62d6\u6162\u4e86\u901f\u5ea6\u8fd8\u6d6a\u8d39\u4e86\u7aef\u53e3\u53f7. \u6b63\u786e\u7684\u505a\u6cd5\u662f, web server \u4e00\u822c\u5c31\u662f\u7ecf\u8fc7 middlewares \u7136\u540e\u6253\u5230 action \u4e0a, \u90a3\u4e48\u7406\u60f3\u7684\u6d4b\u8bd5\u662f\u53ea\u628a middlewares \u548c actions \u8dd1\u8d77\u6765, \u8df3\u8fc7\u771f\u6b63\u7684 socket \u76d1\u542c(\u56e0\u4e3a\u771f\u6ca1\u5565\u597d\u6d4b\u7684), \u8fd9\u6837\u65e2\u80fd\u6d4b\u6240\u6709\u903b\u8f91, \u4e5f\u50cf\u6240\u6709\u5185\u5b58\u4ee3\u7801\u4e00\u6837\u5feb(\u56e0\u4e3a middlewares \u548c actions \u5c31\u662f\u4e9b\u666e\u901a\u51fd\u6570).<\/p>\n<p>\u9664\u4e86 socket \u4e4b\u5916, \u6700\u5403\u6027\u80fd\u7684\u5c31\u662f\u6570\u636e\u5e93. \u4e0d\u8fc7\u6570\u636e\u5e93\u6bd4\u8f83 tricky\u2026 \u5982\u679c\u662f Redis \u8fd9\u79cd\u5176\u5b9e\u975e\u5e38\u5bb9\u6613 mock. \u4f46\u662f\u5982\u679c\u662f SQL \u8fd9\u79cd\u5c31\u5f88\u96be mock \u4e86, \u5982\u679c mock \u57fa\u672c\u4e0a\u7b49\u4e8e\u91cd\u5199\u4e00\u4e2a SQL, \u4e00\u822c\u6709\u51e0\u4e2a\u9009\u9879: 1) \u786c\u7740\u5934\u76ae mock repository \u6216\u8005 DAO, \u4e0d\u63a8\u8350, \u5f88\u591a\u5b58\u50a8\u548c\u5173\u8054\u7684\u903b\u8f91\u90fd\u88ab mock \u6389\u4e86, \u5f88\u5bb9\u6613\u5199\u51fa\u9519\u8bef\u7684\u6d4b\u8bd5 2) \u7528\u771f\u6570\u636e\u5e93, \u6bcf\u4e2a\u6d4b\u8bd5\u4e4b\u540e\u5220\u8868, \u4f46\u662f\u5e76\u884c\u6ca1\u4e86 3) \u7528 SQLite \u4e4b\u7c7b\u7684, \u4f46\u662f\u5fc5\u987b\u5f97\u6ce8\u610f\u548c\u771f\u6570\u636e\u5e93\u7684\u533a\u522b, \u6709\u65f6\u5019\u8981\u8eb2\u7740\u67d0\u4e9b\u529f\u80fd. \u6216\u8005\u50cf.Net Entity framework \u4e4b\u7c7b\u7684\u63d0\u4f9b\u4e13\u7528\u7684\u7684 SQL \u5185\u5b58\u5b9e\u73b0\u5c31\u5f88\u723d. 4) \u7ed9\u67d0\u4e9b\u6570\u636e\u5e93\u505a\u6c99\u7bb1\u673a\u5236, \u6bd4\u5982 Elixir \u7684 Ecto \u7528 Postgres \u4f46\u662f\u901f\u5ea6\u975e\u5e38\u5feb, \u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b\u6e90\u7801.<\/p>\n<p>\u4e3a\u4ec0\u4e48\u901f\u5ea6\u8fd9\u4e48\u91cd\u8981\u5462? \u56e0\u4e3a\u6d4b\u8bd5\u8dd1\u4e00\u5929\u4e5f\u8dd1\u4e0d\u5b8c, \u5c31\u6ca1\u4eba\u8dd1\u4e86. \u53ea\u5728 CI \u4e0a\u8dd1\u7684\u6d4b\u8bd5\u53ea\u80fd\u662f\u534a\u4e2a\u6d4b\u8bd5, \u5bf9\u5f00\u53d1\u672c\u8eab\u6ca1\u6709\u76ca\u5904. \u6d4b\u8bd5\u4e00\u4e2a\u76ee\u7684\u662f\u9a8c\u6536, \u53e6\u5916\u4e00\u4e2a\u76ee\u7684\u662f\u5f00\u53d1\u8fc7\u7a0b\u5185\u534f\u52a9\u5f00\u53d1(\u6bd4\u5982\u6bcf\u6539\u4e00\u6bb5\u4ee3\u7801\u4f60\u5c31\u80fd\u7acb\u523b\u77e5\u9053\u521a\u624d\u5199\u7684\u5bf9\u4e0d\u5bf9, \u4e0d\u5bf9\u53ef\u4ee5\u7acb\u523b debug). \u5982\u679c\u6d4b\u8bd5\u4e0d\u80fd\u5728\u5f00\u53d1\u8fc7\u7a0b\u91cc\u7ed9 dev \u5e2e\u52a9, dev \u5c31\u4f1a\u4e0d\u60f3\u5199\u6d4b\u8bd5.<\/p>\n<p>\u603b\u7684\u76ee\u6807\u5c31\u662f\u4ee5\u4e0a, \u6211\u4eec\u5185\u90e8\u628a\u8fd9\u4e2a\u53eb\u505a\u5199\u201c\u96c6\u6210\u98ce\u683c\u7684\u5355\u5143\u6d4b\u8bd5\u201d. \u6548\u679c\u5c31\u662f\u6d4b\u8bd5\u6570\u91cf\u76f8\u5bf9\u5c11, \u4e0d\u7528\u6539, \u8dd1\u5f97\u4e5f\u4e0d\u6162\u8fd8\u53ef\u4ee5\u5e76\u53d1.<\/p>\n<p>\u4e09: \u5206\u5c42\u76f8\u5173.<\/p>\n<p>\u5f88\u591a UT \u4f1a\u5206\u5f88\u591a\u5c42, \u6bd4\u5982 model \u6d4b\u8bd5, service \u6d4b\u8bd5, controller \u6d4b\u8bd5, integration \u6d4b\u8bd5\u7b49\u7b49. \u5f88\u591a\u4e13\u4e1a\u7684\u56e2\u961f\u4f1a\u63d0\u6d4b\u8bd5\u91d1\u5b57\u5854, \u603b\u5f97\u6765\u8bf4\u5c31\u662f\u5927\u91cf\u7ec6\u7c92\u5ea6, \u4e2d\u91cf\u4e2d\u7c92\u5ea6, \u5c11\u91cf\u5927\u7c92\u5ea6, \u5f88\u591a\u91d1\u5b57\u5854\u751a\u81f3\u4f1a\u6709\u516d\u4e03\u5c42. \u5176\u5b9e\u5206\u592a\u591a\u5c42\u6548\u679c\u5e76\u4e0d\u597d &#8211; \u4f1a\u51fa\u73b0\u5f88\u591a\u4f60\u8bf4\u7684\u5df2\u7ecf\u6d4b\u8fc7\u4e00\u904d, \u7ed3\u679c\u53c8\u6d4b\u4e00\u904d\u7684\u60c5\u51b5. \u4f46\u662f\u53cd\u8fc7\u6765\u5982\u679c\u4e0d\u6d4b\u4e24\u8fb9\u53c8\u4e0d\u80fd\u4fdd\u8bc1\u5408\u8d77\u6765\u662f\u5bf9\u7684. <\/p>\n<p>\u800c\u4e14\u5206\u5f88\u591a\u5c42\u4e4b\u540e, \u540c\u6837\u7684\u6d4b\u8bd5\u53ef\u80fd\u8981\u5199\u56db\u4e94\u904d&#8230; \u8fd9\u6837\u5de5\u4f5c\u91cf\u592a\u5927, \u4e00\u5b9a\u4f1a\u6709\u4eba\u5c31\u4f1a\u8df3\u8fc7\u67d0\u4e9b\u5c42\u5199\u6d4b\u8bd5, \u8fd9\u6837\u6bcf\u4e2a\u4eba\u770b\u4ee3\u7801\u5e93\u90fd\u4e0d\u77e5\u9053\u5e94\u8be5\u5199\u54ea\u4e9b\u5c42\u4e86. \u6240\u4ee5\u6211\u7684\u5efa\u8bae\u662f\u4e00\u4e24\u5c42\u5de6\u53f3, \u6700\u591a\u4e0d\u8d85\u8fc7\u4e09\u5c42. \u8fd9\u4e2a\u8981\u5728\u7ec4\u91cc\u9762\u8ba8\u8bba\u597d, \u5927\u5bb6\u5c31\u5b9a\u6b7b\u4e00\u5b9a\u5199, \u6216\u8005\u4e00\u5b9a\u4e0d\u5199. <\/p>\n<p>PS: \u6709\u65f6\u5019\u6d4b\u8bd5\u6709\u9a71\u52a8\u8bbe\u8ba1\u7684\u6548\u679c, \u6bd4\u5982\u6240\u6709\u4eba\u903b\u8f91\u90fd\u5199\u5728 controller \u91cc\u5bfc\u81f4\u5f88\u591a\u8bbe\u8ba1\u95ee\u9898, \u60f3\u628a\u903b\u8f91\u5728 model \u91cc\u9762\u8868\u8fbe\u51fa\u6765, \u90a3\u4e48\u53ef\u4ee5\u5b9a\u6b7b\u6240\u6709\u4eba\u4e00\u5b9a\u8981\u5199 model \u6d4b\u8bd5, \u8fd9\u6837\u903b\u8f91\u5c31\u4f1a\u6162\u6162\u81ea\u52a8\u56de\u5230 model \u5c42\u91cc. \u4f46\u662f\u6ce8\u610f\u50cf\u4e0a\u9762\u8bf4\u7684\u5f04\u592a\u591a\u5c42.<\/p>\n<p>UI \u6216\u8005\u8868\u73b0\u5c42\u76f8\u5173\u7684\u6700\u540e\u4e00\u6b65\u53ef\u4ee5\u7701\u6389, \u6d4b\u7ed9\u4ee3\u7801\u6d88\u8d39\u7684\u6700\u5916\u5c42. \u6bd4\u5982\u4f60\u5728\u524d\u7aef\u6709\u4e2a view + redux store, \u90a3\u53ea\u7528 action \u548c selector \u6d4b\u4e1a\u52a1, \u56e0\u4e3a\u5b83\u4eec\u662f. UI \u53ef\u4ee5\u8df3\u8fc7\u7684\u539f\u56e0\u662f\u56e0\u4e3a UI \u662f\u7ed9\u4eba\u7528\u7684, \u6240\u4ee5\u5f88\u96be\u6d4b\u4e14\u4e0d\u7a33\u5b9a, \u6bd4\u5982\u53d1\u8bf7\u6c42\u6309\u94ae\u53d8\u5316, \u6d4b\u4ee3\u7801\u63a5 promise \u5c31\u597d\u4e86, \u4f46\u662f\u7eaf\u6d4b UI \u5c31\u53ea\u80fd\u8f6e\u8be2, \u4e00\u65e6\u5931\u8d25\u5c31\u8981\u6b7b\u7b49 N \u79d2 timeout.<\/p>\n<p>\u56db: Mock<\/p>\n<p>Mock \u4ec5\u7528\u4e8e web server \u4e4b\u7c7b\u6ca1\u6709\u4e1a\u52a1\u610f\u4e49\u7684\u57fa\u7840\u8bbe\u65bd, \u4e0d\u8981\u7528\u4e8e\u4e1a\u52a1\u4ee3\u7801. \u4e0d\u7136 1) mock \u662f\u9519\u7684, \u6216\u8005\u67d0\u4e9b\u7ec6\u8282\u4e0d\u591f\u771f\u5bfc\u81f4\u6d4b\u8bd5\u6839\u672c\u662f\u9519\u7684 2) \u4ee3\u7801\u50f5\u5316 3) \u88ab mock \u6a21\u5757\u53d8\u4e86, \u4f9d\u8d56\u7684\u6a21\u5757\u6ca1\u6539.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134362\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YouLMAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7b49\u4f60\u7684\u4ee3\u7801\u4e00\u5e74\u521b\u9020 1 \u4ebf\u7f8e\u91d1\u8425\u6536\uff0c\u4f60\u5c31\u77e5\u9053 unittest \u7684\u542b\u4e49                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134363\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YouLMAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @namelosw \u4f60\u5f88\u5927\u8759\u8760\u8bf4\u7684\u662f\u96c6\u6210\u6d4b\u8bd5 e2e integration test                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134364\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : sockpuppet9527 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @YouLMAO #19 \u6211\u6ca1\u4efb\u4f55\u89c9\u5f97 UT \u4e0d\u597d\u7684\u610f\u601d\uff0c\u6211\u89c9\u5f97 UT \u5f88\u597d\uff0c\u8fd9\u91cc\u53ea\u662f\u8c08\u201c\u8fc7\u5ea6\u201d\u8fd9\u4ef6\u4e8b\u60c5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134365\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YouLMAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sockpuppet9527 \u4f60\u7684\u73b0\u72b6\u5e94\u8be5\u8fdc\u8fdc\u6ca1\u8fbe\u5230\u8fc7\u5ea6\u9636\u6bb5\u5427, \u770b\u770b Apache \u9876\u7ea7\u9879\u76ee, \u5979\u4eec\u5176\u5b9e\u5df2\u7ecf\u662f\u4e1a\u754c\u77e5\u540d\u4f46\u662f\u8986\u76d6\u7387\u8fd8\u662f\u633a\u4f4e\u7684, \u6bd4\u6211\u4eec\u5bb6\u7684\u4f4e\u5f88\u591a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134366\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ashuai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3a\u4ec0\u4e48\u6211\u7b2c\u4e00\u611f\u89c9\u89c9\u5f97\u8fd9\u662f 2077 [\u72d7\u5934]                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134367\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : namelosw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @YouLMAO \u6211\u8bf4\u7684\u4e0d\u662f\u96c6\u6210\u6d4b\u8bd5, \u800c\u4e14\u6211\u751a\u81f3\u5efa\u8bae\u5c3d\u91cf\u4e0d\u5199\u96c6\u6210\u6d4b\u8bd5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134368\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : petercui <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sockpuppet9527 UT \u4e0d\u9700\u8981\u8bbe\u8ba1\uff0c\u53ea\u9700\u8981\u4ea7\u751f\u786e\u5b9a\u7684\u8f93\u5165\uff0c\u7136\u540e\u9a8c\u8bc1\u4e00\u4e2a\u786e\u5b9a\u7684\u8f93\u51fa\u5c31\u53ef\u4ee5\u4e86\uff0c\u5982\u679c\u4f60\u52a8\u4e86\u67d0\u4e2a\u65b9\u6cd5\uff0c\u9020\u6210\u4e86 UT \u5931\u8d25\uff0c\u90a3\u4e48\u9996\u5148\u9700\u8981\u8003\u8651\u7684\u5e76\u4e0d\u662f\u53bb\u66f4\u6539 UT\uff0c\u800c\u662f\u8981\u8003\u8651\u8fd9\u4e2a\u65b9\u6cd5\u7684\u6539\u52a8\u4f1a\u4e0d\u4f1a\u9020\u6210\u5176\u5b83\u7ec4\u4ef6\u5f02\u5e38\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u65b9\u6cd5\u7684\u884c\u4e3a\u88ab\u6539\u53d8\u4e86\uff0c\u800c\u4e14\u5bf9\u5916\u90e8\u7cfb\u7edf\uff08\u8c03\u7528\u65b9\uff09\u4e5f\u9020\u6210\u4e86\u5f71\u54cd\uff08\u56e0\u4e3a\u4f60\u7684 UT \u5931\u8d25\u4e86\uff09\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134369\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YouLMAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\uff0c\u4f60\u63cf\u8ff0\u7684\u786c\u4ef6\u9a71\u52a8\uff0c\u660e\u663e\u5c5e\u4e8e\u96c6\u6210\u6d4b\u8bd5\u4e86\uff0c\u8ddf unittest \u6ca1\u6709\u4e00\u6bdb\u94b1\u5173\u7cfb\uff0c\u5355\u5143\u6d4b\u8bd5\u662f\u4e0d\u9700\u8981\u4efb\u4f55\u9a71\u52a8\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134370\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YouLMAO <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             C \u5efa\u8bae\u4f60\u4e0b\u8f7d gmock \u8bd5\u8bd5\uff0c\u5f88\u7b80\u5355\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134371\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lolding <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4eec\u4e13\u95e8\u505a c \u8bed\u8a00\u81ea\u52a8\u5316\u5355\u5143\u6d4b\u8bd5\u5de5\u5177\uff0c\u81ea\u52a8\u751f\u6210\u6d4b\u8bd5\u7528\u4f8b\uff0c\u8986\u76d6\u7387\u57fa\u672c\u4e0a\u90fd\u80fd\u591f\u8fbe\u5230 100%                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134372\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pkookp8 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4e00\u76f4\u4ee5\u4e3a ut \u662f\u7528\u6765\u8c03\u8bd5\u7684\uff0c\u51fa\u4e86\u95ee\u9898\u65b9\u4fbf\u8c03\u8bd5<br \/>\u66f4\u5927\u7c92\u5ea6\u7684\u6a21\u5757\u6d4b\u8bd5\uff0c\u7cfb\u7edf\u7ea7\u522b\u7684\u6d4b\u8bd5\u624d\u662f\u7528\u6765\u6d4b\u529f\u80fd\u7684<br \/>\u6709\u65f6\u5019\u5f88\u96be\u4e3a\u4e86 x==(z+y)\u7684\u7ed3\u679c\u8fd4\u56de true \u8fd8\u662f false \u800c\u53bb\u91cd\u65b0\u7f16\u8bd1\u4e00\u4e2a\u975e\u5e38\u5927\u7684\u5de5\u7a0b\uff0c\u518d\u53bb\u91cd\u65b0\u9a8c\u8bc1<br \/># x y z \u90fd\u662f\u4e34\u65f6\u4e2d\u95f4\u53d8\u91cf\uff0c\u4e14\u4ea7\u751f\u8fc7\u7a0b\u6bd4\u8f83\u590d\u6742\uff0c\u8f93\u5165\u503c\u5f88\u5c11\u4e5f\u5f88\u786e\u5b9a<br \/>\u5982\u679c\u6709 ut \u5c31\u65b9\u4fbf\u591a\u4e86<\/p>\n<p>\u5355\u5143\u6d4b\u8bd5\u53d1\u73b0\u7684\u95ee\u9898\uff0c\u901a\u5e38 review \u5c31\u80fd\u53d1\u73b0\u3002\u53d1\u73b0\u4e0d\u4e86\u7684\u95ee\u9898\u5f88\u591a\u90fd\u662f\u8fb9\u754c\u573a\u666f\u6ca1\u6709\u8003\u8651\u5168\u3002\u5373\u4f7f\u5199\u4e86 ut \u4e5f\u65e0\u6cd5\u4fdd\u8bc1\u529f\u80fd\u6ca1\u6709\u95ee\u9898<br \/>\u60f3\u60f3 leetcode \u52a8\u8f84\u51e0\u767e\u51e0\u5343\u51e0\u4e07\u4e2a\u6d4b\u8bd5\u7528\u4f8b\u6765\u9a8c\u8bc1\u4f60\u7684\u7b97\u6cd5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134373\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : johnsona <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u5199 \u660e\u5929\u5c31\u6539 \u5199\u4ec0\u4e48\u5199                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134374\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : petercui <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @pkookp8 \u529f\u80fd\u6d4b\u8bd5\u53ea\u662f\u4e00\u4e2a\u70b9\uff0c\u4f46\u8fd8\u6709\u66f4\u91cd\u8981\u7684\u4e00\u4e2a\u70b9\uff1a\u201c\u91cd\u6784\u201d\uff0c\u91cd\u6784\u540e\u7684\u4ee3\u7801\u548c\u91cd\u6784\u524d\u662f\u5426\u884c\u4e3a\u4e00\u81f4\uff0c\u5c31\u9760\u6d4b\u8bd5\u7528\u4f8b\u6765\u4fdd\u8bc1\uff0c\u53ea\u8981\u4f60\u539f\u6709\u7684\u6d4b\u8bd5\u7528\u4f8b\u80fd\u901a\u8fc7\uff0c\u54ea\u6015\u4f60\u8fd9\u4e2a\u7c7b\u5df2\u7ecf\u6ca1\u6709\u4efb\u4f55\u4e00\u884c\u4ee3\u7801\u8ddf\u91cd\u6784\u4e4b\u524d\u662f\u4e00\u6837\u7684\uff0c\u4e5f\u4e0d\u7528\u62c5\u5fc3\u4f1a\u5f71\u54cd\u5230\u8c03\u7528\u65b9\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5134375\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ReferenceError <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5199\u6d4b\u8bd5\u4e5f\u8981\u6709\u4e2a\u53ef\u884c\u7684 plan \u6392\u671f\u5427\u3002\u600e\u4e48\u611f\u89c9\u4f60\u5728\u8d76\u6d4b\u8bd5\uff1f<\/p>\n<p>\u5355\u8bf4\u671f\u671b\u6548\u679c\u7684\u8bdd\uff0c\u6d4b\u8bd5\u8986\u76d6\u5ea6\u8d8a\u5168\u8d8a\u597d\u53ea\u8981\u6709\u65f6\u95f4\u662f\u6ca1\u6bdb\u75c5\u7684\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u54ea\u4e2a\u529f\u80fd\u4e00\u5b9a\u4e0d\u4f1a\u51fa\u9519\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8c08\u8c08 unit test\uff1f \u8cc7\u6df1\u5927&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/292936"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=292936"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/292936\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292936"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}