???????????????Щ??
???????????? ???????[ 2015/10/14 13:22:01 ] ??????????????????
??????????????????????????????????Щ??????λ?????????????????????????????????TDD??????????е???????????????????????????????С?
????1????????????????????
????Quora??????????????In Test Driven Development?? how do unit tests help drive good design?
????Ken Beck??????????
????TDD doesn't drive good design. TDD gives you immediate feedback about what is likely to be bad design. If a test is hard to write?? if a test is non-deterministic?? if a test is slow?? then something is wrong with the design. When I'm not ready to make good design decisions?? I still don't end up with a good design?? but I certainly know I have room for improvement.
??????????????TDD????????????????????TDD???в???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????鱾???????????????????????????????????????????????????????????д?????????
??????????????????м????????????
????-???????λBug?????????????????д???????????
????-???????????????????????????Bug???????
????-??????????????????
????2??????к?????д??????????
???????????????????????????к?????д?????????????????????????????:
????-?????????????????????????????????????????????д??????д????????
????-?д??????????????????????????
????-?д??????????????????б???е???????????????????
????-???????????????Ч????
??????????????????????????????
????3??????д????????
???????????????????????????????????????Щ??????????????????á?Junit Recipes??????J. B. Rainsberger???????
????1.When writing a test?? start with what you want to check?? then write just enough code to compute that result.
????2.Don't perform multiple actions in the same test. Test one action at a time.
????3.Don't assume that you have to group tests for the same function or object together.
????4.Don't test the platform; worry about your stuff.
????4?????????????????????
??????д???????????????????????????????????????????
????1.??????????????????????????????????????????????UT?????Щ??????????????????UT??????????????????UT????????????????
????2.??????????????????£?????????????????????UT??
????3.???????С?????????????д????????
??????????????????????????????????????????????????е????????????????????????????????????Э?????????????????????????????????????????????????????????????????????????????????????????
????5??????
????????????????????????????????????????????????????????????????????????????????????UT???????????????????????????UT?????????????????????????????????????????????????????????????????????????????????????????а??ж??UT?????????????е?????????????д???????????????????????????????????????????UT??????????????
??????????棬??????????????????????UT?????????????UT?? UT??????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11