Slide 1

Slide 1 text

ΫϦʔϯΞʔΩςΫνϟͱTDDͷதͰ GitHub CopilotΛ࢖ͬͯΈͨʂ @͚ͨΖ͍Ͳ Tech Talk #14

Slide 2

Slide 2 text

͜Μʹͪ͸ʂ
 ୈೋ։ൃΦϓγϣϯαϒνʔϜ ʹॴଐ͍ͯ͠·͢ɻ ͚ͨΖ͍Ͳ @takenokoroid

Slide 3

Slide 3 text

ճઢʹ෇ਵ͢ΔΦϓγϣϯαʔ ϏεΛӡ༻ɾอक͍ͯ͠·͢ɻ ͚ͨΖ͍Ͳ @takenokoroid https://security.nifty.com/sec24/

Slide 4

Slide 4 text

ΫϦʔϯΞʔΩςΫνϟʹଇΓ ։ൃΛߦ͍ͬͯ·͢ɻ ͚ͨΖ͍Ͳ @takenokoroid https://amzn.asia/d/0auO8rM

Slide 5

Slide 5 text

࠷ۙ͸TDDͰ։ൃΛਐΊ͍ͯ͘ Α͏ʹ΋͍ͯ͠·͢ɻ ͚ͨΖ͍Ͳ @takenokoroid https://marsner.com/blog/why-test-driven-development-tdd/

Slide 6

Slide 6 text

ෳࡶͳ֊૚ߏ଄ɾϜϥͷ͋Δς ετ͕ͭΒ͍ʙ ͚ͨΖ͍Ͳ @takenokoroid

Slide 7

Slide 7 text

ෳࡶͳ֊૚ߏ଄ɾϜϥͷ͋Δς ετ͕ͭΒ͍ʙ ͚ͨΖ͍Ͳ @takenokoroid @takenokoroid ๻͕खॿ͚ͯ͋͛͠ΔΑʂ Copilot @copilot @copilot Ϛʁ ͚ͨΖ͍Ͳ @takenokoroid

Slide 8

Slide 8 text

- ෳࡶͳ֊૚ߏ଄ - ґଘؔ܎͕DIPʹΑΓҰ෦ෳࡶԽ - ॳݟ߈ུΉΓΆʢֶशίετ૿ʣ ෳࡶͳ֊૚ߏ଄ͷ໰୊

Slide 9

Slide 9 text

ෳࡶͳ֊૚ߏ଄ͷ໰୊ ࣮ ૷ ґଘؔ܎ υϝΠϯ஌ࣝ ࠓ೔ͷ༦൧ ਓੜઃܭ ࢥ͍΍Γ

Slide 10

Slide 10 text

ෳࡶͳ֊૚ߏ଄ͷ໰୊ ࣮ ૷ ґଘ ؔ܎ υϝΠϯ஌ࣝ ࠓ೔ͷ༦൧ ਓੜઃܭ ࢥ͍΍Γ

Slide 11

Slide 11 text

- ςετίʔυͷϜϥ - ݸਓͷखบ΍ࢥ૝Ͱςετίʔυͷॻ͖ํ͕Ұ෦ҟͳΔ - ϨϏϡʔίετ͕૿Ճ͢Δ - ݸਓͷεΩϧʹΑͬͯςετ͕มԽ͢Δෆ݈શͳঢ়ଶʹ ςετίʔυͷϜϥͷ໰୊

Slide 12

Slide 12 text

def test_must_bill_in_bill_month(self): subscription = Subscription( ... ) # mockͷઃఆ ... test_cases: list[dict] = [ { ... } ] for test_case in test_cases: with self.subTest(test_case["name"]): # ࣮ߦ actual = ... # ݺͼग़͠ςετ self.assertEqual(...) # returnͷςετ self.assertEqual(...) UsecaseͷςετͰ େ͖ͳҧ͍͕ ςετέʔεͷॻ͖ํʹ஫໨

Slide 13

Slide 13 text

def test_subscription_is_active_with_single_entry(self): # ਖ਼ৗܥ:αϒεΫϦϓγϣϯ͕ACTIVE׌ͭ1݅ͷ࣌ request_value = { ... } rs = ..., ɹwith self.app.app_context(): # ਖ਼ৗܥ result = self.interactor.handle( request=request_value["request"], _txs=request_value["transaction"], ) # ฦΓ஋͕True͔Ͳ͏͔ΛνΣοΫ self.assertEqual(...) self.assertEqual(...) def test_subscription_is_active_with_single_entry(self): # ਖ਼ৗܥ:αϒεΫϦϓγϣϯ͕ACTIVE׌ͭ2݅Ҏ্ͷ࣌ ... UsecaseͷςετͰ େ͖ͳҧ͍͕ ͪ͜ΒͰ͸ςετέʔε͝ͱ ʹϝιουΛ෼͚͍ͯΔ

Slide 14

Slide 14 text

- ෳࡶͳ֊૚ߏ଄ - ґଘؔ܎͕೴ͷϝϞϦΛѹഭͯ͠ɺίʔυ΁ͷࢥ͍΍Γ͕ඈͿ - ࣮૷࣌ʹർΕΔ - ςετίʔυͷϜϥ - ϨϏϡʔ͕ਏ͍ - ݸਓͷεΩϧʹΑ࣭͕ͬͯมΘΔෆ݈શͳঢ়ଶʹ ໰୊఺·ͱΊ

Slide 15

Slide 15 text

- ෳࡶͳ֊૚ߏ଄ - ґଘؔ܎͕೴ͷϝϞϦΛѹഭͯ͠ɺίʔυ΁ͷࢥ͍΍Γ͕ඈͿ - ࣮૷࣌ʹർΕΔ - ςετίʔυͷϜϥ - ϨϏϡʔ͕ਏ͍ - ݸਓͷεΩϧʹΑ࣭͕ͬͯมΘΔෆ݈શͳঢ়ଶʹ ໰୊఺·ͱΊ

Slide 16

Slide 16 text

ෳࡶͳ֊૚ߏ଄ʹରͯ͠Copilot͸Ͳ͏ͩͬͨ ࣮ ૷ ґଘ ؔ܎ υϝΠϯ஌ࣝ ࠓ೔ͷ༦൧ ਓੜઃܭ ࢥ͍΍Γ

Slide 17

Slide 17 text

ෳࡶͳ֊૚ߏ଄ʹରͯ͠Copilot͸Ͳ͏ͩͬͨ ࣮ ૷ ґଘؔ܎ υϝΠϯ஌ࣝ ࠓ೔ͷ༦൧ ਓੜઃܭ ࢥ͍΍Γ ґଘؔ܎ ΞϧΰϦζϜ etc..

Slide 18

Slide 18 text

- ৭ʑͳॻ͖ํ͕Ͱ͖ͯ͠·ͬͨςετίʔυ - ϨϏϡʔ΍ίʔυϦʔσΟϯά͕೉͘͠... ςετίʔυͷϜϥʹର͠Copilot͸Ͳ͏ͩͬͨ

Slide 19

Slide 19 text

- طଘςετίʔυͷίϯςΩετΛཧղ͠ఏҊͯ͘͠ΕΔ - ίʔυ͕౷Ұ͞ΕɺϨϏϡʔ͠΍͘͢ͳͬͨ ςετίʔυͷϜϥʹର͠Copilot͸Ͳ͏ͩͬͨ

Slide 20

Slide 20 text

- ͔ͬ͠Γͱλϒ؅ཧ͠ίϯςΩετΛಡΈࠐ·ͤΔ - ։ൃऀࣗ਎΋࣮૷ʹूதͰ͖ΔΑ͏ʹͳͬͨ - ໨త΍ҙਤΛߟ͑ɺͦΕΛ఻͑Δͷ͕ओʹͳͬͨ ςετίʔυͷϜϥʹର͠Copilot͸Ͳ͏ͩͬͨ

Slide 21

Slide 21 text

- ଟॏԽͨ͠֊૚ߏ଄ͷͳ͔Ͱ΋ޮՌతʹಇ͍ͨ - ΤϯδχΞ͸֓೦Λཧղ͠ɺಛఆͷϑΝΠϧΛ։͚ͩ͘Ͱྑ͍ - ஸೡͳίϝϯτΛߟ͑ͨΓͱʮࢥ͍΍Γʯͷ͕࣌ؒ૿͑ͨ - ςετίʔυ͸ϨϏϡϫʔʹ༏͘͠ͳͬͨ - λϒ؅ཧΛҙࣝ͢Δ͜ͱͰ࣮૷ʹूதͰ͖Δ - ίʔυͷҙਤ΍໨తͰձ࿩͢Δ͜ͱ͕ҎલΑΓ૿Ճͨ͠ ·ͱΊ

Slide 22

Slide 22 text

Copilot͸͍͍ͧ ͚ͨΖ͍Ͳ @takenokoroid