Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Introduction to test_driven_development
1. Introduction to
Test-Driven Development
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
● Software Engineer @ Armorize
● Interested in Java, Scala, TDD, CI
● email: haocheng.lee@gmail.com
● twitter: haocheng
● Google+: 浩誠
27. 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
28. Design
We need a method add(), which
takes two parameters and add
them together, then it will return
the result.
54. FAIL
wicket.markup.MarkupException: Unable to find
component with id 'accountFormPanel' in
[MarkupContainer ....
at ngc.account.wicket.edit.CreateAccountPageTest.
setUp
(CreateAccountPageTest.java:49)
69. 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
70. 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 讓你愛上寫測試