Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

TDD Boot Camp 東京 for C++ 進行

1,223 views

Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

TDD Boot Camp 東京 for C++ 進行

  1. 1. TDD Boot Camp for C++
  2. 2. 20
  3. 3. 09:30 10:0010:00 10:0510:05 10:3510:35 11:3011:30 12:0012:00 13:0013:00 13:4013:40 15:0015:00 15:3015:30 17:1517:15 18:1518:15 18:3018:30
  4. 4. TDD
  5. 5. TDD
  6. 6. 4
  7. 7. 4 6 8 10 12 14 163 5 7 9 11 13 15
  8. 8. PC
  9. 9. GitHub https://github.com/imagire/TDD-Boot-Camp-Tokyo-for-CPP/ GitHub push
  10. 10. google test TDD (1/5)#include <gtest/gtest.h>int main(int argc, char* argv[]){ ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS();}
  11. 11. 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();}
  12. 12. 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();}
  13. 13. 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();}
  14. 14. 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();}
  15. 15. GoogleTest true/falseASSERT_TRUE(condition); EXPECT_TRUE(condition); condition trueASSERT_FALSE(condition); EXPECT_FALSE(condition); condition false 2ASSERT_EQ(expected, actual); EXPECT_EQ(expected, actual); expected == actualASSERT_NE(val1, val2); EXPECT_NE(val1, val2); val1 != val2ASSERT_LT(val1, val2); EXPECT_LT(val1, val2); val1 < val2ASSERT_LE(val1, val2); EXPECT_LE(val1, val2); val1 <= val2ASSERT_GT(val1, val2); EXPECT_GT(val1, val2); val1 > val2ASSERT_GE(val1, val2); EXPECT_GE(val1, val2); val1 >= val2 http://d.hatena.ne.jp/kaorun55/20100730/1280416866
  16. 16. Are y!Ready?
  17. 17. 1
  18. 18. (10 )TDD
  19. 19. 4 6 8 10 12 14 163 5 7 9 11 13 15
  20. 20. 2 4 6 8 10 12 14 16 3 5 7 9 11 13 15

×