machine
play

MACHINE Roy Osherove Typemock AGENDA What are cogs? Why are they - PowerPoint PPT Presentation

COGS IN THE MACHINE Roy Osherove Typemock AGENDA What are cogs? Why are they hard to test? Integration Testing Unit Testing Interaction Excavation Todays Patterns for cog isolation Disasters waiting to happen ENVELOPING SYSTEMS


  1. COGS IN THE MACHINE Roy Osherove Typemock

  2. AGENDA What are cogs? Why are they hard to test? Integration Testing Unit Testing Interaction Excavation Today’s Patterns for cog isolation Disasters waiting to happen

  3. ENVELOPING SYSTEMS Silverlight Sharepoint Windows Workflow The CLR and java runtimes Visual Studio (or any plugin host)

  4. CREATING A PERIMETER IMPORTANT QUESTION! Does system provide a way to replace the system? CLR – You can host your own envelope with different behavior

  5. TRANSPARENT PERIMETER PROPERTIES New Code Enveloping System

  6. TRANSPARENT PERIMETER PROPERTIES New Code Enveloping System Old Code

  7. SYSTEM IS REPLACEABLE Hand code your own subsystem Use isolation frameworks and hand rolled stubs to change system boundary behavior

  8. PERIMETER FOR HAND ROLLED SYSTEM ADAPTER Perimeter New Code Enveloping System Old Code

  9. PERIMETER FOR AD-HOC ISOLATED SYSTEM USING FRAMEWORKS Perimeter New Code Enveloping System Old Code

  10. SYSTEM IS NOT REPLACEABLE Surround code with your own hand coded system adapter Use AOP to intercept and change system calls

  11. INTERACTION EXCAVATION Wishful Invocation Get dependency exception Fabricate interaction

  12. POSSIBLE PERIMETER AFTER EXCAVATION Perimeter New Code Enveloping System Old Code

  13. EMERGING PERIMETERS Interaction Based Deep-Rooted Role Based • • Was Excavated Was pre-designed • Was Excavated or • Based on or JIT designed pre-thought dependencies with TDD • Based on Contracts • • Very far from your Based on roles • Directly touching • own code Directly touching your code • Robust your code • Can be brittle • Robust

  14. TOOLS FOR CREATING PERIMETERS Powermock (Java) Cthru\Typemock (.NET) Moles (.NET)

Recommend


More recommend