Test-Driven Development - PowerPoint PPT Presentation

About This Presentation
Title:

Test-Driven Development

Description:

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? – PowerPoint PPT presentation

Number of Views:120
Avg rating:3.0/5.0
Slides: 10
Provided by: ltnLvaps
Category:

less

Transcript and Presenter's Notes

Title: Test-Driven Development


1
Test-Driven Development
2
Why Testing is Important?
  • If you dont 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
  • Extremely simple and comfortable

9
References
  • Test-Driven Development (Wikipedia)
    http//en.wikipedia.org/wiki/Test-driven_developme
    nt
  • Introduction to Test Driven Design
    http//www.agiledata.org/essays/tdd.html
  • Resources for Test Driven Development
  • http//junit.org/
Write a Comment
User Comments (0)
About PowerShow.com