08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Test driven development_continuous_integration
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. 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. Agenda
● What is TDD?
● Why use TDD?
● How to do TDD?
● What is CI?
● Why use CI?
● TDD + CI
26. 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
27. Design
We need a method add(), which
takes two parameters and add
them together, then it will return
the result.
42. Unit Test Frameworks
● Java - JUni
● Python - PyUnit
● PHP - PHPUnit
● Ruby - Test:Unit
● Javascript - Jasmine
● .Net - NUnit
43. Good Test
● One test per scenario
● Test in isolation
● Readability
● Minimum Test Fixture
● Repeatable
44. Bad Smell
● NO Assert/Meaningless Assert
● High maintenance cost
● Interacting Tests
● Require manual debugging
● Evil Singleton
45. 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
46. There's No Silver Bullet
from http://www.penn-olson.com/2009/12/22/social-media-the-silver-bullet/
53. Continuous Integration is a software
development practice where members
of a team integrate their work
frequently, usually each person
integrates at least daily – leading to
multiple integrations per day.
-- Martin Fowler
54. Why CI?
● Rapid Feedback
● Reduced Risk
● Collective Ownership
● Continuous Deployment
● Offload from people
88. 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
89. 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 O'Connor
● Unit Test Isolation
● Erratic Test
● Singletons are Evil
● RSpec 讓你愛上寫測試
90. 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