SlideShare a Scribd company logo
1 of 20
테스트 주도 개발 by googletest 1장. 다중 통화를 지원하는 Money 객체
프로젝트 구성
디렉터리 구조 솔루션 디렉터리 googletest 프레임워크 개발 프로젝트 디렉터리 테스트 프로젝트 디렉터리 Win32 용용 프로그램 프로젝트 기본 구조 테스트 프로젝트 -googletest 헤더, 라이브러리 참조
googletest 참조 설정 C/C++ – General – Additional Include Directories: $(SolutionDir)gtestnclude Linker – General – Additional Library Directories: $(SolutionDir)gtestib
googletest 라이브러리 설정 개발 프로젝트 런타임 설정 googletest라이브러리 테스트 프로젝트 런타임은 개발 프로젝트 런타임에 맞춰 설정
프로젝트 의존성 설정 Build Events – Post-Build Event 테스트 프로젝트 빌드  개발 프로젝트 빌드  테스트 프로젝트 실행  테스트 결과 출력 트리거 자동 실행
테스트 프로젝트 main() googletest헤더 googletest실행 설정
출~바알~
To do: ,[object Object]
$5 * 2 = $10DollarTest.cpp 추가 ,[object Object]
생각 못한 부작용
금액에 정수 사용테스트 먼저 완벽한 인터페이스를  상상하며 DollarTest.cpp
To do: ,[object Object]
$5 * 2 = $10
amount를 private으로 만들기
Dollar 부작용(side effent)?
Money 반올림?컴파일 문제 ,[object Object]
생성자없음
times(int) 메서드 없음
amount 필드 없음Dollar 클래스 추가(Dollar.h)

More Related Content

What's hot

TDD&Refactoring Day 01: Refactoring
TDD&Refactoring Day 01: RefactoringTDD&Refactoring Day 01: Refactoring
TDD&Refactoring Day 01: RefactoringSuwon Chae
 
Test Driven Development (TDD) basic
Test Driven Development (TDD) basicTest Driven Development (TDD) basic
Test Driven Development (TDD) basicCurt Park
 
단위테스트자동화지원도구 임성현 최종
단위테스트자동화지원도구 임성현 최종단위테스트자동화지원도구 임성현 최종
단위테스트자동화지원도구 임성현 최종guest7178884
 
행복한 개발을 위한_테스트_케이스
행복한 개발을 위한_테스트_케이스행복한 개발을 위한_테스트_케이스
행복한 개발을 위한_테스트_케이스도형 임
 
(SW 아키텍트 대회 2차)단위테스트자동화도구
(SW 아키텍트 대회 2차)단위테스트자동화도구(SW 아키텍트 대회 2차)단위테스트자동화도구
(SW 아키텍트 대회 2차)단위테스트자동화도구Lim SungHyun
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationDonghyun Seo
 
[NDC13] 70명이 커밋하는 라이브 개발하기 (해외 진출 라이브 프로젝트의 개발 관리) - 송창규
[NDC13] 70명이 커밋하는 라이브 개발하기 (해외 진출 라이브 프로젝트의 개발 관리) - 송창규[NDC13] 70명이 커밋하는 라이브 개발하기 (해외 진출 라이브 프로젝트의 개발 관리) - 송창규
[NDC13] 70명이 커밋하는 라이브 개발하기 (해외 진출 라이브 프로젝트의 개발 관리) - 송창규ChangKyu Song
 
Ui test 자동화하기 - Selenium + Jenkins
Ui test 자동화하기 - Selenium + JenkinsUi test 자동화하기 - Selenium + Jenkins
Ui test 자동화하기 - Selenium + JenkinsChang Hak Yeon
 
테스트자동화와 TDD
테스트자동화와 TDD테스트자동화와 TDD
테스트자동화와 TDDSunghyouk Bae
 
TDD: Test Driven Development 첫번째 이야기
TDD: Test Driven Development 첫번째 이야기TDD: Test Driven Development 첫번째 이야기
TDD: Test Driven Development 첫번째 이야기Ji Heon Kim
 
Rapid Development
Rapid DevelopmentRapid Development
Rapid Development기룡 남
 
Tdd live spring camp 2013
Tdd live spring camp 2013Tdd live spring camp 2013
Tdd live spring camp 2013beom kyun choi
 

What's hot (19)

TEST?
TEST?TEST?
TEST?
 
TDD&Refactoring Day 01: Refactoring
TDD&Refactoring Day 01: RefactoringTDD&Refactoring Day 01: Refactoring
TDD&Refactoring Day 01: Refactoring
 
Test Driven Development (TDD) basic
Test Driven Development (TDD) basicTest Driven Development (TDD) basic
Test Driven Development (TDD) basic
 
C++과 TDD
C++과 TDDC++과 TDD
C++과 TDD
 
단위테스트자동화지원도구 임성현 최종
단위테스트자동화지원도구 임성현 최종단위테스트자동화지원도구 임성현 최종
단위테스트자동화지원도구 임성현 최종
 
Tdd ver.2
Tdd ver.2Tdd ver.2
Tdd ver.2
 
행복한 개발을 위한_테스트_케이스
행복한 개발을 위한_테스트_케이스행복한 개발을 위한_테스트_케이스
행복한 개발을 위한_테스트_케이스
 
(SW 아키텍트 대회 2차)단위테스트자동화도구
(SW 아키텍트 대회 2차)단위테스트자동화도구(SW 아키텍트 대회 2차)단위테스트자동화도구
(SW 아키텍트 대회 2차)단위테스트자동화도구
 
Java the good parts
Java the good partsJava the good parts
Java the good parts
 
Tdd with JUnit 1
Tdd with JUnit 1Tdd with JUnit 1
Tdd with JUnit 1
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
[NDC13] 70명이 커밋하는 라이브 개발하기 (해외 진출 라이브 프로젝트의 개발 관리) - 송창규
[NDC13] 70명이 커밋하는 라이브 개발하기 (해외 진출 라이브 프로젝트의 개발 관리) - 송창규[NDC13] 70명이 커밋하는 라이브 개발하기 (해외 진출 라이브 프로젝트의 개발 관리) - 송창규
[NDC13] 70명이 커밋하는 라이브 개발하기 (해외 진출 라이브 프로젝트의 개발 관리) - 송창규
 
Ui test 자동화하기 - Selenium + Jenkins
Ui test 자동화하기 - Selenium + JenkinsUi test 자동화하기 - Selenium + Jenkins
Ui test 자동화하기 - Selenium + Jenkins
 
Tdd
TddTdd
Tdd
 
팀장 잔소리
팀장 잔소리팀장 잔소리
팀장 잔소리
 
테스트자동화와 TDD
테스트자동화와 TDD테스트자동화와 TDD
테스트자동화와 TDD
 
TDD: Test Driven Development 첫번째 이야기
TDD: Test Driven Development 첫번째 이야기TDD: Test Driven Development 첫번째 이야기
TDD: Test Driven Development 첫번째 이야기
 
Rapid Development
Rapid DevelopmentRapid Development
Rapid Development
 
Tdd live spring camp 2013
Tdd live spring camp 2013Tdd live spring camp 2013
Tdd live spring camp 2013
 

Similar to 테스트 주도 개발 By googletest 1장 다중 통화를 지원하는 money 객체

청강대 특강 - 프로젝트 제대로 해보기
청강대 특강 - 프로젝트 제대로 해보기청강대 특강 - 프로젝트 제대로 해보기
청강대 특강 - 프로젝트 제대로 해보기Chris Ohk
 
Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)Junyoung Lee
 
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018Kenneth Ceyer
 
KGC10 - Visual C++10과 디버깅
KGC10 - Visual C++10과 디버깅KGC10 - Visual C++10과 디버깅
KGC10 - Visual C++10과 디버깅흥배 최
 
02.개발환경 실습교재
02.개발환경 실습교재02.개발환경 실습교재
02.개발환경 실습교재Hankyo
 
[NEXT 프연 Week1] Git 시작하기
[NEXT 프연 Week1] Git 시작하기[NEXT 프연 Week1] Git 시작하기
[NEXT 프연 Week1] Git 시작하기Young-Ho Cho
 
Okjsp 13주년 발표자료: 생존 프로그래밍 Test
Okjsp 13주년 발표자료: 생존 프로그래밍 TestOkjsp 13주년 발표자료: 생존 프로그래밍 Test
Okjsp 13주년 발표자료: 생존 프로그래밍 Testbeom kyun choi
 
TDD in gameserver 발표자료
TDD in gameserver 발표자료TDD in gameserver 발표자료
TDD in gameserver 발표자료Vong Sik Kong
 
Git 더하기 GitHub(Git클라이언트 활용) / Getting started with git+github
Git 더하기 GitHub(Git클라이언트 활용) / Getting started with git+githubGit 더하기 GitHub(Git클라이언트 활용) / Getting started with git+github
Git 더하기 GitHub(Git클라이언트 활용) / Getting started with git+githubJunyoung Lee
 
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective GitChanwoong Kim
 
[Hello world 오픈세미나]n grinder helloworld발표자료_저작권free
[Hello world 오픈세미나]n grinder helloworld발표자료_저작권free[Hello world 오픈세미나]n grinder helloworld발표자료_저작권free
[Hello world 오픈세미나]n grinder helloworld발표자료_저작권freeNAVER D2
 
GDB와 strace로 Hang 걸린 Python Process 원격 디버깅
GDB와 strace로 Hang 걸린 Python Process 원격 디버깅GDB와 strace로 Hang 걸린 Python Process 원격 디버깅
GDB와 strace로 Hang 걸린 Python Process 원격 디버깅Youngmin Koo
 
Legacy code refactoring video rental system
Legacy code refactoring   video rental systemLegacy code refactoring   video rental system
Legacy code refactoring video rental systemJaehoon Oh
 
C++ 프로젝트에 단위 테스트 도입하기
C++ 프로젝트에 단위 테스트 도입하기C++ 프로젝트에 단위 테스트 도입하기
C++ 프로젝트에 단위 테스트 도입하기Heo Seungwook
 
C++ 개발자와 함께 하는 visual studio 2013
C++ 개발자와 함께 하는 visual studio 2013C++ 개발자와 함께 하는 visual studio 2013
C++ 개발자와 함께 하는 visual studio 2013명신 김
 
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019min woog kim
 
[17.02.09] Github introduction (Korean Version)
[17.02.09] Github introduction (Korean Version)[17.02.09] Github introduction (Korean Version)
[17.02.09] Github introduction (Korean Version)Ildoo Kim
 
GitHub 실습 교육
GitHub 실습 교육GitHub 실습 교육
GitHub 실습 교육승엽 신
 
공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반BJ Jang
 

Similar to 테스트 주도 개발 By googletest 1장 다중 통화를 지원하는 money 객체 (20)

청강대 특강 - 프로젝트 제대로 해보기
청강대 특강 - 프로젝트 제대로 해보기청강대 특강 - 프로젝트 제대로 해보기
청강대 특강 - 프로젝트 제대로 해보기
 
Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)
 
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
 
KGC10 - Visual C++10과 디버깅
KGC10 - Visual C++10과 디버깅KGC10 - Visual C++10과 디버깅
KGC10 - Visual C++10과 디버깅
 
02.개발환경 실습교재
02.개발환경 실습교재02.개발환경 실습교재
02.개발환경 실습교재
 
Basic git-commands
Basic git-commandsBasic git-commands
Basic git-commands
 
[NEXT 프연 Week1] Git 시작하기
[NEXT 프연 Week1] Git 시작하기[NEXT 프연 Week1] Git 시작하기
[NEXT 프연 Week1] Git 시작하기
 
Okjsp 13주년 발표자료: 생존 프로그래밍 Test
Okjsp 13주년 발표자료: 생존 프로그래밍 TestOkjsp 13주년 발표자료: 생존 프로그래밍 Test
Okjsp 13주년 발표자료: 생존 프로그래밍 Test
 
TDD in gameserver 발표자료
TDD in gameserver 발표자료TDD in gameserver 발표자료
TDD in gameserver 발표자료
 
Git 더하기 GitHub(Git클라이언트 활용) / Getting started with git+github
Git 더하기 GitHub(Git클라이언트 활용) / Getting started with git+githubGit 더하기 GitHub(Git클라이언트 활용) / Getting started with git+github
Git 더하기 GitHub(Git클라이언트 활용) / Getting started with git+github
 
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective Git
 
[Hello world 오픈세미나]n grinder helloworld발표자료_저작권free
[Hello world 오픈세미나]n grinder helloworld발표자료_저작권free[Hello world 오픈세미나]n grinder helloworld발표자료_저작권free
[Hello world 오픈세미나]n grinder helloworld발표자료_저작권free
 
GDB와 strace로 Hang 걸린 Python Process 원격 디버깅
GDB와 strace로 Hang 걸린 Python Process 원격 디버깅GDB와 strace로 Hang 걸린 Python Process 원격 디버깅
GDB와 strace로 Hang 걸린 Python Process 원격 디버깅
 
Legacy code refactoring video rental system
Legacy code refactoring   video rental systemLegacy code refactoring   video rental system
Legacy code refactoring video rental system
 
C++ 프로젝트에 단위 테스트 도입하기
C++ 프로젝트에 단위 테스트 도입하기C++ 프로젝트에 단위 테스트 도입하기
C++ 프로젝트에 단위 테스트 도입하기
 
C++ 개발자와 함께 하는 visual studio 2013
C++ 개발자와 함께 하는 visual studio 2013C++ 개발자와 함께 하는 visual studio 2013
C++ 개발자와 함께 하는 visual studio 2013
 
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
김민욱, (달빛조각사) 엘릭서를 이용한 mmorpg 서버 개발, NDC2019
 
[17.02.09] Github introduction (Korean Version)
[17.02.09] Github introduction (Korean Version)[17.02.09] Github introduction (Korean Version)
[17.02.09] Github introduction (Korean Version)
 
GitHub 실습 교육
GitHub 실습 교육GitHub 실습 교육
GitHub 실습 교육
 
공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반공간정보아카데미 - Day1 오픈소스개발 일반
공간정보아카데미 - Day1 오픈소스개발 일반
 

More from Mickey SJ Lee

풀리퀘를 부탁해!
풀리퀘를 부탁해!풀리퀘를 부탁해!
풀리퀘를 부탁해!Mickey SJ Lee
 
초간단 SW 개발 방법 for dummies
초간단 SW 개발 방법 for dummies초간단 SW 개발 방법 for dummies
초간단 SW 개발 방법 for dummiesMickey SJ Lee
 
실용주의 프로그래머를 위한 개발환경 만들기
실용주의 프로그래머를 위한 개발환경 만들기실용주의 프로그래머를 위한 개발환경 만들기
실용주의 프로그래머를 위한 개발환경 만들기Mickey SJ Lee
 
5. hg init – a mercurial tutorial by tortoise hg repository architecture
5. hg init – a mercurial tutorial by tortoise hg   repository architecture5. hg init – a mercurial tutorial by tortoise hg   repository architecture
5. hg init – a mercurial tutorial by tortoise hg repository architectureMickey SJ Lee
 
4. hg init – a mercurial tutorial by tortoise hg merging
4. hg init – a mercurial tutorial by tortoise hg   merging4. hg init – a mercurial tutorial by tortoise hg   merging
4. hg init – a mercurial tutorial by tortoise hg mergingMickey SJ Lee
 
3. hg init – a mercurial tutorial by tortoies hg fixing goofs
3. hg init – a mercurial tutorial by tortoies hg   fixing goofs3. hg init – a mercurial tutorial by tortoies hg   fixing goofs
3. hg init – a mercurial tutorial by tortoies hg fixing goofsMickey SJ Lee
 
2. hg init – a mercurial tutorial by tortoies hg setting up for a team
2. hg init – a mercurial tutorial by tortoies hg   setting up for a team2. hg init – a mercurial tutorial by tortoies hg   setting up for a team
2. hg init – a mercurial tutorial by tortoies hg setting up for a teamMickey SJ Lee
 
1. hg init – a mercurial tutorial by tortoies hg ground up mercurial
1. hg init – a mercurial tutorial by tortoies hg   ground up mercurial1. hg init – a mercurial tutorial by tortoies hg   ground up mercurial
1. hg init – a mercurial tutorial by tortoies hg ground up mercurialMickey SJ Lee
 

More from Mickey SJ Lee (8)

풀리퀘를 부탁해!
풀리퀘를 부탁해!풀리퀘를 부탁해!
풀리퀘를 부탁해!
 
초간단 SW 개발 방법 for dummies
초간단 SW 개발 방법 for dummies초간단 SW 개발 방법 for dummies
초간단 SW 개발 방법 for dummies
 
실용주의 프로그래머를 위한 개발환경 만들기
실용주의 프로그래머를 위한 개발환경 만들기실용주의 프로그래머를 위한 개발환경 만들기
실용주의 프로그래머를 위한 개발환경 만들기
 
5. hg init – a mercurial tutorial by tortoise hg repository architecture
5. hg init – a mercurial tutorial by tortoise hg   repository architecture5. hg init – a mercurial tutorial by tortoise hg   repository architecture
5. hg init – a mercurial tutorial by tortoise hg repository architecture
 
4. hg init – a mercurial tutorial by tortoise hg merging
4. hg init – a mercurial tutorial by tortoise hg   merging4. hg init – a mercurial tutorial by tortoise hg   merging
4. hg init – a mercurial tutorial by tortoise hg merging
 
3. hg init – a mercurial tutorial by tortoies hg fixing goofs
3. hg init – a mercurial tutorial by tortoies hg   fixing goofs3. hg init – a mercurial tutorial by tortoies hg   fixing goofs
3. hg init – a mercurial tutorial by tortoies hg fixing goofs
 
2. hg init – a mercurial tutorial by tortoies hg setting up for a team
2. hg init – a mercurial tutorial by tortoies hg   setting up for a team2. hg init – a mercurial tutorial by tortoies hg   setting up for a team
2. hg init – a mercurial tutorial by tortoies hg setting up for a team
 
1. hg init – a mercurial tutorial by tortoies hg ground up mercurial
1. hg init – a mercurial tutorial by tortoies hg   ground up mercurial1. hg init – a mercurial tutorial by tortoies hg   ground up mercurial
1. hg init – a mercurial tutorial by tortoies hg ground up mercurial
 

테스트 주도 개발 By googletest 1장 다중 통화를 지원하는 money 객체