DroidKaigi 2019 - Day2 Room1 11:20ã ãSpek2+MockK+JaCoCoã§ã¤ã±ã¦ã Unit Testç°å¢ãæã«å ¥ããï¼ãã®ã»ãã·ã§ã³è³æã§ã
ããã«ã¡ã¯ãYenom Androidã¨ã³ã¸ãã¢ã®ããã(@yuikijp)ã§ãããã®Yenoméçºè ããã°ã®æ å½ã§ãããã¾ãã Yenomã§ã¯Android/iOSå ±ã«ã³ã¼ãã«ãã¬ãã¸ãBitriseã«ã¦è¨æ¸¬ããCodecovãç¨ãã¦GitHubã®PRã§ã³ã¼ãã«ãã¬ãã¸ã¬ãã¼ããé²è¦§ã§ããããã«ãã¦ãã¾ãã ä»åã¯Androidã¢ããªã®ããã¸ã§ã¯ãã§ã®ã³ã¼ãã«ãã¬ãã¸è¨æ¸¬ã®ä»çµã¿ä½ãã«ã¤ãã¦ã話ãã¾ãã JaCoCoã®å°å ¥ JaCoCoã¨ã¯Javaã®ã³ã¼ãã«ãã¬ãã¸è¨æ¸¬ã©ã¤ãã©ãªã§ãã ä»åã¯jacoco-android-gradle-pluginãå°å ¥ãã¾ãã ããã¯ãJaCoCoã®å°å ¥ãåã³Build Variantsçã®Androidã¢ããªã®ããã¸ã§ã¯ãç¨ã®è¨å®ãè¡ã£ã¦ããããã®ã§ããå®ã¯ãã®è¨å®ãçµæ§ç ©éã§ãã¤ã©ã¼ãã¬ã¼ããªçºããã©ã°ã¤ã³ã«ãã¾ãããã¾ãã ãã¦ãæ©éãã©ã°ã¤ã³ã
https://developer.android.com/training/testing/start/index.html src/test/java 以ä¸ã«æ¸ãã¦ãããã¹ãã¯ã"Local Unit Test"ã¨ããããã§ãã ä¸æ¹ãsrc/androidTest/java 以ä¸ã«æ¸ããã¹ãã¯ã"Instrumented Test"ã¨ããããã§ãã ä»ã®ããã¸ã§ã¯ãã§ã¯ããã¹ãã®å®è¡é度ãåªå ãã¦"Local Unit Test"ãæ¸ãã¦ãããã¾ããã®ã«ãã¬ãã¸ãåå¾ãããã¨ãã¦ãã¾ãã ãªã®ã§ããã®è¨å®ãã¾ã¨ãã¾ããã å®éã«ã¯ã https://blog.gouline.net/code-coverage-on-android-with-jacoco-92ec90c9355e#.elikwgbjp ã«æ¸ãã¦ãããã¨ãã»ã¨ãã©ã§ãã æçµçã«è¨å®ãããã®ãã https://git
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}