Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Androidアプリの 安全なリファクタリングを行うパターン集
Search
HiroYUKI Seto
October 19, 2021
Programming
2
4.9k
Androidアプリの 安全なリファクタリングを行うパターン集
DroidKaigi 2021 Day1
2021/10/19
HiroYUKI Seto
October 19, 2021
Tweet
Share
More Decks by HiroYUKI Seto
See All by HiroYUKI Seto
UI TestやVisual Regression Testを コスパ良くやる
seto_hi
3
1.8k
事業支援というお仕事
seto_hi
0
400
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.7k
CoordinatorLayoutのBehaviorを使い倒す
seto_hi
1
350
Jetpack Compose
seto_hi
2
720
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.6k
MDCのButtonのCorner Family
seto_hi
1
150
MDCのBottomAppBarのShadowの実現方法
seto_hi
0
920
Kyashは なぜ使いやすいのか
seto_hi
1
2.4k
Other Decks in Programming
See All in Programming
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
190
CSC305 Lecture 26
javiergs
PRO
0
140
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
660
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
事業成長を爆速で進めてきたプロダクトエンジニアたちの成功談・失敗談
nealle
3
1.4k
From Translations to Multi Dimension Entities
alexanderschranz
2
130
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
200
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
talk-with-local-llm-with-web-streams-api
kbaba1001
0
170
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Embracing the Ebb and Flow
colly
84
4.5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Automating Front-end Workflow
addyosmani
1366
200k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Six Lessons from altMBA
skipperchong
27
3.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
It's Worth the Effort
3n
183
28k
Transcript
גࣜձࣾϊϋφɹށ༏೭ "OESPJEΞϓϦͷ ҆શͳϦϑΝΫλϦϯάΛߦ͏ύλʔϯू
)JSP:6,*4FUP גࣜձࣾϊϋφ .PCJMF5FDI-FBE "OESPJE&OHJOFFS !TFUP@IJ !IJSPZVLJTFUP
None
w ίʔυϕʔεͷ৽ํ๏ൺֱ w ϑϧεΫϥονͱϦϑΝΫλϦϯά w ϦϑΝΫλϦϯάͰى͜Γ͕ͪͳͱରࡦ w ҆શͳϦϑΝΫλϦϯάͱ w .7$ΞϓϦͷ҆શͳϦϑΝΫλϦϯά
ΞδΣϯμ
͡Ίʹ
w ඞͣϦϑΝΫλϦϯάͰίʔυΛͤʂͱࢥ͍ͬͯͳ͍ w ϝϦοτσϝϦοτΛߟ͑Δ͖ w ڥɾ໘ʹΑͬͯҟͳΔ w εΫϥονͱϦϑΝΫλϦϯάͷΈ߹Θͤ˕ w ࠓճϦϑΝΫλϦϯάͷࣦഊΛݮΒ͢ϙΠϯτͷհ
w ઈରʹࣦഊ͠ͳ͘ͳΔํ๏ͳ͍ ͡Ίʹ
w ςετΛॻ͜͏ w ഁյతมߋͨ͠Βͦͷ෦Λݕূ͠Α͏ ൃදͷཁ
ίʔυϕʔεͷ৽ํ๏ൺֱ
w طଘίʔυΛࣺ͔ͯͯΒཧܕʹॻ͖͢ w ˓͕͠ΒΈ͕ͳ͘։ൃग़͍͢ w ˚৽نόάΛࠐΉՄೳੑ w ˚ݱߦ༷͕ѲͰ͖͍ͯͳ͍ͱ͍͠ w ༷Λ֬ೝ͢Δ͕࣌ؒඞཁ
w ҙਤ͠ͳ͍σάϨͷՄೳੑ ϑϧεΫϥον
w طଘίʔυΛॻ͖͑ͯཧܕʹ͍࣋ͬͯ͘ w ˓༷ΛѲ͍ͯ͠ͳͯ͘Ͱ͖Δ w ϦϑΝΫλͯ͠ίʔυ͔Β༷ΛಡΈղ͘ w ˚৽نόά طଘόάʹۤ͠ΉՄೳੑ w
˚طଘ࣮ʹҾͬுΒΕͯ։ൃ͕ग़ͳ͍Մೳੑ ϦϑΝΫλϦϯά
ൺֱද ϑϧεΫϥον ϦϑΝΫλϦϯά ɾ։ൃ গ ։ൃ˓ ଟ ։ൃ˚ ༷ҡ࣋
˚ ҙਤ͠ͳ͍σάϨΛ͢ΔՄೳੑ ˓ όά ΤϯόάͷՄೳੑ Τϯόά طଘόάΛܧଓͷՄೳੑ ͦͷଞ ݱঢ়༷ΛѲ͍ͯ͠ͳ͍ͱ ࣮͠ͳ͕Β༷Ѳ͔Մ
ϦϑΝΫλϦϯάͰ ى͜Γ͕ͪͳͱରࡦ
w ֎෦ಈ࡞༷Ϣʔβʔʹݟ͑Δಈ࡞ w ඇഁյతมߋ w ෦ಈ࡞ʹӨڹ͕ͳ͍ϝιουΫϥεͷཧ w ഁյతมߋ w ෦ಈ࡞มΘ͕ͬͨ֎෦ಈ࡞༷มΘ͍ͬͯͳ͍߹
w ྫɿΞϧΰϦζϜมߋɺ+TPO1BSTFSมߋ w ෦ಈ࡞֎෦ಈ࡞༷มΘΔ߹ w ྫɿ༷มߋɺϥΠϑαΠΫϧมߋɺϝϞϦϦʔΫमਖ਼ ඇഁյతมߋഁյతมߋ
w ͱʹ͔͘طଘಈ࡞͕յΕΔ w ͪΐͬͱม͚͑ͨͩͳͷʹյΕͨ w յΕͳ͍ͣͷमਖ਼ͰյΕͨ w ఆ֎ͷ෦͕ಈ͔ͳ͘ͳͬͨ ى͜Γ͕ͪͳ
w ఆ͍ͯ͠ͳ͍ഁյతมߋ w ϦϑϨΫγϣϯɺੜίʔυͷࢀর w ϥΠϒϥϦͷΞοϓσʔτ w $IBOHFMPHʹͳ͍मਖ਼ w ଞΞϓϦ'SBNFXPSLͱͷ࿈ܞ
w ݕূ͕͍͠ w ϥΠϑαΠΫϧɺඇಉظॲཧ w ෳ߹తͳཁҼ ఆ֎ͷݪҼ ରࡦ͍͠
w ݕূΛखް͘Εग़ʹ͘͘ͳΔ w 㱻ݕূϦιʔε͕ඞཁʹͳΔ w ഁյతมߋʹΑͬͯಈ࡞͕յΕ͍ͯΔ w ඇഁյతมߋͰಈ࡞มΘΒͳ͍ w ݕূΛബͯ͘͠ग़ʹ͍ͣ͘
w ഁյతมߋΛݕূ͢Ε͕ݟ͔ͭΓ͍ͣ͢ w ෦ಈ࡞͕ҙਤͨ͠௨Γ w ֎෦ಈ࡞༷͕ҙਤͨ͠௨Γ ݪҼੳͱରࡦ
w ഁյతมߋඇഁյతมߋΛ໌֬ʹ͢Δ w मਖ਼ޙͷಈ࡞ΛݕূͰ͖Δঢ়ଶʹ͢Δ w ՄೳͳݶΓࣗಈςετͰݕূ͢Δ w ഁյతมߋΛͨ͠Λݕূ͢Δ w ෦ಈ࡞͕ҙਤͨ͠ͷͰ͋Δ͜ͱ
w ෦ಈ࡞Λม͑ͯ֎෦ಈ࡞༷͕ಉҰͰ͋Δ͜ͱ w ֎෦ಈ࡞༷͕ҙਤͨ͠ͷͰ͋Δ͜ͱ ҆શͳϦϑΝΫλϦϯά
w ҆શͳϦϑΝΫλϦϯάͷͨΊʹܭըΛཱͯΔ w ணखલʹΰʔϧ·ͰͷεςοϓΛׂ͢Δ w ΰʔϧͷํੑ͕ͳ͍ঢ়ଶͰ໎͕ͪ͠ w ഁյతมߋඇഁյతมߋΛࠞͥͳ͍ w εςοϓͷഁյతมߋΛগͳ͘͢Δ
w ݕূΛ؆୯ʹ͢ΔͨΊ εςοϓׂ
w ✅ͦͷεςοϓʹΑͬͯݕূ͕Ͱ͖ΔΑ͏ʹͳΔ͔ w ✅ഁյతมߋ͔ w ✅Ͳ͕͜ഁյతมߋ͔ w ✅ഁյతมߋʹݕূํ๏͕͋Δ͔ εςοϓׂνΣοΫϙΠϯτ
w 㲈ςετ͕ॻ͚ΔΑ͏ʹͳΔ͔ w ϦϑΝΫλϦϯά͢ΔͳΒࢦ͖͢ΰʔϧ w ࣗಈςετͰಈ࡞อূͰ͖Εखಈͷݕূίετ͕ݮΔ w मਖ਼ͨ͠ίʔυ͕ҙਤͨ͠ಈ࡞Λ͍ͯ͠Δ͔ͷݕূ w ඇഁյతมߋͳΒಈ࡞ʹมߋͳ͍ͣ
w ݕূΛՃͤͣઌͷ։ൃΛٻΊΔ͜ͱՄ ✅ݕূ͕Ͱ͖ΔΑ͏ʹͳΔ͔
w ಈ࡞͕มΘ͕ͬͨ͋Δ͔ w ෦ಈ࡞มΘ͕ͬͨ֎෦ಈ࡞༷มΘ͍ͬͯͳ͍߹ w ෦ಈ࡞֎෦ಈ࡞༷มΘΔ߹ ✅ഁյతมߋ͔
w ෦࣮ w εΫϥον։ൃ w ΞϧΰϦζϜมߋ w ґଘϥΠϒϥϦมߋ w +BWBˠ,PUMJOͷOVMMBCJMJUZ
w ֎෦ಈ࡞༷ w "OESPJEͷϥΠϑαΠΫϧมߋ w ΞϓϦͷ༷ ✅Ͳ͕͜ഁյతมߋ͔
w ෦ಈ࡞มΘ͕ͬͨ֎෦ಈ࡞༷มΘ͍ͬͯͳ͍߹ w มߋલͱมߋޙͷಈ࡞͕ಉҰͰ͋Δ͜ͱͷݕূ w ෦ಈ࡞֎෦ಈ࡞༷มΘΔ߹ w ҙਤ௨Γಈ͘͜ͱͷݕূ w ݕূํ๏
w ࣗಈςετ 6OJU5FTUɺ6*5FTUɺ7JTVBM3FHSFTTJPO5FTU w खಈςετͰͷݕূɺ2"Ͱͷݕূ w શͯͷมߋΛݕূ͢ΔͷෆՄ ✅ഁյతมߋʹݕূํ๏͕͋Δ͔
w ఆ͍ͯ͠ͳ͍ഁյతมߋ w ϦϑϨΫγϣϯɺੜίʔυͷࢀর w ϥΠϒϥϦͷΞοϓσʔτ w $IBOHFMPHʹͳ͍मਖ਼ w ଞΞϓϦ'SBNFXPSLͱͷ࿈ܞ
w ݕূ͕͍͠ w ϥΠϑαΠΫϧ w ෳ߹తͳཁҼ ఆ֎ͷݪҼ ରࡦ͍͠
w ϦΞʔΩςΫνϟͷࡍ "OESPJEͰσʔλ͔Βணख͢Δͱྑ͍ εςοϓׂUJQT ݹ͍%BUB ৽͍͠6* ݺͼग़͠ ෆ҆ఆͳ݁Ռ
ѻ͍ʹ͍͘ܕ ෆ҆ఆͳ݁Ռ Λߟྀ࣮ͨ͠
w ϦΞʔΩςΫνϟͷࡍ "OESPJEͰσʔλ͔Βணख͢Δͱྑ͍ εςοϓׂUJQT ৽͍͠%BUB ݹ͍6* ݺͼग़͠ ҆ఆͨ݁͠Ռ
6*৽ͷࡍ ҆ఆ࣮ͨ͠
.7$ΞϓϦͷϦϑΝΫλϦϯά
w IUUQTHJUIVCDPNIJSPZVLJTFUPESPJELBJHJTBNQMF w NBJO͕ݩͷίʔυ w ϦϑΝΫλϦϯάͨ͠ͷͰ13 w ϘλϯΛԡ͢ͱ௨৴ͯ͠ 3FTQPOTF$PEFΛදࣔ
αϯϓϧϦϙδτϦ
αϯϓϧίʔυ ελʔτ ΰʔϧ ΞʔΩςΫνϟ .7$ .77. 3FDPNNFOEFE"QQ"SDI 7JFXૢ࡞
"DUJWJUZͰૢ࡞ %BUB#JOEJOH ""$7JFX.PEFM -JWF%BUB ௨৴ॲཧ "DUJWJUZʹͨॻ͖ 3FNPUF%BUBTPVSDF ඇಉظॲཧ "TZOD5BTL %FQSFDBUFE $PSPVUJOF
w IUUQTEFWFMPQFSBOESPJEDPNKFUQBDLHVJEFSFDPNNFOEFEBQQBSDI 3FDPNNFOEFE"QQ"SDIJUFDUVSF
αϯϓϧίʔυ 'SBHNFOU "TZOD5BTL 8FCTFSWJDF 'SBHNFOU 7JFX.PEFM 3FQPTJUPSZ 3FNPUF%BUB4PVSDF 8FCTFSWJDF
-JWF%BUB ελʔτ ΰʔϧ
αϯϓϧίʔυ ελʔτ 'SBHNFOU
3FNPUF%BUBTPVSDFͷ࡞ 3FQPTJUPSZͷ࡞ 7JFX.PEFMͷಋೖ -JWF%BUBͷಋೖ .77.Խ
$PSPVUJOFԽ εςοϓׂ
4UFQ3FNPUF%BUB4PVSDFͷ࡞ 'SBHNFOU "TZOD5BTL 8FCTFSWJDF 3FNPUF%BUB4PVSDF 8FCTFSWJDF #FGPSF "GUFS 'SBHNFOU
"TZOD5BTL
4UFQ3FNPUF%BUB4PVSDFͷ࡞
w ඇഁյతมߋ w ॲཧͷΫϥεΓग़͠ͷΈ w 0L)UUQ$MJFOUΛΫϥεมʹ͕ͨ͠ɺ4UFQͷ࣮ͳΒඇഁյత w 3FNPUF%BUB4PVSDFͷΠϯελϯεΛ͍ճ͢ͱഁյత 4UFQ3FNPUF%BUB4PVSDFͷ࡞
w ௨৴෦ͷ࣮͕ෛ࠴ͳ͜ͱଟʑ w ϦϑΝΫλ͢Δʹ w ςετΛॻ͍ͯϦΫΤετϨεϙϯεͷQBSTF݁ՌΛอূ͢Δ w ෛ࠴ΫϥεΛॻ͖͍͑ͯ͘ w NPDLLͷTMPUΛͬͯ௨৴पΓͷෛ࠴ղফͷϦϑΝΫλϦϯάΛ͢Δ
w IUUQTRJJUBDPNIJSPZVLJTFUPJUFNTFFCGFG ༨ஊ௨৴෦ॻ͖͍͑ͨ
ϒϥοΫϘοΫεͷ͠ํ ϒϥοΫϘοΫε ݺͼग़͠ ݁Ռ 8SBQQFSΫϥε ݺͼग़͠ ݺͼग़͠ ݁Ռ ݁Ռ
ςετͰอূ ςετ ݺͼग़͠ ݁Ռ ྑ͍࣮ ݺͼग़͠ ݁Ռ "OESPJEςετશॻ1/FUXPSL6UJMTͷྫ
4UFQ3FQPTJUPSZͷ࡞ 3FQPTJUPSZ 8FCTFSWJDF #FGPSF "GUFS 'SBHNFOU "TZOD5BTL 3FNPUF%BUB4PVSDF 3FNPUF%BUB4PVSDF
8FCTFSWJDF 'SBHNFOU "TZOD5BTL
4UFQ3FQPTJUPSZͷ࡞
w ඇഁյతมߋ w ΫϥεΓग़͠ͷΈ w ݕূͷՃ w 6OJU5FTU͕ॻ͚ΔΑ͏ʹͳΔ 4UFQ3FQPTJUPSZͷ࡞
6OJU5FTU
4UFQ7JFX.PEFMͷಋೖ 3FQPTJUPSZ 8FCTFSWJDF #FGPSF "GUFS 'SBHNFOU "TZOD5BTL 3FNPUF%BUB4PVSDF 3FQPTJUPSZ
8FCTFSWJDF 'SBHNFOU "TZOD5BTL 3FNPUF%BUB4PVSDF 7JFX.PEFM
4UFQ7JFX.PEFMͷಋೖ 'SBHNFOU
4UFQ7JFX.PEFMͷಋೖ w ֎෦ಈ࡞༷ಉҰͳഁյతมߋ w ճͷ࣮ߦ࣌ʹ3FQPTJUPSZ͕͍ճ͞ΕΔ w ഁյతมߋͷݕূ w ճͷ࣮ߦ֎෦ಈ࡞༷͕ಉҰͰ͋Δ͜ͱ
w 6*5FTUɺखಈςετͳͲ w ʮճͷ࣮ߦͰҙਤͨ͠ಈ࡞ʯͷ6*5FTUෆໟͳͷͰखಈ͕Α͍
w ϦϑΝΫλϦϯάͷ్தͰઃܭͱͯ͠ඍົʹͳΔ͜ͱ w ʮݕূ͢ΔͨΊʯʮ࠷ऴతʹ៉ྷʹͳΔʯͱׂΓΔ w தؒঢ়ଶͷ··Ͱ์ஔઈରʹආ͚Δ w ࠷ॳʹνʔϜϝϯόʔʹमਖ਼ํΛڞ༗͢Δ ϙΠϯτதؒঢ়ଶΛݏ͕Βͳ͍
4UFQ-JWF%BUBͷಋೖ 'SBHNFOU 7JFX.PEFM 3FQPTJUPSZ 3FNPUF%BUB4PVSDF 8FCTFSWJDF -JWF%BUB #FGPSF "GUFS
3FQPTJUPSZ 8FCTFSWJDF 'SBHNFOU "TZOD5BTL 3FNPUF%BUB4PVSDF 7JFX.PEFM "TZOD5BTL
4UFQ-JWF%BUBͷಋೖ 'SBHNFOU "TZOD5BTL 7JFX.PEFM
w ֎෦ಈ࡞༷มΘΔഁյతมߋ w PO4UBSUͱPO4UPQͷ͔ؒ͠6*͕ө͞Εͳ͍ w ݕূͷՃ w 6OJUςετ w -JWF%BUBʹ͕ೖ͍ͬͯΔ͜ͱͷ֬ೝ
w ഁյతมߋͷݕূ w खಈ֬ೝ w ࣗಈςετ͕͍͠ϥΠϑαΠΫϧؔ࿈ 4UFQ-JWF%BUBͷಋೖ
w ֎෦༷ಉҰͳഁյతมߋ w 7JFXͱͷΓͱΓ͕%BUB#JOEJOHܦ༝ʹ w ഁյతมߋͷݕূ w 6*5FTUJOH w .77.ԽલޙͰಉ͡6*ςετ͕ಈ࡞͢Δ͜ͱ
w खಈςετ w 6*5FTUͰΧόʔ͖͠Εͳ͍෦ 4UFQ.77.Խ
w 6*5FTU
4UFQ$PSPVUJOFԽ #FGPSF "GUFS 'SBHNFOU 7JFX.PEFM 3FQPTJUPSZ 3FNPUF%BUB4PVSDF 8FCTFSWJDF -JWF%BUB
'SBHNFOU 7JFX.PEFM 3FQPTJUPSZ 3FNPUF%BUB4PVSDF 8FCTFSWJDF -JWF%BUB "TZOD5BTL
4UFQ$PSPVUJOFԽ 7JFX.PEFM
w ֎෦༷มΘΔഁյతมߋ w "TZOD5BTLˠ$PSPVUJOFͰඇಉظॲཧ͕ࠜຊ͔ΒมΘΔ w 7JFX.PEFMPO$MFBS 'SBHNFOUPO%FTUSPZ Ͱඇಉظॲཧऴྃ w "TZOD5BTL࣌ͷϝϞϦϦʔΫमਖ਼
w ഁյతมߋͷݕূ w "TZOD5BTLΛ$PSPVUJOFʹஔ͖͑ͯ6OJU5FTU͕௨Δ͜ͱ w खಈςετϥΠϑαΠΫϧ PO%FTUSPZ 4UFQ$PSPVUJOFԽ
αϯϓϧίʔυ 'SBHNFOU "TZOD5BTL 8FCTFSWJDF 'SBHNFOU 7JFX.PEFM 3FQPTJUPSZ 3FNPUF%BUB4PVSDF 8FCTFSWJDF
-JWF%BUB #FGPSF "GUFS
w 'SBNFXPSLϥΠϒϥϦͷಈ࡞ΛΔ w ഁյతมߋΛݟམͱ͢Մೳੑ͕ݮΔ w "OESPJEͰಛʹϥΠϑαΠΫϧΛҙࣝ͢Δ w ෦࣮ΛಡΉͷ͕Φεεϝ ϙΠϯτಈ࡞ΛΔ
w ΤϥʔΛચ͍ग़ͯ͠ॲཧํ๏ΛܾΊΔ w ϦΞʔΩςΫνϟͷࡍॲཧ͢ΔΛܾΊΔ w IUUQTTQFBLFSEFDLDPNLHNZTIJOBOESPJEBQQFSSPSIBOEMJOH ϙΠϯτΤϥʔॲཧ
·ͱΊ
w ܭըΛཱͯͯϦϑΝΫλϦϯάΛ͠Α͏ w ςετΛॻ͜͏ w ഁյతมߋͨ͠Βͦͷ෦Λݕূ͠Α͏ ൃදͷཁ