test driven development part 1

17
Test Driven Test Driven Development Development Part 1 Gamal Shaaban Gamal Shaaban International Centers Orange Labs Cairo Mobile Applications & Software Development

Upload: gamal-shaban

Post on 15-Jan-2015

122 views

Category:

Education


1 download

DESCRIPTION

TDD benefits Clean Design Fast Feedback Concrete Evidence That Your Software Works Write Better Code Reduced Gold-Plating Regression Test Suite How To Do TDD Analyze the requirements and write the list of tasks or features Pick a task or feature Brainstorm a list of tests for the task or feature Review the tests list and pick a test Write the test case Run the test case and see it fails to compile Write only enough code that the test case compiles Run the test and see running the code fails Write only enough code to just pass the test Refactor the production code and eliminate duplication Repeat

TRANSCRIPT

Page 1: Test Driven Development Part 1

Test Driven Test Driven DevelopmentDevelopment

Part 1Gamal Shaaban Gamal Shaaban International CentersOrange Labs CairoMobile Applications & Software Development

Page 2: Test Driven Development Part 1

Orange presentation

Questions?

Page 3: Test Driven Development Part 1

3 Orange restricted

Fact?

Page 4: Test Driven Development Part 1

4 Orange restricted

Session-1Session-1

4

• Why TDD• Quality In Time and Cost• Cost To Change

• Steps To TDD• Red Green Refactor Cycle• Write Red Test• Write Green Code• Do Refactoring Code

Page 5: Test Driven Development Part 1

5 Orange restricted

Why TDD: Quality TriangleWhy TDD: Quality Triangle

• TDD benefits

o Clean Designo Fast Feedbacko Concrete Evidence That

Your Software Workso Write Better Codeo Reduced Gold-Platingo Regression Test Suite

5

Page 6: Test Driven Development Part 1

6 Orange restricted

Cost To Change ChartCost To Change Charthttp://www.agilemodeling.com/essays/costOfChange.htm

6

Page 7: Test Driven Development Part 1

7 Orange restricted

Steps To TDDSteps To TDD

7

Page 8: Test Driven Development Part 1

8 Orange restricted

Red Green Refactor Red Green Refactor CycleCycle

Page 9: Test Driven Development Part 1

9 Orange restricted

Write fail tests, make test passes, refactor your code, repeat this action

9

Page 10: Test Driven Development Part 1

10 Orange restricted

How To Do TDDHow To Do TDD

1. Analyze the requirements and write the list of tasks or features

2. Pick a task or feature

3. Brainstorm a list of tests for the task or feature

4. Review the tests list and pick a test

5. Write the test case

6. Run the test case and see it fails to compile

7. Write only enough code that the test case compiles

8. Run the test and see running the code fails

9. Write only enough code to just pass the test

10.Refactor the production code and eliminate duplication

11.Repeat

10

Page 11: Test Driven Development Part 1

11 Orange restricted

Page 12: Test Driven Development Part 1

12 Orange restricted

Page 13: Test Driven Development Part 1

13 Orange restricted

Page 14: Test Driven Development Part 1

14 Orange restricted

Page 15: Test Driven Development Part 1

15 Orange restricted

Page 16: Test Driven Development Part 1

Orange presentation

Questions?

Page 17: Test Driven Development Part 1

thanks