1 / 11

Test driving to clean CODE

Test driving to clean CODE. Kenrick Chien CTO, Critical Phase. Photo by Toni Blay - http://flic.kr/p/5CNci. Code we want to avoid. BENEFITS. Easy to refactor Cleaner; less time spent debugging Documentation - examples More time to do what you enjoy. THE TDD “CYCLE”. RED GREEN

hogan
Télécharger la présentation

Test driving to clean CODE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Test driving to clean CODE • Kenrick Chien • CTO, Critical Phase

  2. Photo by Toni Blay - http://flic.kr/p/5CNci Code we want to avoid

  3. BENEFITS • Easy to refactor • Cleaner; less time spent debugging • Documentation - examples • More time to do what you enjoy

  4. THE TDD “CYCLE” • RED • GREEN • REFACTOR

  5. UNCLE BOB’S Three LAWS OF TDD • You are not allowed to write any production code unless it is to make a failing unit test pass. • You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures. • You are not allowed to write any more production code than is sufficient to pass the one failing unit test.

  6. MYTHS • All about unit tests • Testing methods, not behavior • Too slow; I don’t have time for this!

  7. Limitations • New language /framework • Database & UI • Culture

  8. Kata

  9. references Beck, K. Test-Driven Development by Example. Addison Wesley, 2003. Erdogmus, Hakan; Morisio, Torchiano. "On the Effectiveness of Test-first Approach to Programming". Proceedings of the IEEE Transactions on Software Engineering, 31(1). January 2005. <http://iit-iti.nrc-cnrc.gc.ca/publications/nrc-47445_e.html> Freeman, Steve and Nat Pryce. Growing Object-Oriented Software, Guided By Tests     Massachusetts: Pearson Education, Inc, 2009. Fowler, Martin. Refactoring: Improving the Design of Existing Code. USA: Addison Wesley Longman, Inc. 1999. Martin, Robert. Agile Software Development Principles, Patterns, and Practices. New Jersey: Pearson Education, Inc. 2003.

  10. Contact • e-mail: ken.chien@criticalphase.com • website: http://www.criticalphase.com • blog: http://geekyninja.blogspot.com • twitter: @kenrickchien

More Related