be a legacy code unit test ninja with typemock isolator

14
1 Roy Osherove CTO, Typemock Unit Testing Legacy Code With Isolator @RoyOsherove

Upload: typemock

Post on 13-Jan-2015

5.011 views

Category:

Technology


2 download

DESCRIPTION

Roy Osherove teaches how to use Typemock Isolator to write unit tests for legacy code that cannot be changed.23-11-2010

TRANSCRIPT

Page 1: Be a legacy code Unit Test Ninja with Typemock Isolator

1

Roy Osherove CTO, Typemock

Unit Testing Legacy CodeWith Isolator

@RoyOsherove

Page 2: Be a legacy code Unit Test Ninja with Typemock Isolator

2

Twitter : Ask @Typemock under #Legacy

Asking Questions

Page 3: Be a legacy code Unit Test Ninja with Typemock Isolator

3

Answer Survey

Giveaways:2 Isolator Licenses

Page 4: Be a legacy code Unit Test Ninja with Typemock Isolator

Our ApplicationBlogEngine.NET

Download the code Follow Along

http://blogengine.codeplex.com/

Page 5: Be a legacy code Unit Test Ninja with Typemock Isolator

What shall we test?

Blog Post Manager Ping\Trackback.Send(..)Ping\Trackback

Servers

Page 6: Be a legacy code Unit Test Ninja with Typemock Isolator

Legacy Code Ahead Lots of Dependencies Unknown Beforehand Many Rules Don’t Apply Tests are longer, and

harder to read Better to start with

integration tests

7

Page 7: Be a legacy code Unit Test Ninja with Typemock Isolator

Demo Excavating Code with Isolator

Wishful Invocation Get dependency

exception Choose Dependency from stack

FAKE dependency

Page 8: Be a legacy code Unit Test Ninja with Typemock Isolator

Summary

Approach Legacy With Caution Choose the right level of isolation Use Broad Strokes when Faking Legacy

MaintainabilityReadability

See tests fail and passtrust

9

Page 9: Be a legacy code Unit Test Ninja with Typemock Isolator

More Advice

Typemock Forumshttp://forums.typemock.com/

Support staff Blog.typemock.com

10

Page 10: Be a legacy code Unit Test Ninja with Typemock Isolator

Vs. Competitors

VS Versions• Supports vs

2005-2010• Supports .NET

2.0 – 4.0

Fakes• Any Legacy

Code• IntelliTest

Suggestions

3rd party• Works with

other profilers• Extensible

IntelliTest• Extensible

CThru

Page 11: Be a legacy code Unit Test Ninja with Typemock Isolator

12

Easy, Correct & Effective Unit Testing

“Typemock - My testing tool of choice. Each time I use it, I rediscover its power, and I'm amazed.

Great tool!”Jason C Divis, @CodingOfficer

Page 12: Be a legacy code Unit Test Ninja with Typemock Isolator

13

Twitter : Ask @Typemock

Asking Questions

Page 13: Be a legacy code Unit Test Ninja with Typemock Isolator

14

Answer All Survey Questionsafter this webinar finished

Giveaways:2 Isolator Licenses

Page 14: Be a legacy code Unit Test Ninja with Typemock Isolator

Thanks15

Roy Osherove CTO, Typemock

[email protected]