Test Driven Development Part 1
-
Upload
gamal-shaban -
Category
Education
-
view
118 -
download
1
description
Transcript of Test Driven Development Part 1
Test Driven Test Driven DevelopmentDevelopment
Part 1Gamal Shaaban Gamal Shaaban International CentersOrange Labs CairoMobile Applications & Software Development
Orange presentation
Questions?
3 Orange restricted
Fact?
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
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
6 Orange restricted
Cost To Change ChartCost To Change Charthttp://www.agilemodeling.com/essays/costOfChange.htm
6
7 Orange restricted
Steps To TDDSteps To TDD
7
8 Orange restricted
Red Green Refactor Red Green Refactor CycleCycle
9 Orange restricted
Write fail tests, make test passes, refactor your code, repeat this action
9
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
11 Orange restricted
12 Orange restricted
13 Orange restricted
14 Orange restricted
15 Orange restricted
Orange presentation
Questions?
thanks