Share point 2010 unit and integration testing

Download Share point 2010 unit and integration testing

Post on 22-Oct-2014

4.161 views

Category:

Technology

13 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

<p>Best Practices Slide Deck</p> <p>Feature Coding</p> <p>Part 3</p> <p>Unit and Integration Testing</p> <p>DEV_205</p> <p>Eric Shupps</p> <p>About Me</p> <p>Eric Shupps, MVP</p> <p> President, BinaryWave</p> <p> Email: eshupps@binarywave.com</p> <p> Microsoft Patterns &amp; Practices: spg.codeplex.com</p> <p> CKS:DEV cksdev.codeplex.com</p> <p> Blog: www.sharepointcowboy.com</p> <p> Twitter: @eshupps</p> <p> Facebook: www.facebook.com/sharepointcowboy</p> <p>Agenda</p> <p> Testing Fundamentals</p> <p>Code Optimization</p> <p>Unit Testing</p> <p> Integration Testing</p> <p>Testing Fundamentals</p> <p>Testing Objectives</p> <p> Facilitate change Simplify integration Increase modularity</p> <p> Faster changes Repeatable processes Increased confidence</p> <p> Eliminate defects Validate functionality Reduce complexity</p> <p> Less rework Shorter cycles Faster delivery times Fewer support </p> <p>requests</p> <p>ReduceCosts</p> <p>EnsureQuality</p> <p>ImproveDynamics</p> <p>IncreaseEfficiency</p> <p>Testing Methodologies</p> <p> Any methodology is better than no methodology</p> <p> Select a methodology that supports the team dynamic and satisfies the testing objectives</p> <p> Code for the customer/end user, not the methodology</p> <p> Focus on modularity and sustainability</p> <p>Testing Lifecycle</p> <p>Unit Integration Regression</p> <p>Code Optimization</p> <p>Code Isolation and RefactoringClass</p> <p>Method Method Method Method Method Method</p> <p>Class</p> <p>Method Method</p> <p>Class</p> <p>Method Method</p> <p>Class</p> <p>Method Method</p> <p>Test Test Test Test Test Test</p> <p>CODE ISOLATION</p> <p>Refactor the core solution components for testability.</p> <p>Unit Testing</p> <p>Unit Testing Objectives</p> <p>CodeIsolate</p> <p>Validate</p> <p>Integrate</p> <p>Refactor</p> <p>Maintain</p> <p>Unit Testing Principles</p> <p> Separate interface from implementation</p> <p> Fail first in order to succeed</p> <p> Tests do not drive functionality - they verify functionality</p> <p> Features define tests and tests define methods</p> <p> Tests should exercise all probable execution paths</p> <p>Unit Testing Methodologies</p> <p> Separate interface from implementation</p> <p> Fail first in order to succeed</p> <p> Tests do not drive functionality - they verify functionality</p> <p> Features define tests and tests define methods</p> <p> Tests should exercise all probable execution paths</p> <p>UNIT TESTS</p> <p>Create and execute unit tests for isolated code.</p> <p>IntegrationTesting</p> <p>Integration Testing Objectives</p> <p>Test code execution against </p> <p>target system/dependenci</p> <p>es </p> <p>Verify methods as they will be used in </p> <p>released code</p> <p>Validate/invalidate unit test results</p> <p>Exercise all points of interoperability</p> <p>Identify vulnerabilities in execution chain</p> <p>Integration Testing Principles</p> <p> Tests should exercise actual dependencies no mocks or stubs</p> <p> Tests should not be authored or driven by developer</p> <p> Tests should cover all application tiers (top-down, bottom-up, or both)</p> <p> Manual testing is acceptable (and often preferred)</p> <p>Integration Testing Methodologies</p> <p> Inverse Isolation Reusing unit tests by </p> <p>replacing mock or stub objects with actual implementations</p> <p> Black Box Open-ended, interface-</p> <p>driven tests that explore available functionality and are not driven by specific feature requirements</p> <p> White Box Predefined set of test </p> <p>routines that verify specific functional requirements</p> <p>INTEGRATION TESTS</p> <p>Create and execute integration tests for core solution components.</p> <p>Thank you for attending!</p> <p>(This slide must always be the last </p> <p>slide in your deck)</p>