Presentation is loading. Please wait.

Presentation is loading. Please wait.

Test Driven Development Daniel Brown dxb17u. Introduction Originates from Extreme Programming (XP) Proposed by Kent Beck in 2003. Test Driven Development.

Similar presentations


Presentation on theme: "Test Driven Development Daniel Brown dxb17u. Introduction Originates from Extreme Programming (XP) Proposed by Kent Beck in 2003. Test Driven Development."— Presentation transcript:

1 Test Driven Development Daniel Brown dxb17u

2 Introduction Originates from Extreme Programming (XP) Proposed by Kent Beck in 2003. Test Driven Development (TDD) is a feature of XP Software Development Technique Based on Unit Testing Main goal is to produce “clean code that works” (Kent Beck)

3 What is TDD? TDD has only two simple rules: 1. Write code only if a test has failed 2. Eliminate Duplication at each stage These two rules imply an order to the tasks of programming.

4 TDD Cycle Write a test that fails Write code to pass the test Ensure code passes test Refactor Process is commonly described as the red/green/refactor programming mantra Fail Pass

5 Refactoring Used to eliminate duplication in TDD. “ Process of improving the design of code without changing its behaviour”. Other goals include: Improving extensibility Improving performance Changing code to adhere to coding standards

6 Direct Implications Reduces defect density of the code Programmers become more focused on system requirements. Unit Tests can become part of the system documentation. Increases developer understanding of parts of the system.

7 TDD and XP Values TDD development helps to support the main values of XP. 1. Communication Particularly relevant to agile development methodologies. 2. Feedback 3. Simplicity 4. Courage

8 Communication More likely to involve customer in development Improves Customer-Developer Communication Improves Developer-Developer communication Collective Code ownership Unit tests proved a means to understand code

9 Feedback Regular system releases to customer. Developers can respond to customer feedback efficiently. Constant unit testing Short iterations through TDD cycle TDD maximises system feedback and customer feedback.

10 Simplicity Each function is implemented one by one Reduces scope creep Customer has more control over the system being developed

11 Courage Keeps developers focused on implementing the current requirement Eliminates developer “fear” Beck states that fear has a number of negative effects.

12 Drawbacks Unit tests which repeatedly failed. Large number of tests = maintenance overhead. Tests are commonly written by the developer. Vast number of tests passing may bring a false sense of security.

13 Questions?


Download ppt "Test Driven Development Daniel Brown dxb17u. Introduction Originates from Extreme Programming (XP) Proposed by Kent Beck in 2003. Test Driven Development."

Similar presentations


Ads by Google