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.

Test driven development_continuous_integration

6,065 views

Published on

This is the slides of my talk about test-driven development and continuous integration on 2011/06/11

Published in: Technology
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/XIXZe ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Test driven development_continuous_integration

  1. 1. Test-Driven Development & Continuous Integration Hao-Cheng Lee 本著作係依據創用 CC Attribution-ShareAlike 3.0 Unported 授權條款進行授權。如欲瀏覽本授權條款之副本,請造訪 http://creativecommons.org/licenses/by-sa/3.0/ ,或寄信至 Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA 。
  2. 2. About me● Hao-Cheng Lee● Java Engineer for 7+ years● Quality Engineer@Yahoo (till yesterday ;-))● Interested in Java, Scala, TDD, CI● email: haocheng.lee@gmail.com● twitter: https://twitter.com/#!/haocheng
  3. 3. Agenda● What is TDD?● Why use TDD?● How to do TDD?● What is CI?● Why use CI?● TDD + CI
  4. 4. TDD = TFD +Refactoring
  5. 5. Not aboutwriting tests...
  6. 6. TDD is aboutwriting better code
  7. 7. from http://ch.englishbaby.com/forum/LifeTalk/thread/441379
  8. 8. Test Myths
  9. 9. I have no time for testing
  10. 10. Technical Debt from http://www.freedebtadvice-uk.com/
  11. 11. My code isBUG-FREE!
  12. 12. from http://vincentshy.pixnet.net/blog/post/5397455
  13. 13. QA will do the testing
  14. 14. Black Box Testing from http://www.jasonser.com/marketing-black-box/
  15. 15. http://www.ocoee.org/Departments/HR/
  16. 16. Fasterfrom http://cllctr.com/view/c2fdb4d2625e109069c843ea1bb99e50
  17. 17. from Test Driven Development Tutorial by Kirrily Robert
  18. 18. Faster● Shorter release cycle● Automation saves time● Find bugs earlier
  19. 19. Betterfrom http://www.nataliedee.com/archives/2005/sep/
  20. 20. Better● Greater code coverage● The courage to refactor● Prevent regression bugs● Improve your design
  21. 21. "Im not a great programmer;Im just a good programmerwith great habits." - Kent Beck
  22. 22. Testing the Old Way
  23. 23. TDD
  24. 24. TDD
  25. 25. How to do TDD?● Design: figure out what you want to do● Test: write a test to express the design ○ It should FAIL● Implement: write the code● Test again ○ It should PASS
  26. 26. DesignWe need a method add(), which takes two parameters and addthem together, then it will return the result.
  27. 27. Test
  28. 28. FAILjava.lang.AssertionError: expected:<2> but was:<0>...at tw.idv.haocheng.play.CalculatorTest.one_plus_one_is_two(CalculatorTest.java:20)
  29. 29. Implement
  30. 30. PASS
  31. 31. Write the least codeto make the test pass
  32. 32. More Test
  33. 33. FAILjava.lang.AssertionError: expected:<4> but was:<2>...at tw.idv.haocheng.play.CalculatorTest.two_plus_two_is_four(CalculatorTest.java:25)
  34. 34. Implement
  35. 35. PASS
  36. 36. DesignThe add() method only accept positive numbers
  37. 37. Test
  38. 38. FAILjava.lang.AssertionError: IllegalArgumentException expectedat org.junit.Assert.fail(Assert.java:91)at tw.idv.haocheng.play.CalculatorTest.negative_numbers_will_throw_exception(CalculatorTest.java:32)
  39. 39. Implement
  40. 40. PASS
  41. 41. Unit Test Frameworks● Java - JUni● Python - PyUnit● PHP - PHPUnit● Ruby - Test:Unit● Javascript - Jasmine● .Net - NUnit
  42. 42. Good Test● One test per scenario● Test in isolation● Readability● Minimum Test Fixture● Repeatable
  43. 43. Bad Smell● NO Assert/Meaningless Assert● High maintenance cost● Interacting Tests● Require manual debugging● Evil Singleton
  44. 44. When is enough enough?● One Test per class● Testing the feature● Find bugs, add tests● Skip Getter/Setter if generated● Skip Private methods● Code coverage
  45. 45. Theres No Silver Bulletfrom http://www.penn-olson.com/2009/12/22/social-media-the-silver-bullet/
  46. 46. It takes time...from http://chunkeat626.blogspot.com/2010_11_01_archive.html
  47. 47. Need tomaintain tests
  48. 48. TDD is not suitable for... from http://www.flickr.com/photos/ilike/2443295369/
  49. 49. from http://tw.gamelet.com/game.do?code=heroes
  50. 50. from http://dilbert.com/
  51. 51. ContinuousIntegration
  52. 52. Continuous Integration is a softwaredevelopment practice where membersof a team integrate their workfrequently, usually each personintegrates at least daily – leading tomultiple integrations per day. -- Martin Fowler
  53. 53. Why CI?● Rapid Feedback● Reduced Risk● Collective Ownership● Continuous Deployment● Offload from people
  54. 54. Why TDD + CI?
  55. 55. Effective tests must be automatedfrom http://www.laurentbrouat.com/why-you-should-stop-sending-auto-dms/automated/
  56. 56. Write once, run often● Write tests once● Run frequently● No human input● Common output
  57. 57. Best Practices of CI● Single Source Repository● Commit often● Make Your Build Self-Testing● Automate the Build● Build fast
  58. 58. Extensible continuous integration server
  59. 59. What is Jenkins?● Open-source CI server● Easy to install and use● Extensibility
  60. 60. Why Jenkins?● GUI to manage● Strong community and eco-system● Distributed builds● Open Source and Free!
  61. 61. mailing list subscription is increasing
  62. 62. GitHub members is also increasing
  63. 63. Basic Features● Notice a change● Check out source code● Execute builds/tests● Record and publish results● Notify developers
  64. 64. CI Overview from Continuous integration with Hudson
  65. 65. Notice a change● Build Periodically● Depend on other projects● Poll SCM ○ Subversion Push vs. Pull
  66. 66. Check out source code● Subversion● CVS● Git● Mercurial● Perforce
  67. 67. Execute builds/tests● Java ○ Ant, Maven, Gradle● .Net ○ MSBuild, PowerShell● Shell Script ○ Python, Ruby, Groovy
  68. 68. Record and publish results● JUnit● TestNG● Findbugs● Cobertura● Checkstyle● PMD
  69. 69. Job Status Job State: Job Stability:
  70. 70. Findbugs Integration
  71. 71. Cobertura Integration
  72. 72. Project Relationship
  73. 73. Notify developers● Twitter● email● RSS● IM● IDE● Android/iPhone● Firefox
  74. 74. Twitter
  75. 75. Jenkins on EclipseUpdate Site: http://code.google.com/p/hudson-eclipse/
  76. 76. Jenkins on Android ● Android Market ● Jenkins Wiki
  77. 77. eXtreme Feedback Panel plugin
  78. 78. Jenkins Sound pluginhttp://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Sounds+plugin
  79. 79. Installation&Upgrade● Download Tomcat 7● Download latest jenkins.war● Put jenkins.war under webapps● Start Tomcat
  80. 80. Create a Job
  81. 81. Configure a Job
  82. 82. Configure Jenkins
  83. 83. Manage Plugins
  84. 84. Jenkins for non-Java Projects● Python● PHP● Ruby● .Net
  85. 85. Reading List● The Bowling Game Kata● Unit Testing Guidelines● Why are we embarrassed to admit that we don’t know how to write tests? (中譯版本)● "The Clean Code Talks -- Unit Testing"● Top 10 things which make your code hard to test
  86. 86. References - Test-Driven Development● Test Driven Development Tutorial by Kirrily Robert● Engineer Notebook: An Extreme Programming Episode by Robert C. Martin and Robert S. Koss● Technical Debt by Martin Fowler● InfoQ: Testing Misconceptions by Liam OConnor● Unit Test Isolation● Erratic Test● Singletons are Evil● RSpec 讓你愛上寫測試
  87. 87. References - Continuous Integration● Jenkins: http://jenkins-ci.org/● Mailing List: http://groups.google.com/group/jenkinsci- users● Wiki: http://wiki.jenkins-ci.org/● Follow @jenkinsci on Twitter● Continous Integration by Martin Fowler● Continuous Integration with Hudson - the book● Continuous Integration with Hudson on JavaWorld

×