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

machine
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Roy Osherove Typemock

COGS IN THE MACHINE

slide-2
SLIDE 2

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

AGENDA

slide-3
SLIDE 3

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

ENVELOPING SYSTEMS

slide-4
SLIDE 4

Does system provide a way to replace the system? CLR – You can host your own envelope with different behavior

CREATING A PERIMETER IMPORTANT QUESTION!

slide-5
SLIDE 5

TRANSPARENT PERIMETER PROPERTIES

Enveloping System New Code

slide-6
SLIDE 6

TRANSPARENT PERIMETER PROPERTIES

Enveloping System New Code Old Code

slide-7
SLIDE 7

Hand code your own subsystem Use isolation frameworks and hand rolled stubs to change system boundary behavior

SYSTEM IS REPLACEABLE

slide-8
SLIDE 8

PERIMETER FOR HAND ROLLED SYSTEM ADAPTER

Enveloping System Perimeter New Code Old Code

slide-9
SLIDE 9

PERIMETER FOR AD-HOC ISOLATED SYSTEM USING FRAMEWORKS

Enveloping System Perimeter New Code Old Code

slide-10
SLIDE 10

Surround code with your own hand coded system adapter Use AOP to intercept and change system calls

SYSTEM IS NOT REPLACEABLE

slide-11
SLIDE 11

Wishful Invocation Get dependency exception Fabricate interaction

INTERACTION EXCAVATION

slide-12
SLIDE 12

POSSIBLE PERIMETER AFTER EXCAVATION

Enveloping System Perimeter New Code Old Code

slide-13
SLIDE 13

EMERGING PERIMETERS

Deep-Rooted Role Based Interaction Based

  • Was Excavated
  • Based on

dependencies

  • Very far from your
  • wn code
  • Robust
  • Was pre-designed
  • r JIT designed

with TDD

  • Based on roles
  • Directly touching

your code

  • Robust
  • Was Excavated or

pre-thought

  • Based on Contracts
  • Directly touching

your code

  • Can be brittle
slide-14
SLIDE 14

Powermock (Java) Cthru\Typemock (.NET) Moles (.NET)

TOOLS FOR CREATING PERIMETERS