Your SlideShare is downloading. ×
0
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
tem7
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

tem7

586

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
586
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. Test Driven Development THEORY • FACTS • APPLICATIONS • SUPPORT ALEXEI PIVKINE • YURIY POSLAVSKYY • SWARAJ SHERGILL • QING WEI Group 2
    • 2. <ul><li>Definition and guideline s </li></ul><ul><li>Applications of TDD </li></ul><ul><li>Tool support in different programming languages </li></ul><ul><li>Impact on development time, code quality and maintenance costs </li></ul><ul><li>Possible issues: theory vs the real world </li></ul>Outline
    • 3. Definition <ul><li>Software Design & Development technique </li></ul><ul><li>First introduced with Extreme Programming, but recently </li></ul><ul><li>started gaining more attention on its own </li></ul><ul><li>Test Driven Development = Test First Development + Refactoring </li></ul><ul><li>Allows developer to think through the design and understand the requirements </li></ul><ul><li>before writing the functional code </li></ul>
    • 4. Guidelines <ul><li>The motto of test-driven development is &quot; Red , Green , Refactor.&quot; </li></ul><ul><ul><li>Red : Create a test and make it fail. </li></ul></ul><ul><ul><li>Green : Make the test pass by any means necessary. </li></ul></ul><ul><ul><li>Refactor: Change the code to remove duplication in your project and to </li></ul></ul><ul><ul><li>improve the design while ensuring that all tests still pass. </li></ul></ul><ul><li>The &quot; Red , Green , Refactor&quot; cycle is repeated very quickly for each </li></ul><ul><li>new unit of code </li></ul>
    • 5. Test Driven Development Cycle
    • 6. TDD vs. Extreme Programming <ul><li>XP is a deliberate and disciplined approach to software development. </li></ul><ul><li>XP differs from traditional methodologies primarily in placing a higher </li></ul><ul><li>value on adaptability than on predictability </li></ul><ul><li>TDD is an approach to code creation, not a software development methodology </li></ul><ul><li>TDD first popularized as an aspect of XP </li></ul><ul><li>TDD and XP are more suitable for small to medium-sized projects </li></ul>
    • 7. Unit Testing <ul><li>A unit is the smallest testable part of an application </li></ul><ul><li>The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. </li></ul><ul><li>Available Tools: </li></ul><ul><li>JUnit for Java </li></ul><ul><li>CppUnit for C++ </li></ul><ul><li>NUnit for .NET </li></ul><ul><li>Test::Unit for Ruby </li></ul>
    • 8. Impact of TDD <ul><li>Microsoft Case Study 1 </li></ul><ul><li>Team size: 6 </li></ul><ul><li>Language: C/C++ </li></ul><ul><li>Experience level: High </li></ul><ul><li>Location: Collocated </li></ul><ul><li>Findings </li></ul>
    • 9. Impact of TDD <ul><li>Microsoft Case Study 2 </li></ul><ul><li>Team size: 5-8 </li></ul><ul><li>Language: C++/C# </li></ul><ul><li>Experience level: Medium </li></ul><ul><li>Location: Collocated </li></ul><ul><li>Findings </li></ul>
    • 10. Impact of TDD <ul><li>NRC Experiment </li></ul><ul><li>Developers: 3 rd year undergraduate computer science students </li></ul><ul><li>Language: Java </li></ul><ul><li>Experience level: Low </li></ul><ul><li>Location: Collocated </li></ul><ul><li>Application Size: Small </li></ul><ul><li>Results tested using 105 black box tests not available to developers </li></ul><ul><li>Findings </li></ul><ul><li>No statistically significant improvements in average code quality </li></ul><ul><li>More consistent quality results – higher minimum achievable quality </li></ul><ul><li>Higher productivity due to higher number of produced lines of code (test + product) </li></ul>
    • 11. Impact of TDD Other Case Studies
    • 12. Impact of TDD <ul><li>Requires extra upfront development time </li></ul><ul><li>Requires more tests per unit of production code </li></ul><ul><li>Encourages frequent regression testing </li></ul><ul><li>Improves understanding of underlying requirements </li></ul><ul><li>May or may not result in significant code quality improvements </li></ul><ul><li>Note </li></ul><ul><li>Results are difficult to generalize beyond specific environment </li></ul>
    • 13. Theory vs. Real World <ul><li>Possible Benefits </li></ul><ul><ul><li>Better structured code </li></ul></ul><ul><ul><li>Clearly defined interfaces </li></ul></ul><ul><ul><li>Not afraid to refractor (improve complex code) </li></ul></ul><ul><li>Possible Pitfalls </li></ul><ul><ul><li>Faulty tests </li></ul></ul><ul><ul><li>Incomplete coverage </li></ul></ul>
    • 14. Theory vs. Real World <ul><li>Absence of consistent and reliable data to prove that TDD brings improvements </li></ul><ul><li>Resistance to change </li></ul><ul><li>Business pressures </li></ul><ul><li>Failure to completely embrace the approach </li></ul>
    • 15. Conclusion <ul><li>What is TDD? </li></ul><ul><li>TDD, XP and unit testing </li></ul><ul><li>Case studies </li></ul><ul><li>R eal world issues </li></ul>To TDD or Not to TDD that is the question!
    • 16. References <ul><li>T.Bhat, N.Nagappan. Evaluating the Efficacy of Test-Driven Development: Industrial Case Studies. </li></ul><ul><li>Available: http://research.microsoft.com/manuvir/papers/isese-fp17288-Bhat.pdf </li></ul><ul><li>H.Erdogmus. On the Effectiveness of Test-first Approach to Programming. March 2005. </li></ul><ul><li>Available: http://iit-iti.nrc-cnrc.gc.ca/iit-publications-iti/docs/NRC-47445.pdf </li></ul><ul><li>Wikipedia, &quot;Test-driven development&quot;,  Wikipedia , [Online]. Available: http://en.wikipedia.org/wiki/Test-driven_development [Accessed: Feb. 23, 2007]. </li></ul><ul><li>Agile Data, &quot;Introduction to Test Driven Design (TDD)&quot;, Agile Data, [Online]. </li></ul><ul><li>Available: http://www.agiledata.org/essays/tdd.html [Accessed: Feb. 23, 2007]. </li></ul><ul><li>F Geisendörfer, &quot;Test Driven Development in Real World Apps,&quot; September 10, 2006. [Online].   </li></ul><ul><li>Available: http://www.thinkingphp.org/2006/09/10/test-driven-development-in-real-world-apps/ . [Accessed Feb. 23, 2007]. </li></ul><ul><li>L. Wyssocky, &quot;Some Pitfalls of Test Drive Development,&quot; March 25, 2006. [Online]. </li></ul><ul><li>Available: http://blog.qualityaspect.com/2006/03/25/some-pitfalls-of-test-driven-development/. [Accessed Feb. 23, 2007]. </li></ul><ul><li>&quot;TDD viewpoint,&quot; January 16, 2005. [Online].   </li></ul><ul><li>Available: http://neilthespod.spaces.live.com/blog/cns!F11ED9853AA5674B!110.entry. [Accessed Feb. 23, 2007]. </li></ul><ul><li>Unit Testing [Online] Available: http://en.wikipedia.org/wiki/Unit_testing [Accessed February 23, 2007] </li></ul><ul><li>JUnit Framework [Online] Available: http://www.junit.org [Accessed February 23, 2007] </li></ul><ul><li>CppUnit Framework [Online] Available: http://cppunit.sourceforge.net/cppunit-wiki [Accessed February 23, 2007] </li></ul><ul><li>NUnit Framework [Online] Available: http://www.nunit.org/ [Accessed February 23, 2007] </li></ul><ul><li>Ruby Test::Unit [Online] Available: http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html [Accessed February 23, 2007] </li></ul><ul><li>What is Extreme Programming [Online] Available: http://www.extremeprogramming.org/what.html [Accessed February 23, 2007] </li></ul><ul><li>Jeffrey Palermo, “Guidelines for Test-Driven Development”, Visual Studio 2005 Technical Articles, May 2006 , [Online] </li></ul><ul><li>Available: http://msdn2.microsoft.com/en-us/library/aa730844(VS.80).aspx [Accessed: Feb. 23, 2007]. </li></ul>

    ×