????2???????????????????????????????????

?????????????????и?????????????mock??????????????????????????????????????????????

????????private??????????????????÷???????

????????????????????????????????????????????????bug????Σ??????????????

???????????????????????????????????????????????????????????????????????п????????????Щ????

???????磬??????????Mockito?????????????????mock??????????????????У???????????get/set????????????????????鷳??

??????????????????????????????????????????е?get/set???????????????????????????????????????????????

???????UT?????????????review????????????????????????UT?п??????????????????????????????????????????????????????

????3?? ??????????????????????ν???????????????

???????????????UT????????????????????????????????“????”??

???????磬???????????????????????????

public class app{
public void method1(){
String testString = method2()?? //???????е????????????
}
public String method2(){
}
}

?????????????????????д?????????method1????????method1Test??????????mock???????????????mock????????????????mock??

????????????????????????????e??????????????????????mock??????????????????????

????????????mock???????÷????(?????????????????)???????????????????????????????????

???????????????????????????????????????????????????????????mock?????????÷??????????????????????????????й?????

?????????????????????????????仯????????????????????????????????????????????????У???????????????????????????

????????г?????????????????????????????????????????д????

?????????????UT???????Χ??????????????????????????????????????????????mock??????????????????????

???????????????????????????????????????????????mock????????????????????е????

??????????? Integration Test

??????????????壺

????An integration test is done to demonstrate that different pieces of the system work together. Integration tests cover whole applications?? and they require much more effort to put together. They usually require resources like database instances and hardware to be allocated for them. The integration tests do a more convincing job of demonstrating the system works (especially to non-programmers) than a set of unit tests can?? at least to the extent the integration test environment resembles production.

????????

????1????????????????????м???????

????2???????????????????????????????????????????????????UT??????????????????????????"????????????"??????

????3???????????Χ?????????Χ????С????????????UT case???漰????????????????????????????????????????????????????Integration tests can be performed at the unit level or the system level.

??????????????????漰??????????????????????????

????4???????????????????????????ɡ?

????HP's (mercury) QTP or Borland's Silktest ????????????????????????????

???????????????????????????????CI (Continuous Integration)

??????????????????CI?????????????????????CI ????????????????????

????CC(CruiseContoller)?? ??????????CI????????

????Hudson ??????????μ?CI?????http??//hudson-ci.org/