share point 2010 unit and integration testing

21
Feature Coding Part 3 Unit and Integration Testing DEV_205 Eric Shupps

Post on 22-Oct-2014

4.223 views

Category:

Technology


15 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Share point 2010 unit and integration testing

Feature Coding

Part 3

Unit and Integration Testing

DEV_205

Eric Shupps

Page 2: Share point 2010 unit and integration testing

About Me

Eric Shupps, MVP

President, BinaryWave

Email: [email protected]

Microsoft Patterns & Practices: spg.codeplex.com

CKS:DEV cksdev.codeplex.com

Blog: www.sharepointcowboy.com

Twitter: @eshupps

Facebook: www.facebook.com/sharepointcowboy

Page 3: Share point 2010 unit and integration testing

Agenda

Testing Fundamentals

Code Optimization

Unit Testing

Integration Testing

Page 4: Share point 2010 unit and integration testing

Testing Fundamentals

Page 5: Share point 2010 unit and integration testing

Testing Objectives

• Facilitate change

• Simplify integration

• Increase modularity

• Faster changes

• Repeatable processes

• Increased confidence

• Eliminate defects

• Validate functionality

• Reduce complexity

• Less rework

• Shorter cycles

• Faster delivery times

• Fewer support requests

ReduceCosts

EnsureQuality

ImproveDynamics

IncreaseEfficiency

Page 6: Share point 2010 unit and integration testing

Testing Methodologies

Any methodology is better than no methodology

Select a methodology that supports the team dynamic and satisfies the testing objectives

Code for the customer/end user, not the methodology

Focus on modularity and sustainability

Page 7: Share point 2010 unit and integration testing

Testing Lifecycle

Unit Integration Regression

Page 8: Share point 2010 unit and integration testing

Code Optimization

Page 9: Share point 2010 unit and integration testing

Code Isolation and RefactoringClass

Method Method Method Method Method Method

Class

Method Method

Class

Method Method

Class

Method Method

Test Test Test Test Test Test

Page 10: Share point 2010 unit and integration testing

CODE ISOLATION

Refactor the core solution components for testability.

Page 11: Share point 2010 unit and integration testing

Unit Testing

Page 12: Share point 2010 unit and integration testing

Unit Testing Objectives

CodeIsolate

Validate

Integrate

Refactor

Maintain

Page 13: Share point 2010 unit and integration testing

Unit Testing Principles

Separate interface from implementation

Fail first in order to succeed

Tests do not drive functionality - they verify functionality

Features define tests and tests define methods

Tests should exercise all probable execution paths

Page 14: Share point 2010 unit and integration testing

Unit Testing Methodologies

Separate interface from implementation

Fail first in order to succeed

Tests do not drive functionality - they verify functionality

Features define tests and tests define methods

Tests should exercise all probable execution paths

Page 15: Share point 2010 unit and integration testing

UNIT TESTS

Create and execute unit tests for isolated code.

Page 16: Share point 2010 unit and integration testing

IntegrationTesting

Page 17: Share point 2010 unit and integration testing

Integration Testing Objectives

Test code execution against

target system/dependenci

es

Verify methods as they will be used in

released code

Validate/invalidate unit test results

Exercise all points of interoperability

Identify vulnerabilities in execution chain

Page 18: Share point 2010 unit and integration testing

Integration Testing Principles

Tests should exercise actual dependencies –no mocks or stubs

Tests should not be authored or driven by developer

Tests should cover all application tiers (top-down, bottom-up, or both)

Manual testing is acceptable (and often preferred)

Page 19: Share point 2010 unit and integration testing

Integration Testing Methodologies

Inverse Isolation Reusing unit tests by

replacing mock or stub objects with actual implementations

Black Box Open-ended, interface-

driven tests that explore available functionality and are not driven by specific feature requirements

White Box Predefined set of test

routines that verify specific functional requirements

Page 20: Share point 2010 unit and integration testing

INTEGRATION TESTS

Create and execute integration tests for core solution components.

Page 21: Share point 2010 unit and integration testing

Thank you for attending!

(This slide must always be the last

slide in your deck)