SlideShare uma empresa Scribd logo
1 de 24
TDD Boot Camp

     for C++
20
09:30 10:00

10:00 10:05

10:05 10:35

10:35 11:30

11:30 12:00

12:00 13:00

13:00 13:40

13:40 15:00

15:00 15:30

15:30 17:15

17:15 18:15

18:15 18:30

18:30
TDD
TDD
4
4   6   8   10   12   14   16


3   5   7   9    11   13   15
PC
GitHub

   https://github.com/imagire/TDD-Boot-Camp-Tokyo-for-CPP/
                             GitHub   push
google test         TDD (1/5)

#include <gtest/gtest.h>

int main(int argc, char* argv[])
{
  ::testing::InitGoogleTest(&argc, argv);


 return RUN_ALL_TESTS();
}
google test                   TDD (2/5)
#include <gtest/gtest.h>



TEST(AddTest, AddWorks)
{
    EXPECT_EQ(2, add(1, 1));
}

int main(int argc, char* argv[])
{
  ::testing::InitGoogleTest(&argc, argv);


 return RUN_ALL_TESTS();
}
google test                   TDD (3/5)
#include <gtest/gtest.h>

int add(int x, int y)
{
    return 0;
}

TEST(AddTest, AddWorks)
{
    EXPECT_EQ(2, add(1, 1));
}

int main(int argc, char* argv[])
{
  ::testing::InitGoogleTest(&argc, argv);

 return RUN_ALL_TESTS();
}
google test                   TDD (4/5)
#include <gtest/gtest.h>

int add(int x, int y)
{
    long z=y+x;
    return z;
}

TEST(AddTest, AddWorks)
{
    EXPECT_EQ(2, add(1, 1));
}

int main(int argc, char* argv[])
{
  ::testing::InitGoogleTest(&argc, argv);

 return RUN_ALL_TESTS();
}
google test                   TDD (5/5)
#include <gtest/gtest.h>

int add(int x, int y)
{
    return x + y;
}

TEST(AddTest, AddWorks)
{
    EXPECT_EQ(2, add(1, 1));
}

int main(int argc, char* argv[])
{
  ::testing::InitGoogleTest(&argc, argv);

 return RUN_ALL_TESTS();
}
GoogleTest
       true/false
ASSERT_TRUE(condition);      EXPECT_TRUE(condition);       condition      true

ASSERT_FALSE(condition);     EXPECT_FALSE(condition);      condition      false


       2

ASSERT_EQ(expected, actual); EXPECT_EQ(expected, actual); expected == actual

ASSERT_NE(val1, val2);       EXPECT_NE(val1, val2);        val1 != val2

ASSERT_LT(val1, val2);       EXPECT_LT(val1, val2);        val1 < val2

ASSERT_LE(val1, val2);       EXPECT_LE(val1, val2);        val1 <= val2

ASSERT_GT(val1, val2);       EXPECT_GT(val1, val2);        val1 > val2

ASSERT_GE(val1, val2);       EXPECT_GE(val1, val2);        val1 >= val2

                             http://d.hatena.ne.jp/kaorun55/20100730/1280416866
Are y!

Ready?
1
(10   )




TDD
4   6   8   10   12   14   16


3   5   7   9    11   13   15
2


    4   6   8   10 12    14   16


    3   5   7   9   11   13   15
TDD Boot Camp 東京 for C++ 進行

Mais conteúdo relacionado

Mais procurados

Pressure drop model presentation april 19th
Pressure drop model presentation april 19thPressure drop model presentation april 19th
Pressure drop model presentation april 19th
Yen Nguyen
 

Mais procurados (20)

The Ring programming language version 1.3 book - Part 63 of 88
The Ring programming language version 1.3 book - Part 63 of 88The Ring programming language version 1.3 book - Part 63 of 88
The Ring programming language version 1.3 book - Part 63 of 88
 
Debugging TV Frame 0x05
Debugging TV Frame 0x05Debugging TV Frame 0x05
Debugging TV Frame 0x05
 
Galera replication
Galera replicationGalera replication
Galera replication
 
The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.2 book - Part 42 of 84The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.2 book - Part 42 of 84
 
Tugas2
Tugas2Tugas2
Tugas2
 
Success story writing tips
Success story writing tipsSuccess story writing tips
Success story writing tips
 
Soluções da lista de exercícios 4
Soluções da lista de exercícios 4Soluções da lista de exercícios 4
Soluções da lista de exercícios 4
 
The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.4 book - Part 62 of 185The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.4 book - Part 62 of 185
 
Parameter passing
Parameter passingParameter passing
Parameter passing
 
Pressure drop model presentation april 19th
Pressure drop model presentation april 19thPressure drop model presentation april 19th
Pressure drop model presentation april 19th
 
CPP Quiz
CPP QuizCPP Quiz
CPP Quiz
 
Latihan Persamaan Kuadrat Kelas 8
Latihan Persamaan Kuadrat Kelas 8Latihan Persamaan Kuadrat Kelas 8
Latihan Persamaan Kuadrat Kelas 8
 
Chart parsing with features
Chart parsing with featuresChart parsing with features
Chart parsing with features
 
3rd Class
3rd Class3rd Class
3rd Class
 
Java Time Puzzlers
Java Time PuzzlersJava Time Puzzlers
Java Time Puzzlers
 
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184
 
C++ assignment
C++ assignmentC++ assignment
C++ assignment
 
Practica54
Practica54Practica54
Practica54
 
Step by step network construction and (cpm) calculations
Step by step network construction and (cpm) calculations Step by step network construction and (cpm) calculations
Step by step network construction and (cpm) calculations
 
Church ngs
Church ngsChurch ngs
Church ngs
 

Destaque

好きなことをしようAction! pub
好きなことをしようAction! pub好きなことをしようAction! pub
好きなことをしようAction! pub
Takashi Imagire
 
@s_ssk13さん向けGitHub入門
@s_ssk13さん向けGitHub入門@s_ssk13さん向けGitHub入門
@s_ssk13さん向けGitHub入門
Takashi Imagire
 

Destaque (10)

くじびきイテレーション
くじびきイテレーションくじびきイテレーション
くじびきイテレーション
 
TDD Boot Camp Tokyo for C++ 2014-01 補講
TDD Boot Camp Tokyo for C++ 2014-01 補講TDD Boot Camp Tokyo for C++ 2014-01 補講
TDD Boot Camp Tokyo for C++ 2014-01 補講
 
LeSS Study [2015/Dec./16] 資料(公開版)
LeSS Study [2015/Dec./16] 資料(公開版)LeSS Study [2015/Dec./16] 資料(公開版)
LeSS Study [2015/Dec./16] 資料(公開版)
 
CIBC 事前インストール
CIBC 事前インストールCIBC 事前インストール
CIBC 事前インストール
 
ゲームテストへの新しいアプローチ
 ゲームテストへの新しいアプローチ ゲームテストへの新しいアプローチ
ゲームテストへの新しいアプローチ
 
好きなことをしようAction! pub
好きなことをしようAction! pub好きなことをしようAction! pub
好きなことをしようAction! pub
 
SGGXマイクロフレーク分布
SGGXマイクロフレーク分布SGGXマイクロフレーク分布
SGGXマイクロフレーク分布
 
課題探検迷子に捧ぐゲーム流価値の創造術 (公開版)
課題探検迷子に捧ぐゲーム流価値の創造術 (公開版)課題探検迷子に捧ぐゲーム流価値の創造術 (公開版)
課題探検迷子に捧ぐゲーム流価値の創造術 (公開版)
 
@s_ssk13さん向けGitHub入門
@s_ssk13さん向けGitHub入門@s_ssk13さん向けGitHub入門
@s_ssk13さん向けGitHub入門
 
すべての優先度が1の時の優先順位の決め方
すべての優先度が1の時の優先順位の決め方すべての優先度が1の時の優先順位の決め方
すべての優先度が1の時の優先順位の決め方
 

Semelhante a TDD Boot Camp 東京 for C++ 進行

Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Robot Media
 
YOU SHOULD NOT MODIFY ANYTHING IN THIS FILE .docx
 YOU SHOULD NOT MODIFY ANYTHING IN THIS FILE .docx YOU SHOULD NOT MODIFY ANYTHING IN THIS FILE .docx
YOU SHOULD NOT MODIFY ANYTHING IN THIS FILE .docx
gertrudebellgrove
 

Semelhante a TDD Boot Camp 東京 for C++ 進行 (20)

Unit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon GaliciaUnit testing en iOS @ MobileCon Galicia
Unit testing en iOS @ MobileCon Galicia
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
STAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Descartes Presentation
STAMP Descartes Presentation
 
Mutation @ Spotify
Mutation @ Spotify Mutation @ Spotify
Mutation @ Spotify
 
Agile mobile
Agile mobileAgile mobile
Agile mobile
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
 
Groovy
GroovyGroovy
Groovy
 
From typing the test to testing the type
From typing the test to testing the typeFrom typing the test to testing the type
From typing the test to testing the type
 
Agile Android
Agile AndroidAgile Android
Agile Android
 
ES6 Simplified
ES6 SimplifiedES6 Simplified
ES6 Simplified
 
2011 nri-pratiques tests-avancees
2011 nri-pratiques tests-avancees2011 nri-pratiques tests-avancees
2011 nri-pratiques tests-avancees
 
Advanced patterns in asynchronous programming
Advanced patterns in asynchronous programmingAdvanced patterns in asynchronous programming
Advanced patterns in asynchronous programming
 
Google C++ Testing Framework in Visual Studio 2008
Google C++ Testing Framework in Visual Studio 2008Google C++ Testing Framework in Visual Studio 2008
Google C++ Testing Framework in Visual Studio 2008
 
Working Effectively with Legacy Code (draft)
Working Effectively with Legacy Code (draft)Working Effectively with Legacy Code (draft)
Working Effectively with Legacy Code (draft)
 
Mutation Testing at BzhJUG
Mutation Testing at BzhJUGMutation Testing at BzhJUG
Mutation Testing at BzhJUG
 
Writing Good Tests
Writing Good TestsWriting Good Tests
Writing Good Tests
 
Pg tap
Pg tapPg tap
Pg tap
 
Golang dot-testing-lite
Golang dot-testing-liteGolang dot-testing-lite
Golang dot-testing-lite
 
YOU SHOULD NOT MODIFY ANYTHING IN THIS FILE .docx
 YOU SHOULD NOT MODIFY ANYTHING IN THIS FILE .docx YOU SHOULD NOT MODIFY ANYTHING IN THIS FILE .docx
YOU SHOULD NOT MODIFY ANYTHING IN THIS FILE .docx
 
C programming slide c04
C programming slide c04C programming slide c04
C programming slide c04
 

Mais de Takashi Imagire

ゲーム作りから導くスクラムマネージャー
ゲーム作りから導くスクラムマネージャーゲーム作りから導くスクラムマネージャー
ゲーム作りから導くスクラムマネージャー
Takashi Imagire
 
スクラム道場.10 朝会 (Game Community Summit 2013)
スクラム道場.10 朝会 (Game Community Summit 2013)スクラム道場.10 朝会 (Game Community Summit 2013)
スクラム道場.10 朝会 (Game Community Summit 2013)
Takashi Imagire
 
第11回 scrum boot camp in NII ワークショップ
第11回 scrum boot camp in NII ワークショップ第11回 scrum boot camp in NII ワークショップ
第11回 scrum boot camp in NII ワークショップ
Takashi Imagire
 

Mais de Takashi Imagire (20)

『ゲームクリエイター育成会議 オフラインミーティングVol.1 「遊びと学びの研究者に聞く、ゲームデザイナーの育て方」』に参加するにあたって自分なりに考えたこと
『ゲームクリエイター育成会議 オフラインミーティングVol.1 「遊びと学びの研究者に聞く、ゲームデザイナーの育て方」』に参加するにあたって自分なりに考えたこと『ゲームクリエイター育成会議 オフラインミーティングVol.1 「遊びと学びの研究者に聞く、ゲームデザイナーの育て方」』に参加するにあたって自分なりに考えたこと
『ゲームクリエイター育成会議 オフラインミーティングVol.1 「遊びと学びの研究者に聞く、ゲームデザイナーの育て方」』に参加するにあたって自分なりに考えたこと
 
2件のHPG18 ショートペーパーの説明
2件のHPG18 ショートペーパーの説明2件のHPG18 ショートペーパーの説明
2件のHPG18 ショートペーパーの説明
 
コミケでのゲームエンジン2017
コミケでのゲームエンジン2017コミケでのゲームエンジン2017
コミケでのゲームエンジン2017
 
同人ゲーム開発におけるゲームエンジンの現状
同人ゲーム開発におけるゲームエンジンの現状同人ゲーム開発におけるゲームエンジンの現状
同人ゲーム開発におけるゲームエンジンの現状
 
Chroma blur (日本語での説明)
Chroma blur (日本語での説明)Chroma blur (日本語での説明)
Chroma blur (日本語での説明)
 
ソフトウェアだんどり
ソフトウェアだんどりソフトウェアだんどり
ソフトウェアだんどり
 
卒業制作でのチームゲーム開発におけるアジャイル手法の段階的適用に関する事例
卒業制作でのチームゲーム開発におけるアジャイル手法の段階的適用に関する事例卒業制作でのチームゲーム開発におけるアジャイル手法の段階的適用に関する事例
卒業制作でのチームゲーム開発におけるアジャイル手法の段階的適用に関する事例
 
ゲームエンジンの歴史概要
ゲームエンジンの歴史概要ゲームエンジンの歴史概要
ゲームエンジンの歴史概要
 
(人狼知能合宿)ビデオゲームへの人狼知能の応用について
 (人狼知能合宿)ビデオゲームへの人狼知能の応用について (人狼知能合宿)ビデオゲームへの人狼知能の応用について
(人狼知能合宿)ビデオゲームへの人狼知能の応用について
 
ゲーム作りから導くスクラムマネージャー
ゲーム作りから導くスクラムマネージャーゲーム作りから導くスクラムマネージャー
ゲーム作りから導くスクラムマネージャー
 
The SGGX Microflake Distribution 実装
The SGGX Microflake Distribution 実装The SGGX Microflake Distribution 実装
The SGGX Microflake Distribution 実装
 
くじびきイテレーション for アジャイルサムライ横浜道場
くじびきイテレーション for アジャイルサムライ横浜道場くじびきイテレーション for アジャイルサムライ横浜道場
くじびきイテレーション for アジャイルサムライ横浜道場
 
GDC 2015 でのハイエンドグラフィックス
GDC 2015 でのハイエンドグラフィックスGDC 2015 でのハイエンドグラフィックス
GDC 2015 でのハイエンドグラフィックス
 
実践的ふりかえり (SAPPORO CEDEC 2014)
実践的ふりかえり (SAPPORO CEDEC 2014)実践的ふりかえり (SAPPORO CEDEC 2014)
実践的ふりかえり (SAPPORO CEDEC 2014)
 
無料な継続的出版システム ~ t-ceremony ~
無料な継続的出版システム ~ t-ceremony ~無料な継続的出版システム ~ t-ceremony ~
無料な継続的出版システム ~ t-ceremony ~
 
TDD Boot Camp Tokyo for c++ 2014-01 デモ用資料
TDD Boot Camp Tokyo for c++ 2014-01 デモ用資料TDD Boot Camp Tokyo for c++ 2014-01 デモ用資料
TDD Boot Camp Tokyo for c++ 2014-01 デモ用資料
 
スクラム道場.10 朝会 (Game Community Summit 2013)
スクラム道場.10 朝会 (Game Community Summit 2013)スクラム道場.10 朝会 (Game Community Summit 2013)
スクラム道場.10 朝会 (Game Community Summit 2013)
 
第11回 scrum boot camp in NII ワークショップ
第11回 scrum boot camp in NII ワークショップ第11回 scrum boot camp in NII ワークショップ
第11回 scrum boot camp in NII ワークショップ
 
つくる○アジャイル
つくる○アジャイルつくる○アジャイル
つくる○アジャイル
 
Cibc lecture imagire
Cibc lecture imagireCibc lecture imagire
Cibc lecture imagire
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

TDD Boot Camp 東京 for C++ 進行

  • 1. TDD Boot Camp for C++
  • 2. 20
  • 3. 09:30 10:00 10:00 10:05 10:05 10:35 10:35 11:30 11:30 12:00 12:00 13:00 13:00 13:40 13:40 15:00 15:00 15:30 15:30 17:15 17:15 18:15 18:15 18:30 18:30
  • 4. TDD
  • 5.
  • 6.
  • 7. TDD
  • 8. 4
  • 9. 4 6 8 10 12 14 16 3 5 7 9 11 13 15
  • 10. PC
  • 11. GitHub https://github.com/imagire/TDD-Boot-Camp-Tokyo-for-CPP/ GitHub push
  • 12. google test TDD (1/5) #include <gtest/gtest.h> int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
  • 13. google test TDD (2/5) #include <gtest/gtest.h> TEST(AddTest, AddWorks) {     EXPECT_EQ(2, add(1, 1)); } int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
  • 14. google test TDD (3/5) #include <gtest/gtest.h> int add(int x, int y) {     return 0; } TEST(AddTest, AddWorks) {     EXPECT_EQ(2, add(1, 1)); } int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
  • 15. google test TDD (4/5) #include <gtest/gtest.h> int add(int x, int y) {     long z=y+x;     return z; } TEST(AddTest, AddWorks) {     EXPECT_EQ(2, add(1, 1)); } int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
  • 16. google test TDD (5/5) #include <gtest/gtest.h> int add(int x, int y) {     return x + y; } TEST(AddTest, AddWorks) {     EXPECT_EQ(2, add(1, 1)); } int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
  • 17. GoogleTest true/false ASSERT_TRUE(condition); EXPECT_TRUE(condition); condition true ASSERT_FALSE(condition); EXPECT_FALSE(condition); condition false 2 ASSERT_EQ(expected, actual); EXPECT_EQ(expected, actual); expected == actual ASSERT_NE(val1, val2); EXPECT_NE(val1, val2); val1 != val2 ASSERT_LT(val1, val2); EXPECT_LT(val1, val2); val1 < val2 ASSERT_LE(val1, val2); EXPECT_LE(val1, val2); val1 <= val2 ASSERT_GT(val1, val2); EXPECT_GT(val1, val2); val1 > val2 ASSERT_GE(val1, val2); EXPECT_GE(val1, val2); val1 >= val2 http://d.hatena.ne.jp/kaorun55/20100730/1280416866
  • 19.
  • 20. 1
  • 21. (10 ) TDD
  • 22. 4 6 8 10 12 14 16 3 5 7 9 11 13 15
  • 23. 2 4 6 8 10 12 14 16 3 5 7 9 11 13 15

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n