Angularでのテスト戦略

7cefa75d40cb0bfbe9c6a834050a5a9d?s=47 Kitagawa
January 31, 2019

 Angularでのテスト戦略

2019/1/31 Classi AngularNight#1でLTした資料です

7cefa75d40cb0bfbe9c6a834050a5a9d?s=128

Kitagawa

January 31, 2019
Tweet

Transcript

  1. $0/'*%&/5*"- "OHVMBSͰͷςετઓུ $MBTTJ"OHVBMS/BJHIU גࣜձࣾτϨλɹ!LJUBHBXB

  2. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ ג ࣜ ձ ࣾ τ Ϩ λ

  3. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ Έͳ͞Μςετॻ͍ͯ·͔͢ʁ

  4. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ ςετΛॻ͍͍ͯͳ͍ݴ͍༁ ͕࣌ؒͳ͍͔Β ը໘࢓༷͕͙͢มΘΔ͔Β

  5. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ ͱ͸͍͑ɺ ςετ͕ͳ͍ͱෆ҆

  6. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ ػೳ௥Ճͯ͠΋յΕ͍ͯͳ͍͔҆৺ײ͕ཉ͍͠ ୠ͠શίϯϙʔωϯτͷςετΛॻ͘༨༟͸ͳ͍ ςετ͕ෛ࠴ʹͳΒͳ͍Α͏ʹ͍ͨ͠ ςετʹٻΊΔ͜ͱ

  7. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ ԿͷςετΛͲΕ͘Β͍ॻ͚͹͍͍ͷ͔ʁ

  8. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ 6OJU5FTU *OUFHSBUJPO5FTU &&5FTU 5IF5FTU1ZSBNJE more integration more isolation

    ࢀরIUUQTNBSUJOGPXMFSDPNBSUJDMFTQSBDUJDBMUFTUQZSBNJEIUNM Slower Faster
  9. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ 5IF5FTU5SPQIZ ࢀরIUUQTUFTUJOHKBWBTDSJQUDPN IUUQTCMPHLFOUDEPEETDPNXSJUFUFTUTOPUUPPNBOZNPTUMZJOUFHSBUJPOFD⒎GD The Testing Trophy is a

    bottom-to-top professional method for testing web applications. It’s about writing just enough tests—the right tests. It’s not about reaching for 100% coverage.
  10. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ 7BMVF $PNQPOFOU )5.- $PNQPOFOU $PNQPOFOU ✔ ✔ ✔

    7BMVF $PNQPOFOU )5.- $PNQPOFOU $PNQPOFOU ✔ *OUFHSBUJPO5FTU 6OJU5FTU 4IBMMPX5FTU 㲈
  11. ෛ࠴ʹͳͬͨ

  12. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ Կ͕ࣦഊͩͬͨͷ͔ ❌*OUFHSBUJPO5FTUͷ੹຿Λ௒͑͗͢ ❌ςετ͕յΕ΍͍͢

  13. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ 4OBQTIPUςετ͕͍͍Α

  14. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ εφοϓγϣοτͷςετ͸UI ͕༧ظͤͣมߋ͞Ε͍ͯͳ ͍͔Λ͔֬ΊΔͷʹඇৗʹ༗༻ͳπʔϧͰ͢ɻ A typical snapshot test case

    for a mobile app renders a UI component, takes a snapshot, then compares it to a reference snapshot file stored alongside the test. The test will fail if the two snapshots do not match: either the change is unexpected, or the reference snapshot needs to be updated to the new version of the UI component. 4OBQTIPU5FTUJOH ਐߦத EJWDMBTTIPVS TQBO  TQBO EJW EJWDMBTTIPVS TQBO  TQBO EJW 4OBQTIPU 3FDFJWFE
  15. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ ςετΛҭͯΔ Coverage 100% 50%

  16. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ αΠΫϧΛճ͢ 4OBQTIPU5FTUJOH 3FGBDUPSJOH 6OJU5FTUJOH

  17. $0/'*%&/5*"-5PSFUB*OD "MM3JHIU3FTFSWFEɹ ·ͱΊ 4OBQTIPUςετͰखܰʹ৴པੑΛ୲อ ϦϑΝΫλˠ6OJUςετΛ૿΍͍ͯ͘͠ Ξ δ Σ ϯ μ

  18. !PLVOPLFOUBSP !UFZPTI 4QFDJBM5IBOLT

  19. None