Your SlideShare is downloading. ×
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Test-Driven Design - ¿Porqué?
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Test-Driven Design - ¿Porqué?

496

Published on

Test-Driven Design (TDD) es una idea aparentemente simple: Escriba las pruebas para su código antes de escribir el código. Es "aparentemente simple" por que transforma el rol que testing juega en el …

Test-Driven Design (TDD) es una idea aparentemente simple: Escriba las pruebas para su código antes de escribir el código. Es "aparentemente simple" por que transforma el rol que testing juega en el proceso de desarrollo y cuestiona nuestros supuestos en la industria sobre el objetivo de testing. Testing ya no es solo acerca de evitar que los defectos lleguen al usuarios finales. Testing consiste en ayudar al equipo a entender las funcionalidad que los usuarios necesitan y hacer entrega de esas funcionalidad de forma confiable y productiva. Cuando TDD se sigue hasta sus últimas consecuencias, ocurren cambios radicales en la forma que desarrollamos software, la calidad de los sistemas que construimos mejora dramáticamente en términos de fiabilidad y flexibilidad en respuesta a nuevos requerimientos.
En esta charla:
• Los Administradores y Directores recibirán una justificación estratégica a nivel de negocios sobre TDD.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
496
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Test-driven Design/Development
  • 2. TDD
    • First agile practice to become mainstream
    • Chrysler Comprehensive Compensation system
      • They needed something different
      • BUFP wasn’t working
      • How to deal with change instead of fighting it?
  • 3. Lean - Dealing with Change
      • Planning
        • Incremental
        • frequent
      • Small
        • features
        • releases
  • 4. Agile - Dealing with Change
    • Plan driven vs Planning Driven
    • Revise the plan weekly
      • reflect reality
      • make appropriate decisions
  • 5. Lean Manufacturing
    • View the problem as a Software Delivery System
      • Programmers, testers, designers, managers, BBAA.
      • Input: Feature request
      • Output: Let’s decide...
  • 6. Lean: “The Goal”- Eliyahu Goldratt
    • Alex run a manufacturing plant soon to be closed
    • He knows a consultant (Jonah)!!
    • He learns a systems approach to manufacturing and its evaluation
    • This new system is counterintuitive: Not seeking 100% machine utilization
  • 7. Lean Basics: The Goal
    • Increase the throughput
    • Decrease operating expenses
    • Decrease inventory
  • 8. Lean: Throughput
    • How much potential revenue the system can create
    • Emphasis in deliver real software to real customers. It is only paid if it is used.
    • Running Tested Features per time unit
      • RFT/month
  • 9. Lean: Operating expenses
    • Computers
    • Electricity
    • Rent
    • Insurance
    • Wages ...
  • 10. Lean:Inventory
    • Grocery Store
      • What is in the shelve
      • I bet I can sell it on time
      • It is not providing value (value = money)
  • 11. Inventory in Software?
    • Unused Features: Building a feature nobody is using [no payments]
    • Unreleased features in source control
    • Unnecessary complexity:
      • A developer adds complexity in anticipation of a future feature
  • 12. Inventory & Machine Utilization
    • Machine spits out parts at 100% utilization
      • Only 25% ended up ordered
      • 8 hour shift: 200 sold and 600 stacking up on the floor
      • Walk around parts, new warehouse!
      • Operating expenses increased! Don’t use it at 100%
  • 13. Inventory: Unnecessary Complexity
    • Developer adds complexity in anticipation
      • Developer will have to walk around these parts from now on [we have spoiled customers!!]
      • Developers are slowed down
        • More complexity
        • Probably adding duplication
  • 14. Inventory: Unnecessary Complexity
    • The more unnecessary complexity
      • The more difficult to change
      • The harder to maintain
      • Marginal costs of features goes up
    • The harder to maintain a system
      • The more expensive the feature
  • 15. TDD’s goal is to reduce Inventory
    • Keeping the cost of adding a feature as low as we can by keeping the design simple
  • 16. Lean Basics: The Goal
    • Increase the throughput (RTF/month)
    • Decrease operating expenses, - precedence
    • Decrease inventory
      • Reduce unnecessary complexity
      • Reduce unused features
      • Reduce unreleased features
  • 17. YAGNI - Decrease Unneeded Complexity
    • Design only what I need to solve the problem I have now :-(
    • I design what I need now in such a way that is ready for any change :-)
    • Example: Personal defense failure
  • 18. YAGNI - Decrease Unneeded Complexity
    • Design in a way that prevents attacks from any direction
    • Follow few principles to keep the design simple so the cost of implementing any new feature is reasonably low
    • Example: Personal defense Principles
  • 19. TDD Principles
    • Design is simple if it
      • passes the test
      • minimizes duplication
      • maximizes clarity
      • is small
    • 1. is assumed and 4. is a by-product
  • 20. TDD Principle: Reduce Duplication
    • “ I’m doing the same thing in five places, I have to change all five of them [Put rationalized justification] so I copied and pasted in four places, I forgot the fifth one” ⇒ bug
  • 21. TDD Principle: Fix Bad Names
    • By naming accurately
    • It is easier to understand how the code works
    • we may detect smells (name too weird?)
  • 22. TDD Principle: Maximize Clarity
    • Fix bad names
      • name variables after what they represent
      • name methods after what they do
      • name classes what they are
      • name interfaces after what the role they play
  • 23. TDD Principle: Fix Bad Names
    • Smell: too long with connectors like: “and”, “then”, “but”. That block of code
      • is doing too much work
      • too many responsibilities
      • it duplicates responsibilities with another part of the system
  • 24. TDD Principles
    • Design is simple if it
      • minimizes duplication
      • maximizes clarity
    • Claim: IF WE FOLLOW THESE PRINCIPLES WE REDUCE INVENTORY CREATED BY UNNECESSARY COMPLEXITY
  • 25. TDD: Recfatoring
    • Improving the design of existing code [book]
    • Systematic approach to improve the design without throwing a piece a way while rewritten it.
  • 26. Refactoring: Systematic Approach
    • Work in very small steps
      • steps are reversible
      • I can stop if I want to
      • Keep the code working at every step
      • I have tests (behavioral spec) that tells me if a structural change breaks behavior
  • 27. Traditional Design
    • We design something that meets a large number of requirements at once [cascade] Done by architects, handed off to developers
    • Caveat with high level design ideas:
      • high levels ideas right most of the time
      • low level detail wrong most of the time
  • 28. Evolutionary Design
    • The act of writing the code give us information wether the design works or not, without that information, we can’t design effectively.
    • Write code in a way that allows us to start with the low level detail and use some basic principles to make sure the high level ideal designs ideas work well
  • 29. Evolutionary Design by TDD
    • Test drives the design.
    • A test articulates a goal so I know when to stop
  • 30. Evolutionary Design: TDD cycle
    • Write a failing test
      • Articulates a goal: “I need a little piece of software to does this”
    • Make the test pass:
      • Don’t write any production code if there isn’t a failing test that requires it [no inventory]. Failing test evidence of need
  • 31. Evolutionary Design: TDD cycle
    • A new intellectual challenge
      • write it simple
      • articulate the goal with less code
      • pass the test with less code
      • remove duplication, make it clearer

×