???????????????????????????μ????????
????CheckoutActivity??????????????Robolectric???????????????Activity??????????mCheckoutModel??loadCheckoutData()?????????????????????????ID????????
????CheckoutModel??loadCheckoutData???????1??????CheckoutModel??loadCheckoutData()??????????????mApi?????get????????????????????????
????CheckoutModel??loadCheckoutData???????2??mock Api???????????get??????????Щ??????????????????callback??onSuccess????????????CheckoutModel??loadCheckoutData()?????????Otto bus??post?????????????????????????
????CheckoutModel??loadCheckoutData???????3??mock api???????????get??????????Щ??????????????????callback??onFailure????????????CheckoutModel??loadCheckoutData()?????????Otto bus??post?????????????????????????
????CheckoutActivity??onCheckoutDataLoaded???????1????????CheckoutActivity??????????onCheckoutDataLoaded()????????????????Event??????????????view?????????
????CheckoutActivity??onCheckoutDataLoaded???????2????????CheckoutActivity??????????onCheckoutDataLoaded()???????д????????Event????????????????view??????????
??????????????????????????????????????????????е???????????????????????????????????????????????????????????
?????????????????????github???groupshare???package???檔
??????????????
????????????????????????????????????????????????????????????????????????
??????Щ??????????????
????1?????е?Model??Presenter/ViewModel??Api??Utils?????public????
????2??Data?????getter??setter??toString??hashCode???????????????????????????
????3???????View??????????set data???text?????????????????????????????click??????????????????????touch?????????????
????4??Activity??????????????view????????????????????????????????????????????????????????onTouch?????view???????λ????????????????ò?
????CI??code coverage?? Jacoco
????????????????????CI???????????????????????????Jenkins??CI server????ο?????push????master branch?????????????ε???????gradle task???????Jacoco??code coverage??
?????????и??????????????????????gradle Jacoco?????Jenkins??Jacoco?????????????????????gradle Jacoco?????7.1??????汾??????????????????Jenkins??Jacoco??????1.0.19?????汾???????汾??jenkins plugin??????汾??gradle Jacoco????汾?????????????Jenkins??Jacoco?????????????

?????????????????????????????????????????????????????????μ????????????????
??????????????????practice????
?????????????????????????Щ???????Щ???practice???顣
????1. Native libary
???????????JUnit????Robolectric?????????load native library????UnsatisfiedLinkError?????????????????????????????native lib??????????????System.loadLibrary????try catch??
?????????????????????????lib?????????????native lib?????????????????????????????native lib????????????????????????????????????mock????????????Robolectric??????????????shadow class??
??????????????????????????????????????????????????????????????????????wrapper?????е?????????????????????????????????????д?????????????????????????????????????????
????????????????????static method?? final class/method????mock??????????
????2. ????д?????????????
????static method?????new object??singleton??Global state?????Щ?????Щ??????????????????t????????????????????????Щ?????
????3. ?????????unit test
???????????????????builder??????????????????builder?????validator????validate?Щ?????????????????????builder??validator??????????????????????????????validator??????builder??????????????????Ч?????Ч?????????????
????????????????????????Validator????????????????Validator?????????Builder????????????????????????????????????????builder?????????Validator?????
????4. ????????????library
????????????????????????????????????????????????????????????????????????Щ??????helper??utils??rules??????????????????д????????????
????5. ?????????“??java”????copy????????????????
?????????????Щ????????????????????????TextUtils??Color??????Щ?????????????copy????????????????????棬??????????????????????????????android???????????JUnit??????Robolectric?????????test??????
????6. ??????JUnit Rule??????
????JUnit Rule???????????????????????????????????????????????????????????????????????Щ???顣??????ü??????????????к???????setup??teardown????????????????????ü?У????@Before??@After??????duplication????????????????JUnit Rule???????????????????ü?У??????????и??????????
???????磬?????????Activity??method???????????ActivityRule??????????????????????target Activity???????????????finish???activity??