Upgrade to Pro — share decks privately, control downloads, hide ads and more …

乱数をテストするときの心構え

Ad37f739bffa0e38c8461e452cb3a489?s=47 yamacraft
September 30, 2016

 乱数をテストするときの心構え

2016年9月30日(金)に開催されたAndroid Testing Bootcamp #4にて発表した資料です。

Ad37f739bffa0e38c8461e452cb3a489?s=128

yamacraft

September 30, 2016
Tweet

Transcript

  1. ཚ਺Λςετ͢Δͱ͖ ͷ৺ߏ͑ @yamacraft

  2. profile • @yamacraft (Wataru Yamada) • LeadingMark, inc / team

    Y.G.E. • Mobile Application Engineer
  3. ζϯυίΩϤγ ήʔϜ • ྫͷΞϨΛήʔϜԽͨ͠Ξ ϓϦ • Google Play Game ServiceରԠʂ

    • https://play.google.com/ store/apps/details? id=jp.yamaglo.yge.zundo kogame
  4. ʮζϯorυίʯ෦෼ͷ ςετΛೖΕ͍ͨʂ

  5. ʮζϯorυίʯͷ࢓༷ • ϘλϯλοϓͷλΠϛϯάͰZunDokoΫϥεΛੜ੒͢Δ • ZunDoko.idͰʮζϯʯͱʮυίʯΛ൑ผͯ͠σΟεϓϨΠʹग़ྗ • id͸ੜ੒࣌ʹϥϯμϜͰ0͔1͕୅ೖ͞ΕΔ • 0͔1͔͸50:50 •

    ʮ100ճZunDokoΫϥεΛੜ੒ͨ͠ͱ͖ʹid=0͕50ɺid=1͕ 50ʹͳΔ͔ʯ ← ͍΍ɺͪΐͬͱ……
  6. ཚ਺ΛςετͰ͖Δͷʁ

  7. ౴͑͸3೥લʹ௨ա͍ͯͨ͠ • ϥϯμϜʹৼΔ෣͏ػೳΛ JUnit ͢Δ #ौ୩Java ୈ̏ճ • https://speakerdeck.com/komiya_atsushi/ randamunizhen-ruwu-uji-neng-wo-junit-suru-number-

    shibui-gu-java-di-3hui • ԾઆݕఆʗΧΠೋ৐ݕఆ • BaseMatcherͷ֦ுΫϥε΋ • https://gist.github.com/komiya-atsushi/6736271
  8. ͱ͍͏Θ͚Ͱಋೖ • https://gist.github.com/komiya-atsushi/6736271 ͸ͦͷ··AndroidͷJUnit4Ͱ΋ར༻Մೳ • Apache Commons MathΛ࢖͍ͬͯΔͷͰ testCompileͰ௥Ճ͓ͯ͘͠

  9. ࢖ͬͯΈΔ • id=0ͱid=1ͷ਺͕50:50Ͱ༗ҙਫ४Λ5ˋʹઃఆͯ͠ ςετΛ࣮ࢪ

  10. ஫ҙ఺ • ཚ਺ੜ੒ͷΞϧΰϦζϜ࣍ୈͰςετ௨աͨ͠Γ͠ͳ͔ͬ ͨΓ͢Δ • ࢼߦճ਺ͱ༗ҙਫ४ͷௐ੔ʹ͸஫ҙ • ଟ͗ͯ͢ςετʹ͕͔͔࣌ؒΔՄೳੑ • ༗ҙਫ४͕ΏΔ͗ͯ͢໰୊ʹؾ͔ͮͳ͍Մೳੑ

    • ʮཚ਺ͷ׬ᘳͳςετ͸Ͱ͖ͳ͍ʯͱ͍͏௿͍ҙࣝΛ΋ͬ ͯऔΓ૊΋͏
  11. ͓͠·͍ • https://gist.github.com/komiya-atsushi/6736271 • ϥϯμϜʹৼΔ෣͏ػೳΛ JUnit ͢Δ • https://speakerdeck.com/komiya_atsushi/ randamunizhen-ruwu-uji-neng-wo-junit-suru-number-

    shibui-gu-java-di-3hui • org.hamcrest.BaseMatcherΛ֦ுͯ͠assertThat()Ͱ࢖͏ • http://d.hatena.ne.jp/ihiroky/20090916/1253076366