SlideShare a Scribd company logo
GREAT STEP
테스트코드를 위한 위대한 발자국
Covenant Ko
STEP 1.
JPA
Covenant Ko
Chapter 4
JPA
How to Test?
JPA 스터디 맞습니다..
- Name. Covenant Ko
- Company. 11번가
- Github 용감한친구들 Organization Founder & Maintainer. https://github.com/brave-people
- Github. https://github.com/KoEonYack
- Tech Blog. https://covenant.tistory.com/ (누적 방문 41만)
1. !
2. DB !
3. ORM !
4. !
5. !
6. !
7. !
1. !
2. DB !
3. ORM !
4. !
5. !
6. !
7. !
Week 1
Week 2
Week 2
Week 3
8. .
8. .
9. ?
8. .
9. ?
10.
8. .
9. ?
10.
11. TDD, DDD .
8. .
9. ?
10.
11. TDD, DDD .
12. MVC ?
8. .
9. ?
10.
11. TDD, DDD .
12. MVC ?
13. JPA ?
8. .
9. ?
10.
11. TDD, DDD .
12. MVC ?
13. JPA ?
14. ? ?
8. .
9. ?
10.
11. TDD, DDD .
12. MVC ?
13. JPA ?
14. ? ?
Week 4
?
?
https://youtu.be/sJiPXZmdidg
?
https://techblog.woowahan.com/2613/
?
https://techblog.woowahan.com/2613/
?
https://techblog.woowahan.com/2613/
확인이 어려운 문제
?
https://techblog.woowahan.com/2613/
https://www.slideshare.net/OKJSP/okkycon-120498066
1.
2. ( )
3. ( ..)
4.
5. ? ( Insert ?)
6. ( ? , , ?)
GREAT STEP 1. 테스트 코드를 향한 위대한 발걸음
?
https://postshare.co.kr/archives/101972
https://www.slideshare.net/WooseopKim3/gdg-and-kor
1. .
2. , , ,
3. , ,
4.
?
https://postshare.co.kr/archives/101972
https://www.slideshare.net/WooseopKim3/gdg-and-kor
MVC
https://www.slideshare.net/gyumee/ss-90206560
DB
MVC
UI
GREAT STEP 1. 테스트 코드를 향한 위대한 발걸음
how we write/review code in big tech companies
https://youtu.be/rR4n-0KYeKQ
테스트 실패
how we write/review code in big tech companies
https://youtu.be/rR4n-0KYeKQ
이해를 못하고 바빠서 삭제 후 Pull Request
how we write/review code in big tech companies
https://youtu.be/rR4n-0KYeKQ
왜 지웠는지 모르겠고 승인
FIRST Rules
Robert C. Martin (Uncle Bob) F.I.R.S.T
Fast
Independent
Repeatable
Self-validating
Timely
https://galid1.tistory.com/772#unnecessarymockito-2x-%EB%B2%84%EC%A0%84%EC%9D%98-%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80-%EC%95%8A%EB%8A%94-%EC%8A%A4%ED%85%81%EA%B0%90%EC%A7%80
FIRST Rules
Robert C. Martin (Uncle Bob) F.I.R.S.T
Fast
Independent
Repeatable
Self-validating
Timely
https://galid1.tistory.com/772#unnecessarymockito-2x-%EB%B2%84%EC%A0%84%EC%9D%98-%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80-%EC%95%8A%EB%8A%94-%EC%8A%A4%ED%85%81%EA%B0%90%EC%A7%80
1. .
2. @SpringBootTest
FIRST Rules
Robert C. Martin (Uncle Bob) F.I.R.S.T
Fast
Independent
Repeatable
Self-validating
Timely
https://galid1.tistory.com/772#unnecessarymockito-2x-%EB%B2%84%EC%A0%84%EC%9D%98-%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80-%EC%95%8A%EB%8A%94-%EC%8A%A4%ED%85%81%EA%B0%90%EC%A7%80
1. , , ,
2. .
FIRST Rules
Robert C. Martin (Uncle Bob) F.I.R.S.T
Fast
Independent
Repeatable
Self-validating
Timely
https://galid1.tistory.com/772#unnecessarymockito-2x-%EB%B2%84%EC%A0%84%EC%9D%98-%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80-%EC%95%8A%EB%8A%94-%EC%8A%A4%ED%85%81%EA%B0%90%EC%A7%80
1. .
2. DB Repeatable
FIRST Rules
Robert C. Martin (Uncle Bob) F.I.R.S.T
Fast
Independent
Repeatable
Self-validating
Timely
https://galid1.tistory.com/772#unnecessarymockito-2x-%EB%B2%84%EC%A0%84%EC%9D%98-%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80-%EC%95%8A%EB%8A%94-%EC%8A%A4%ED%85%81%EA%B0%90%EC%A7%80
1. .
2. console out … Assert
FIRST Rules
Robert C. Martin (Uncle Bob) F.I.R.S.T
Fast
Independent
Repeatable
Self-validating
Timely
https://galid1.tistory.com/772#unnecessarymockito-2x-%EB%B2%84%EC%A0%84%EC%9D%98-%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80-%EC%95%8A%EB%8A%94-%EC%8A%A4%ED%85%81%EA%B0%90%EC%A7%80
1. Test Code .
2. TDD .
Service Layer Test Code
Service Layer Test Code
1. F.I.R.S.T First
2.
Service Layer Test Code
3. F.I.R.S.T Repeatable
4. DB Repeatable
1. F.I.R.S.T First
2.
Service Layer Test Code
Mockito !
3. F.I.R.S.T Repeatable
4. DB Repeatable
1. F.I.R.S.T First
2.
Mockito ?
, , Mock(
)
https://velog.io/@max9106/Mockito-Mockito%EB%9E%80
Mockito ?
https://velog.io/@max9106/Mockito-Mockito%EB%9E%80
Tasty mocking framework for unit tests in Java (site.mockito.org)
, , Mock(
)
Mockito ?
https://velog.io/@max9106/Mockito-Mockito%EB%9E%80
Tasty mocking framework for unit tests in Java (site.mockito.org)
, , Mock(
)
Mockito ?
https://knowyourmeme.com/memes/ito-suffix
https://velog.io/@max9106/Mockito-Mockito%EB%9E%80
Tasty mocking framework for unit tests in Java (site.mockito.org)
A smaller version of a larger thing
Imitate (someone or something)
, , Mock(
)
1. given .
2. given
1. 100 ? (ex. God Object)
2. Mocking ?
2. Jackson Json String ?
https://exceptionnotfound.net/god-objects-the-daily-software-anti-pattern/
https://www.google.com/url?sa=i&url=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fwww.researchgate.net%2Ffigure%2FAn-example-of-god-object-Web-service_fig1_307572331&psig=AOvVaw3n8qSAYig1IAvNLo-XG-6H&ust=1630764224837000&source=images&cd=vfe&ved=0CAwQjhxqFwoTCJCf07X84vICFQAAAAAdAAAAABAV
Mockito
https://zhangyuhui.blog/2018/02/09/how-mockito-dose-the-mock/
MockMVC
Client
WAS
MockMVC
Client
Spring MVC
Spring MVC
HttpServletRequest
HttpServletResponse
Mock Request
Mock Response
https://www.slideshare.net/gyumee/ss-90206560
?
Right-BICEP
Right: ?
Boundary: ?
Inverse: ?
Cross-check: ?
Error condition: ?
Performance: ?
https://www.slideshare.net/gyumee/ss-90206560
GREAT STEP 1. 테스트 코드를 향한 위대한 발걸음
Troubleshooting
Service Service
Service
Service
Service
Service
Troubleshooting
Service Service
Service
Service
Service
Service
1. (Functional Decomposition)
2. (Abstract Data Type)
3. (Object-Oriented)
Functional Decomposition
Flow
https://hucet.tistory.com/71
Functional Decomposition
Flow
https://hucet.tistory.com/71
Functional Decomposition
Flow
https://hucet.tistory.com/71
Functional Decomposition
Flow
: -> Scope
https://hucet.tistory.com/71
https://hucet.tistory.com/71
Functional Decomposition
Flow
Functional Decomposition
Flow
https://hucet.tistory.com/71
Functional Decomposition
Flow
1. Open-Closed
2. QA
https://hucet.tistory.com/71
GREAT STEP
테스트코드를 위한 위대한 발자국
Covenant Ko
STEP 1.

More Related Content

PDF
JPA 스터디 Week1 - 하이버네이트, 캐시
Covenant Ko
 
PDF
떠먹는 '오브젝트' Ch07 객체 분해
Covenant Ko
 
PDF
JPA Week3 Entity Mapping / Hexagonal Architecture
Covenant Ko
 
PDF
JPA Week4. VALUE TYPES / CQRS
Covenant Ko
 
PDF
Week2 아주 작은 빈 이야기
Covenant Ko
 
PDF
JPA 스터디 Week2 - Object Relational Mapping
Covenant Ko
 
PDF
Week7 bean life cycle
Covenant Ko
 
PDF
JPA Week5. Join Fetch
Covenant Ko
 
JPA 스터디 Week1 - 하이버네이트, 캐시
Covenant Ko
 
떠먹는 '오브젝트' Ch07 객체 분해
Covenant Ko
 
JPA Week3 Entity Mapping / Hexagonal Architecture
Covenant Ko
 
JPA Week4. VALUE TYPES / CQRS
Covenant Ko
 
Week2 아주 작은 빈 이야기
Covenant Ko
 
JPA 스터디 Week2 - Object Relational Mapping
Covenant Ko
 
Week7 bean life cycle
Covenant Ko
 
JPA Week5. Join Fetch
Covenant Ko
 

What's hot (20)

PDF
GREAT STEP 2. TDD & MockMVC
Covenant Ko
 
PDF
[로켓 자바] Part 1 성능 튜닝 마인드 확립
Covenant Ko
 
PDF
떠먹는 '오브젝트' Ch05 책임 할당하기
Covenant Ko
 
PDF
Week4 빈은 전설이다. (싱글톤 빈, CGlib)
Covenant Ko
 
PDF
Week3 아주 작은 빈 이야기 2
Covenant Ko
 
PDF
Week6 autowired beanlifecycle
Covenant Ko
 
PDF
Week1 스프링이 사랑한 SOLID
Covenant Ko
 
PDF
떠먹는 '오브젝트' Ch02 객체지향 프로그래밍
Covenant Ko
 
PDF
떠먹는 '오브젝트' Ch04 설계 품질과 트레이드오프
Covenant Ko
 
PDF
Git inter-snapshot public
SeongJae Park
 
PDF
Week5 컴포넌트 스캔
Covenant Ko
 
PDF
DO YOU WANT TO USE A VCS
SeongJae Park
 
PDF
Free The Enterprise With Ruby & Master Your Own Domain
Ken Collins
 
PDF
VCS for Teamwork - GIT Workshop
Anis Ahmad
 
PDF
Git, from the beginning
James Aylett
 
PDF
Git & Github for beginners
Paulo Henrique Nonaka
 
PDF
Deep dark-side of git: How git works internally
SeongJae Park
 
PDF
創科資訊四月小聚 - React Native Clonecat 101
Kent Chen
 
PDF
pg_chameleon MySQL to PostgreSQL replica made easy
Federico Campoli
 
ODP
Eat my data
Peng Zuo
 
GREAT STEP 2. TDD & MockMVC
Covenant Ko
 
[로켓 자바] Part 1 성능 튜닝 마인드 확립
Covenant Ko
 
떠먹는 '오브젝트' Ch05 책임 할당하기
Covenant Ko
 
Week4 빈은 전설이다. (싱글톤 빈, CGlib)
Covenant Ko
 
Week3 아주 작은 빈 이야기 2
Covenant Ko
 
Week6 autowired beanlifecycle
Covenant Ko
 
Week1 스프링이 사랑한 SOLID
Covenant Ko
 
떠먹는 '오브젝트' Ch02 객체지향 프로그래밍
Covenant Ko
 
떠먹는 '오브젝트' Ch04 설계 품질과 트레이드오프
Covenant Ko
 
Git inter-snapshot public
SeongJae Park
 
Week5 컴포넌트 스캔
Covenant Ko
 
DO YOU WANT TO USE A VCS
SeongJae Park
 
Free The Enterprise With Ruby & Master Your Own Domain
Ken Collins
 
VCS for Teamwork - GIT Workshop
Anis Ahmad
 
Git, from the beginning
James Aylett
 
Git & Github for beginners
Paulo Henrique Nonaka
 
Deep dark-side of git: How git works internally
SeongJae Park
 
創科資訊四月小聚 - React Native Clonecat 101
Kent Chen
 
pg_chameleon MySQL to PostgreSQL replica made easy
Federico Campoli
 
Eat my data
Peng Zuo
 
Ad

Recently uploaded (20)

PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Ad

GREAT STEP 1. 테스트 코드를 향한 위대한 발걸음