关于测试覆盖率

一天清晨,一个年轻的程序员问大师:

“我准备写一些单元测试。我应该以什么样的代码覆盖率为目标?”

大师回答说:

“不要担心覆盖率,只要编写一些好的测试就可以了。”

年轻的程序员微笑着,鞠躬离开了。

那天晚些时候,另一个程序员问了同样的问题。

大师指着一壶沸腾的水说:

“那锅里该放多少粒米?”

程序员看起来很困惑,回答说:“我怎么能告诉你呢?这取决于你需要供养多少人,他们有多饥饿,你提供什么其他食物,你有多少大米,等等。”

“没错,” 大师说。

第二个程序员微笑着鞠躬离开了。

在这一天快结束的时候,第三个程序员来了,问了同样的关于代码覆盖率的问题。

“百分之八十以上!” 大师用拳头敲着桌子,严厉地说。

第三个程序员微笑着,鞠了个躬,离开了。

在回答完最后一个问题后,一个年轻的学徒走近大师:

“大师,今天我无意中听到您用三种不同的答案回答了相同的关于代码覆盖的问题。为什么?”

这位大师从椅子上站起来:“来和我一起喝点茶,我们来谈谈这件事。”

当他们斟满滚烫的绿茶后,这位大师开始说:

“第一个程序员是新人,刚开始测试。现在他有很多代码,却没有测试。他有很长的路要走;此时只关注代码覆盖率是令人沮丧的,也是毫无用处的。他只要习惯编写和运行一些测试就好了。他可以稍后再担心保险问题。

另一方面,第二名程序员在编程和测试方面都很有经验。当我问她一个锅里应该放多少粒米时,我帮助她意识到测试的必要程度取决于许多因素,而她比我更了解这些因素——毕竟这是她的代码。这个问题没有一个简单的答案,但她足够聪明,能够处理好这个问题。”

“我明白了,”年轻的学徒说,“但是如果没有一个简单的答案,那你为什么告诉第三个程序员 ‘百分之八十不能少于’ 呢?”

这位大师大笑得如此猛烈和响亮,以至于他的肚子——证明他喝的不仅仅是绿茶——上下扑通一声。

“第三个程序员只想要简单的答案——即使没有简单的答案……而且无论如何也不遵循它们。”

年轻的学徒和头发花白的大师在沉思的沉默中喝完了他们的茶。

360 thoughts on “关于测试覆盖率”

  1. Pingback: Reba Fleurantin
  2. Pingback: Beverly Bultron
  3. Pingback: Lila Lovely
  4. Pingback: Cory Chase MILFCity
  5. Pingback: premium-domain-broker
  6. Pingback: Write my essay
  7. Pingback: valentines gift
  8. Pingback: help allergies
  9. Pingback: valentines gift
  10. Pingback: organic bee sting
  11. Pingback: valentine gift
  12. Pingback: valentine gift
  13. Pingback: Click Here
  14. Pingback: Click Here
  15. Pingback: Click Here
  16. Pingback: Click Here
  17. Pingback: Click Here
  18. Pingback: Click Here
  19. Pingback: Click Here
  20. Pingback: Click Here
  21. Pingback: Click Here
  22. Pingback: Click Here
  23. Pingback: Click Here
  24. Pingback: Click Here
  25. Pingback: Click Here
  26. Pingback: Click Here
  27. Pingback: Click Here
  28. Pingback: Click Here
  29. Pingback: robots remote control
  30. Pingback: Click Here
  31. Pingback: Click Here
  32. Pingback: Click Here
  33. Pingback: Click Here
  34. Pingback: Reputation Defenders
  35. Pingback: Reputation Defenders
  36. Pingback: Click Here
  37. Pingback: Click Here
  38. Pingback: Click Here
  39. Pingback: Click Here
  40. Pingback: Click Here
  41. Pingback: Click Here
  42. Pingback: Click Here
  43. Pingback: Click Here
  44. Pingback: Click Here
  45. Pingback: Click Here
  46. Pingback: Click Here
  47. Pingback: Click Here
  48. Pingback: Click Here
  49. Pingback: Click Here
  50. Pingback: Click Here
  51. Pingback: Click Here
  52. Pingback: Click Here
  53. Pingback: grand rapids dentist
  54. Pingback: Click Here
  55. Pingback: Click Here
  56. Pingback: Click Here
  57. Pingback: Click Here
  58. Pingback: Click Here
  59. Pingback: Click Here
  60. Pingback: Click Here
  61. Pingback: Click Here
  62. Pingback: Click Here
  63. Pingback: Click Here
  64. Pingback: 카지노사이트
  65. Pingback: Click Here
  66. Pingback: Click Here
  67. Pingback: Click Here
  68. Pingback: Click Here
  69. Pingback: Click Here
  70. Pingback: Click Here
  71. Pingback: Click Here
  72. Pingback: Click Here
  73. Pingback: Click Here
  74. Pingback: Click Here
  75. Pingback: Click Here
  76. Pingback: Click Here
  77. Pingback: Click Here
  78. Pingback: Click Here
  79. Pingback: Click Here
  80. Pingback: Click Here
  81. Pingback: Click Here
  82. Pingback: Click Here
  83. Pingback: Click Here
  84. Pingback: Click Here
  85. Pingback: Click Here
  86. Pingback: Click Here
  87. Pingback: buy-premium-domains
  88. Pingback: best-domains
  89. Pingback: Google reviews
  90. Pingback: reputation defenders
  91. Pingback: 2023 Books
  92. Pingback: obituary
  93. Pingback: obituaries
  94. Pingback: burial place
  95. Pingback: death redcords
  96. Pingback: IRA Empire
  97. Pingback: Chirurgie Tunisie
  98. Pingback: Chirurgie Tunisie
  99. Pingback: Board Of Advisors fue
  100. Pingback: Global partnerships
  101. Pingback: Higher education
  102. Pingback: fue contact
  103. Pingback: Refereed articles
  104. Pingback: Dissolution apparatus
  105. Pingback: Emergency Dental Care
  106. Pingback: Computer Maintenance
  107. Pingback: media practitioners
  108. Pingback: Biochemistry
  109. Pingback: Msc in dental
  110. Pingback: Course Load
  111. Pingback: Political Science
  112. Pingback: Clinical dentistry
  113. Pingback: Future University
  114. Pingback: Maillot de football
  115. Pingback: Maillot de football
  116. Pingback: Maillot de football
  117. Pingback: SEOSolutionVIP Fiverr
  118. Pingback: SEOSolutionVIP Fiverr
  119. Pingback: SEOSolutionVIP Fiverr
  120. Pingback: SEOSolutionVIP Fiverr
  121. Pingback: hack squat machine
  122. Pingback: cage ufc
  123. Pingback: hip thrust machine
  124. Pingback: Fiverr Earn
  125. Pingback: Fiverr Earn
  126. Pingback: Fiverr Earn
  127. Pingback: Fiverr Earn
  128. Pingback: Fiverr Earn
  129. Pingback: Fiverr Earn
  130. Pingback: fiverrearn.com
  131. Pingback: fiverrearn.com
  132. Pingback: fiverrearn.com
  133. Pingback: fiverrearn.com
  134. Pingback: fiverrearn.com
  135. Pingback: Freight Broker
  136. Pingback: glucotrust mediprime
  137. Pingback: clothes manufacturer
  138. Pingback: fiverrearn.com
  139. Pingback: fiverrearn.com
  140. Pingback: fiverrearn.com
  141. Pingback: fiverrearn.com
  142. Pingback: springerdoodles
  143. Pingback: jute vs sisal rug
  144. Pingback: seo in Saudi Arabia
  145. Pingback: Piano Storage Units
  146. Pingback: Piano Moving Quotes
  147. Pingback: Piano Freight London
  148. Pingback: rescue french bulldog
  149. Pingback: fluffy french bulldog
  150. Pingback: sable french bulldog
  151. Pingback: french bulldog size
  152. Pingback: blockchain
  153. Pingback: sorority jewelry
  154. Pingback: fbofficial.ru
  155. Pingback: film
  156. Pingback: i.8ua.ru
  157. Pingback: future university
  158. Pingback: future university
  159. Pingback: future university
  160. Pingback: rolex hoodie
  161. Pingback: multisbo
  162. Pingback: bulldogs puppy
  163. Pingback: Fiverr.Com
  164. Pingback: top university Egypt
  165. Pingback: batmanapolloru
  166. Pingback: Warranty
  167. Pingback: Grand piano moving
  168. Pingback: FUE
  169. Pingback: FUE
  170. Pingback: FUE
  171. Pingback: FUE
  172. Pingback: Furniture protection
  173. Pingback: batmanapollo.ru
  174. Pingback: nlpvip.ru
  175. Pingback: FiverrEarn
  176. Pingback: Slovo pacana 6 seriya
  177. Pingback: FiverrEarn
  178. Pingback: site
  179. Pingback: Training Philippines
  180. Pingback: FiverrEarn
  181. Pingback: pupuk organik
  182. Pingback: partners
  183. Pingback: glucofreeze
  184. Pingback: arteris plus website
  185. Pingback: french bulldog
  186. Pingback: Predictions
  187. Pingback: FiverrEarn
  188. Pingback: FiverrEarn
  189. Pingback: live sex cams
  190. Pingback: live sex cams
  191. Pingback: live sex cams
  192. Pingback: FiverrEarn
  193. Pingback: FiverrEarn
  194. Pingback: FiverrEarn
  195. Pingback: FiverrEarn
  196. Pingback: FiverrEarn
  197. Pingback: FiverrEarn
  198. Pingback: french bulldog austin
  199. Pingback: FiverrEarn
  200. Pingback: FiverrEarn
  201. Pingback: FiverrEarn
  202. Pingback: FiverrEarn
  203. Pingback: FiverrEarn
  204. Pingback: FiverrEarn
  205. Pingback: FiverrEarn
  206. Pingback: FiverrEarn
  207. Pingback: Queen Arwa University
  208. Pingback: FiverrEarn
  209. Pingback: FiverrEarn
  210. Pingback: FiverrEarn
  211. Pingback: FiverrEarn
  212. Pingback: Farm
  213. Pingback: Link
  214. Pingback: Lightroom Presets
  215. Pingback: seo company tampa
  216. Pingback: marketing
  217. Pingback: Slot Gacor hari ini
  218. Pingback: Scientific Research
  219. Pingback: Kuliah Termurah
  220. Pingback: FiverrEarn
  221. Pingback: FiverrEarn
  222. Pingback: FiverrEarn
  223. Pingback: FiverrEarn
  224. Pingback: site 2024
  225. Pingback: 123 Movies
  226. Pingback: 000
  227. Pingback: samorazvitiepsi
  228. Pingback: psy
  229. Pingback: cheap sex cams
  230. Pingback: Carlson Putin
  231. Pingback: fullersears.com
  232. Pingback: fullersears.com
  233. Pingback: fullersears.com
  234. Pingback: dog probiotics
  235. Pingback: french bulldog
  236. Pingback: live sex cams
  237. Pingback: live sex cams
  238. Pingback: rare breed-trigger
  239. Pingback: 늑대닷컴
  240. Pingback: Pola slot
  241. Pingback: One Peace AMV
  242. Pingback: One Peace AMV
  243. Pingback: allgame
  244. Pingback: 918kiss
  245. Pingback: หวย24
  246. Pingback: Hair care
  247. Pingback: pg slot
  248. Pingback: leak detection london
  249. Pingback: AI Lawyer
  250. Pingback: regles 421
  251. Pingback: cybersécurité
  252. Pingback: catskills hotel
  253. Pingback: 300 wsm ammo
  254. Pingback: 35 whelen ammo
  255. Pingback: contratar sicario
  256. Pingback: itsMasum.Com
  257. Pingback: itsMasum.Com
  258. Pingback: Nangs delivery
  259. Pingback: Nangs delivery 24/7
  260. Pingback: url
  261. Pingback: itsmasum.com
  262. Pingback: itsmasum.com
  263. Pingback: chat with strangers
  264. Pingback: roleplay chat
  265. Pingback: itsmasum.com

发表评论