????????????
?????ecmadao ???????[ 2016/9/20 14:00:08 ] ??????????????? ???????
????????????????
???????????????????????????????????????漰??????????????????????????????????漰??????????????????????????????????????????????д?????????????????????????????????????????????????????????
??????????ò??????????£?
????· ???????????????
????· ??????????????TDD???????е?????
????Intro
????????????????????
?????????????????????????????
????????????????????????????
??????????????????????????????
????--- ???????????
????????????????????????????
????· ???????????
????· ???????????????????
????· too many??????
????· too many???????
????· ??????
????· ??????????
????TDD(Test-driven development)
??????????????????TDD??????????·??????????????????????????С?
????· ?????????????????????????д?????????????????????????????????????(??????)???????????????????????????????????????????????????
????· ????????ζ?????????????????????????????????????????????????????????????
????· ??????????????С??????д
????· ???????????
????· ???????????????????????????1?????????????????????????????2??3??4??????????????????????£????????????????
????IMPORTANT
????· ????????????TDD?????????
????· ?????????????????????
????· ?????????????????????????д??????
????· ?????????????????????-> ??????д?????????????-> ????????????????????????
???????1???
????1?????????????????????????“???”???????????????????????????????????????????λ?????????????Σ??????????????????????????????????????????????????????????????????
????2?????????ò??????
????3?????????????????
????4??????????????
????· ?????????????????
????· Not Repeat Self
????· ??ж???????
????· ???????
????BDD(Behavior-driven development)
?????????????????BDD???????????????????????????????????????????????????????? ?????????
???????1???
????1???????????????????????????????
????2?????????????趨?????????????????Щ????????
????3???????????????????????????????е?????????????????????Щ???????Щ???????????????????????μ???塣???磬 expect ?? should ?? assert
????4???????????????????????????????
????5??????????????????н???????????????????????????????????????????????????′?????????
???????????? & ???????
????????
????· API/Func UnitTest
????????????仯????????
????????????API???
????· UI UnitTest
?????????????
???????DOM?????
???????????????
????????
????· Mocha + Chai
????· PhantomJS or CasperJS or Nightwatch.js
????· selenium
????with python
????with js
????mocha + chai ??API/Func UnitTest
????mocha??????????????????????????????????????????
??????chai????BDD/TDD??????????????expect???????????
??????
???·???
??????????????????
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