unit testing sharepoint applications

22
UNIT TESTING SHAREPOINT APPLICATIONS Episode IV: A New Hope Gil Zilberfeld Typemock

Upload: gil-zilberfeld

Post on 11-May-2015

1.607 views

Category:

Technology


3 download

DESCRIPTION

Presented at the SharePoint Israeli user group, June 2010

TRANSCRIPT

Page 1: Unit Testing SharePoint Applications

UNIT TESTING SHAREPOINT

APPLICATIONS

Episode IV: A New Hope

Gil Zilberfeld

Typemock

Page 2: Unit Testing SharePoint Applications

Typemock

Who am I?

Software developer for 15 years

Technical Evangelist at Typemock

@gil_zilberfeld

• www.gilzilberfeld.com

Let me tell you about my first REAL job...

Page 3: Unit Testing SharePoint Applications

Typemock

What’s the plan?

Unit Testing 101

Tools

Examples

Start now

o It's not that hard

Page 4: Unit Testing SharePoint Applications

Typemock

What is unit testing?

Page 5: Unit Testing SharePoint Applications

Typemock

Why Unit Testing?

– Reduce pain

– Improve productivity

Page 6: Unit Testing SharePoint Applications

Typemock

Automated Unit Testing

Short feedback cycle

Page 7: Unit Testing SharePoint Applications

Typemock

Where do I start?

Page 8: Unit Testing SharePoint Applications

Typemock

SharePoint Development

The real world…

Page 9: Unit Testing SharePoint Applications

Typemock

And the worst part is

Page 10: Unit Testing SharePoint Applications

Typemock

So is SharePoint Untestable?

Page 11: Unit Testing SharePoint Applications

UNIT TESTING SHAREPOINT

APPLICATIONS

Episode V:

The frameworks strike back

Page 12: Unit Testing SharePoint Applications

Typemock

Dependencies

Page 13: Unit Testing SharePoint Applications

Typemock

Why do we need isolation?

Applications are complex

We can’t touch a live system

When we call SharePoint

Setup

Teardown

Repeat

Page 14: Unit Testing SharePoint Applications

Typemock

Isolation Frameworks to the Rescue

Page 15: Unit Testing SharePoint Applications

Typemock

Fakes help me change behavior without changing the code

 

Page 16: Unit Testing SharePoint Applications

Typemock

Fakes help me verify calls

 

Page 17: Unit Testing SharePoint Applications

ISOLATION FRAMEWORKS DEMO

Page 18: Unit Testing SharePoint Applications

Typemock

What are the differences?

Page 19: Unit Testing SharePoint Applications

Typemock

Unit tests are the antidote to stupid bugs

it's impossible to stick with unit testing without a framework

Page 20: Unit Testing SharePoint Applications

Typemock

Start now

It's a productivity tool

Make it part of your tool belt

Page 21: Unit Testing SharePoint Applications

Typemock

Resources Typemock

http://www.typemock.com

Moles http://research.microsoft.com/

en-us/projects/moles/

Mock Comparison Project http://code.google.com/p

/mocking-frameworks-compare/

Me: Twitter: @gil_zilberfeld http://www.gilzilberfeld.com [email protected]

Page 22: Unit Testing SharePoint Applications

Typemock

Questions?