Presentation is loading. Please wait.

Presentation is loading. Please wait.

Test-Driven Development. Why Testing is Important? “If you don’t have tests, how do you know your code is doing the thing right and doing the right thing?”

Similar presentations


Presentation on theme: "Test-Driven Development. Why Testing is Important? “If you don’t have tests, how do you know your code is doing the thing right and doing the right thing?”"— Presentation transcript:

1 Test-Driven Development

2 Why Testing is Important? “If you don’t have tests, how do you know your code is doing the thing right and doing the right thing?”

3 Introduction Test-Driven Development (TDD) is a software development technique that involves repeatedly first writing a test case and then implementing only the code necessary to pass the test The technique began to receive publicity in the early 2000s as an aspect of Extreme Programming A method of designing software, not merely a method of testing

4 Requirements Test-driven development requires that an automated unit test, defining requirements of the code, is written before each aspect of the code itself Purpose is to check that component (unit, class, method) contract is satisfied Having good test coverage is extremely important, especially in a large systems

5 The Promise of TDD The promise of TDD is that it helps you go faster with fewer defects and with less baggage to carry around. These benefits are evident through the following characteristics of the process: No untested code Focus on requirements No code creep Improved design Small steps

6 Test-Driven Development Cycle Add a test Run all tests and see the new one fail Write some code Run the automated tests and see them succeed Refactor code

7 Benefits For developers: Much less debug time Code proven to meet requirements Tests become Safety Net Eliminate Bug Pong Rhythm of Success For business: Shorter development cycles Near zero defects Tests become an asset Tests are documentation Competitive advantage!

8 Unit-Testing Frameworks Various code-driven testing frameworks have come to be known collectively as xUnit The de facto Java unit testing framework is JUnit However, other also exists, e.g. TestNG Extremely simple and comfortable!

9 References Test-Driven Development (Wikipedia) http://en.wikipedia.org/wiki/Test- driven_development http://en.wikipedia.org/wiki/Test- driven_development Introduction to Test Driven Design http://www.agiledata.org/essays/tdd.html http://www.agiledata.org/essays/tdd.html JUnit Resources for Test Driven Development http://junit.org/


Download ppt "Test-Driven Development. Why Testing is Important? “If you don’t have tests, how do you know your code is doing the thing right and doing the right thing?”"

Similar presentations


Ads by Google