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

チームで取り組みテスト改善のあゆみ

negiandleek
September 08, 2021

 チームで取り組みテスト改善のあゆみ

negiandleek

September 08, 2021
Tweet

More Decks by negiandleek

Other Decks in Programming

Transcript

  1. ࠜ؛ ༐໻ SmartHR ϓϩμΫτΤϯδχΞ ʗSmartHR ຊମʗओʹWebϑϩϯτΤϯυʢReact + TypeScriptʣ • 2020೥9݄SmartHRೖࣾ

    • SmartHRຊମͰݱࡏ͸ओʹ༧໿ػೳͷ։ൃΛߦͳ͍ͬͯΔ • ւ͕޷͖ͳͷͰւ͕͍ۙͱ͜ΖʹҾͬӽͨ͠ @negiandleek
  2. - νʔϜߏ੒ - ΤϯδχΞ5ਓ - ϑϩϯτΤϯυ1ਓ - όοΫΤϯυ4ਓ - QA1ਓ

    - ։ൃ͸LeSS(εΫϥϜͷେ͖͍൛)ͷϑϩʔʹԊͬͯΔ - εϓϦϯτظؒ͸1िؒ ։ൃମ੎ 🏢
  3. - QAͷϦιʔε໰୊ - ։ൃऀ:QA=5: 1 - ݄ͱՐʹQAλεΫ͕ଟ͘ൃੜ͢Δ - ςετઓུ͕ͳ͔ͬͨ -

    ࣗಈςετͱϚχϡΞϧςετͰॏෳͯ͠ΔՕॴ͕͋Δ - ࣗಈςετ͕଍Γͯͳ͍͜ͱ΋ଟʑ ՝୊ͷৄࡉ *νʔϜᴈ໌ظͩͬͨͷͰ՝୊͸΄͔ʹ΋΋Ζ΋Ζ͋ͬͨ…
  4. Jest Integration Testͷ؀ڥ੔උ - JestͱReact Testing Librar y - MSW(Mock

    Service Worker)ͷಋೖ - Browser/Node྆ํͰ࢖͑Δ - APIͷ࣮૷଴ͪ΋ͳ͘ͳΔͳͲͷϝϦοτ΋͋Δ - એݴతʹఆٛͰ͖ΔͷͰ࢖͍΍͍͢
  5. +FTU*OUFHSBUJPO5FTUͱ&&ͱϚχϡΞϧςετͷͲΕͰ୲อ͢Δ͔ϧʔϧΛ໌֬ʹ͢Δ - Jest Integration Test Ͱ΍ͬͨํ͕͍͍ςετ(RECOMMEND ) - First Fetch(ϖʔδͷॳճදࣔ)Ͱ׬݁͢Δ΋ͷ͸Jest

    Integration Tes t - ύλʔϯ͕ෳ਺͋Δ৔߹͸ɺϋοϐʔύεΛE2EͰߦ͍ɺ࢒ΓͷόϦΤʔγϣϯ͸Jest Ͱ୲อ͢Δ - Ϣʔβʔૢ࡞͕൐͏͕ɺRequest͕ൃੜ͠ͳ͍΋ͷ͸Jest Integration Tes t - όϦσʔγϣϯ΍ϘλϯͷDisabledଐੑ - Jest Integration Test Ͱ͋Δͱخ͍͠ςετ(OPTIONAL) - E2 E - ϚχϡΞϧςετ
  6. +FTU*OUFHSBUJPO5FTUͱ&&ͱϚχϡΞϧςετͷͲΕͰ୲อ͢Δ͔ϧʔϧΛ໌֬ʹ͢Δ - Jest Integration Test Ͱ΍ͬͨํ͕͍͍ςετ(RECOMMEND ) - First Fetch(ϖʔδͷॳճදࣔ)Ͱ׬݁͢Δ΋ͷ͸Jest

    Integration Tes t - ύλʔϯ͕ෳ਺͋Δ৔߹͸ɺϋοϐʔύεΛE2EͰߦ͍ɺ࢒ΓͷόϦΤʔγϣϯ͸Jest Ͱ୲อ͢Δ - Ϣʔβʔૢ࡞͕൐͏͕ɺRequest͕ൃੜ͠ͳ͍΋ͷ͸Jest Integration Tes t - όϦσʔγϣϯ΍ϘλϯͷDisabledଐੑ - Jest Integration Test Ͱ͋Δͱخ͍͠ςετ(OPTIONAL ) - E2 E - ϚχϡΞϧςετ
  7. +FTU*OUFHSBUJPO5FTUͱ&&ͱϚχϡΞϧςετͷͲΕͰ୲อ͢Δ͔ϧʔϧΛ໌֬ʹ͢Δ - Jest Integration Test Ͱ΍ͬͨํ͕͍͍ςετ(RECOMMEND ) - First Fetch(ϖʔδͷॳճදࣔ)Ͱ׬݁͢Δ΋ͷ͸Jest

    Integration Tes t - ύλʔϯ͕ෳ਺͋Δ৔߹͸ɺϋοϐʔύεΛE2EͰߦ͍ɺ࢒ΓͷόϦΤʔγϣϯ͸Jest Ͱ୲อ͢Δ - Ϣʔβʔૢ࡞͕൐͏͕ɺRequest͕ൃੜ͠ͳ͍΋ͷ͸Jest Integration Tes t - όϦσʔγϣϯ΍ϘλϯͷDisabledଐੑ - Jest Integration Test Ͱ͋Δͱخ͍͠ςετ(OPTIONAL ) - E2 E - ϚχϡΞϧςετ
  8. +FTU*OUFHSBUJPO5FTUͱ&&ͱϚχϡΞϧςετͷͲΕͰ୲อ͢Δ͔ϧʔϧΛ໌֬ʹ͢Δ - Jest Integration Test Ͱ΍ͬͨํ͕͍͍ςετ(RECOMMEND ) - Jest Integration

    Test Ͱ͋Δͱخ͍͠ςετ(OPTIONAL ) - 400ܥ - E2EͰग़དྷͳ͍΋ͷ(ΠϨΪϡϥʔ͕ଟ͍ͷͰյΕͳ͍͜ͱͷ֬ೝ ) - APIΛୟ͍ͨ࣌ͷRequest BodyͳͲͷΞαʔγϣϯ - ϦϑΝΫλϦϯά౳͢ΔͷͰ͋Ε͹͋ͬͨํ͕҆৺ - E2 E - ϚχϡΞϧςετ
  9. +FTU*OUFHSBUJPO5FTUͱ&&ͱϚχϡΞϧςετͷͲΕͰ୲อ͢Δ͔ϧʔϧΛ໌֬ʹ͢Δ - Jest Integration Test Ͱ΍ͬͨํ͕͍͍ςετ(RECOMMEND ) - Jest Integration

    Test Ͱ͋Δͱخ͍͠ςετ(OPTIONAL ) - 400ܥ - E2EͰग़དྷͳ͍΋ͷ(ΠϨΪϡϥʔ͕ଟ͍ͷͰյΕͳ͍͜ͱͷ֬ೝ ) - APIΛୟ͍ͨ࣌ͷRequest BodyͳͲͷΞαʔγϣϯ - ϦϑΝΫλϦϯά౳͢ΔͷͰ͋Ε͹͋ͬͨํ͕҆৺ - E2 E - ϚχϡΞϧςετ
  10. +FTU*OUFHSBUJPO5FTUͱ&&ͱϚχϡΞϧςετͷͲΕͰ୲อ͢Δ͔ϧʔϧΛ໌֬ʹ͢Δ - Jest Integration Test Ͱ΍ͬͨํ͕͍͍ςετ(RECOMMEND ) - Jest Integration

    Test Ͱ͋Δͱخ͍͠ςετ(OPTIONAL ) - 400ܥ - E2EͰग़དྷͳ͍΋ͷ(ΠϨΪϡϥʔ͕ଟ͍ͷͰյΕͳ͍͜ͱͷ֬ೝ ) - APIΛୟ͍ͨ࣌ͷRequest BodyͳͲͷΞαʔγϣϯ - ϦϑΝΫλϦϯά౳͢ΔͷͰ͋Ε͹͋ͬͨํ͕҆৺ - E2 E - ϚχϡΞϧςετ
  11. +FTU*OUFHSBUJPO5FTUͱ&&ͱϚχϡΞϧςετͷͲΕͰ୲อ͢Δ͔ϧʔϧΛ໌֬ʹ͢Δ - Jest Integration Test Ͱ΍ͬͨํ͕͍͍ςετ(RECOMMEND ) - Jest Integration

    Test Ͱ͋Δͱخ͍͠ςετ(OPTIONAL ) - E2 E - ਖ਼ৗܥ - Mutationܥ(Post, Patch, Delete ) - ੍ޚܥ(ݖݶ΍ೝূͳͲ ) - ϚχϡΞϧςετ
  12. +FTU*OUFHSBUJPO5FTUͱ&&ͱϚχϡΞϧςετͷͲΕͰ୲อ͢Δ͔ϧʔϧΛ໌֬ʹ͢Δ - Jest Integration Test Ͱ΍ͬͨํ͕͍͍ςετ(RECOMMEND ) - Jest Integration

    Test Ͱ͋Δͱخ͍͠ςετ(OPTIONAL ) - E2 E - ϚχϡΞϧςετ - Ұ෦ਖ਼ৗܥͱɺσβΠϯपΓ - ΠϨΪϡϥʔܥ(ෳ਺λϒ)΍όοΫάϥ΢ϯυॲཧͷ݁ՌͳͲ