SlideShare a Scribd company logo
Platinum
Sponsors



Gold
Sponsors




Silver
Sponsors
DATABASE UNIT TESTING
MADE EASY WITH VISUAL
STUDIO
Sanil Mhatre
Database Developer, Scottrade
About Me

   Database Developer –Scottrade (@scottradejobs)

   MCTS – MS SQL Server 2008 Database
    Development

   http://SQLWithSanil.com

   @SQLSuperGuru

   MSDN Forums & SQLServerCentral.com

   SQL Saturday #154 | St.Louis | Sept 15
Pre-requisites

   MS Visual Studio Team system framework & tools

   MS Visual Studio Team System (VSTS) 2010 &
    2012
       Ultimate & Premium Editions – create, modify & run
        database unit tests

       Professional Edition – run database unit tests but
        cannot create or modify them

   MS Visual Studio Team System 2008 Database
Agenda

   Software Testing – Basics
   Unit Testing – Basics
   Database Unit Testing – Principles,
    Terminology & Levels
   Demo – Implement Database Unit Testing with
    VSTS 2010 & MS SQL Server 2008 R2
   New features in VSTS 2012
Software Testing
   Meet Requirements & Expectations
   Deterministic & Predictable outcome
Types of Software Testing
Criteria               Black Box Testing        White Box Testing
                       Method in which the
                                                Method in which the
                       internal design/
                                                internal design/
                       implementation of the
Definition                                      implementation of the
                       item being tested is
                                                item being tested is
                       NOT known to the
                                                known to the tester.
                       tester
                       Mainly applicable to
                                                Mainly applicable to
                       higher levels of
                                                lower levels of
Levels Applicable To   testing:Acceptance
                                                testing:Unit Testing
                       Testing
                                                Integration Testing
                       System Testing
                       Generally, independent   Generally, Software
Responsibility
                       Software Testers         Developers
Programming
                       Not Required             Required
Knowledge
Levels of Software Testing

   Unit Testing

   Integration Testing

   System Testing

   System Integration Testing
What is Unit Testing ?
   Validation & Verification Methodology
   Belongs to the White Box testing category
   Test individual units of Source Code
   Unit – smallest testable part of application
       Method, Function, Class

   Tests created before or during development
   Tests conducted during development
Goals of Database Unit Testing

   Ensure quality & accuracy of database
    deliverables

   Establish a baseline state of your database

   Verify Subsequent changes made to database
    objects

   Identify regression issues throughout the
    application lifecycle
Database Unit Testing
Terminology
           • Isolated Environment (database)
           • Local development, testing &
SandBox      validation
           • Created by Script, VSTS Project
             or Restoring backup



           • Exercises a targeted code path
TestCase   • Multiple assertions
Database Unit Testing
Terminology

            • Simple Condition to
              indicate success or failure
            • Returns a True or False
            • Verifies Expected
Assertion     Interface
            • Verifies extraneous
              Results
            • Verifies data modification
              behavior
Database Unit Testing
Terminology

         • Collection of all test cases
 Unit      for a given stored procedure
         • Tests interface, code &
 Test      behavior

         • TSQL Scripts that executes a
           test case
 Test    • May include assertions like;
           • Return values
Script     • Output parameters
           • Expected Errors
Database Unit Testing
Terminology

         • Logical & named grouping
           of related unit tests
         • Multiple test lists can be
 Test      created
         • Can be run as a unit
 List    • A test suite
         • Builds & Check in Policy
         • Deprecated in VSTS 2012
Database Unit Testing
Terminology

          • TSQL Scripts
          • Prepare database for unit
Setup       testing
   &      • Returns database back to pre
            test state after testing
Cleanu    • Framework also provides
   p        common Initialize & Cleanup
            Scripts
Scripts   • Pre Test and Post Test Scripts
          • Data Generation Plans
Database Unit Testing
  Principles
Isolation
• Outcome of one test must not affect the outcome of
  any other test(s)
• Each test must return the database back to its
  previous state after execution
Independence
• One test case must not depend on any other test case
• Each test case must be run independently of any other
  test case
• Test case assertion must be independent of the order
  of it’s execution
Database Unit Testing
    Principles
Characteristics of Ideal Unit Test
• Exercise all possible code paths
• Evaluate all possible conditions
• Validate correct behavior for each path/condition

Considerable efforts for exhaustive testing
•   Non Trivial stored procedures
•   Number of input parameters
•   Permutations of optional parameters
•   Error code paths
Testable Interfaces of a Stored
Procedure

     Input &     • Name
     Output      • Data Type (Length)
   Parameters    • Optionality


   Return Code • Success/failure



    Row Count    • SET NOCOUNT ON/OFF
Testable Interfaces of a Stored
Procedure
                  •   One or more SELECT statements
                  •   Number of Columns
   Result Set     •   Column Ordinal position
                  •   Column Name & Data Type


  Informational • PRINT Messages
    Messages    • RaiseError – Severity 10 & below



     Error        • RaiseError – Severity 10 & above
   Messages
Unit Test Conditions
Predefined Test conditions in VSTS 2010
   Data Checksum
   Empty ResultSet/Non Empty Result Set
   Execution Time
   Expected Schema
   Row Count
   Scalar Value
   Inconclusive
Levels of Unit Testing
Factors Affecting the choice of Appropriate Level
of Unit testing

        Costs of Unit test development & maintenance


         Added Value of Quality


         Application Criticality & Frequency of use

         Project Deadlines
Levels of Unit Testing


          • Smallest amount of testing
          • Ensures error free compiles
          • No code is exercised
          • Consists of single test case
Minimal     with SET FMTONLY ON
          • Executes with NULL inputs
          • Intrinsic Assertion – No
            Errors
Levels of Unit Testing

          • Exercises commonly used
            code paths & conditions
          • One step above Minimal
          • Tests Empty/Non-Empty
Margina     Result sets
   l      • Some assertion of typical
            behavior & expected
            interface
          • Not a thorough & complete
            test
Levels of Unit Testing

          • Exercises all code paths &
            conditions
          • Test cases for all permutations of
            optional parameters
Complet   • Multiple Assertions to completely
            verify interface & behavior
  e       • Could also verify column names
            of result set
          • It’s an exhaustive unit test to
            verify all but unexpected errors
Levels of Unit Testing

   Possible to develop and un-testable stored
    procedure ?
       A search stored procedure with 8 optional parameters
        will need over 2000 test cases

       Numerous found/not found conditions

       Error validation

   Possibly an indicator of flawed design

   Consider refactoring to facilitate testability
Demo

   Prerequisite : Database Project Exists in VSTS

   Create a Unit Test Project in VSTS

   Configure SandBox

   Create Tests

   Run Tests
New in VSTS 2012

   Redesigned Unit Test Explorer
   Support for 3rd party testing frameworks
   Code Analysis improvements
   Continuous test runner
   Deprecated Features
     Test   lists
     Generate       Unit Test Wizards
Conclusion

   Software Testing - Basics

   Unit Testing – Basics

   Database Unit Testing – Detailed discussion on
    Principles, Goals & Levels

   Demo – Implementation of Database Unit
    Testing with VSTS 2010 & SQL Server 2008 R2
Resources

   MSDN
     http://msdn.microsoft.com/en-

     us/library/aa833283.aspx

     http://msdn.microsoft.com/en-

     us/library/aa833423.aspx

   Wikipedia
     http://en.wikipedia.org/wiki/Software_testing


   Image - http://i.swebee.com/content/error-404-
THANK YOU !

Questions & Feedback

More Related Content

What's hot (20)

PDF
Software testing: an introduction - 2017
XavierDevroey
 
PPTX
Unit testing
Slideshare
 
PDF
Testing artifacts test cases
Petro Chernii
 
PDF
Unit testing on embedded target with C++Test
Engineering Software Lab
 
PPT
Testing strategies
chaitanya_yarlagadda
 
PPTX
Integration in component based technology
Saransh Garg
 
PPT
Software Testing
Kiran Kumar
 
PPT
A survey of software testing
Tao He
 
PPTX
Unit testing
princezzlove
 
PPT
Test case design
99pillar
 
PPT
Testing
nazeer pasha
 
PPT
debugging and testing
PV Farms
 
PPT
Test execution may_04_2006
SivaprasanthRentala1975
 
PPTX
Object oriented testing
Haris Jamil
 
PPTX
White box & Black box testing
NitishMhaske1
 
PPTX
Quality Analyst Training - Gain America
GainAmerica
 
PPTX
White box black box & gray box testing
Himanshu
 
PPT
Test Techniques
nazeer pasha
 
PPT
Chapter 14 software testing techniques
SHREEHARI WADAWADAGI
 
PPTX
Practical unit testing in c & c++
Matt Hargett
 
Software testing: an introduction - 2017
XavierDevroey
 
Unit testing
Slideshare
 
Testing artifacts test cases
Petro Chernii
 
Unit testing on embedded target with C++Test
Engineering Software Lab
 
Testing strategies
chaitanya_yarlagadda
 
Integration in component based technology
Saransh Garg
 
Software Testing
Kiran Kumar
 
A survey of software testing
Tao He
 
Unit testing
princezzlove
 
Test case design
99pillar
 
Testing
nazeer pasha
 
debugging and testing
PV Farms
 
Test execution may_04_2006
SivaprasanthRentala1975
 
Object oriented testing
Haris Jamil
 
White box & Black box testing
NitishMhaske1
 
Quality Analyst Training - Gain America
GainAmerica
 
White box black box & gray box testing
Himanshu
 
Test Techniques
nazeer pasha
 
Chapter 14 software testing techniques
SHREEHARI WADAWADAGI
 
Practical unit testing in c & c++
Matt Hargett
 

Viewers also liked (12)

PDF
Unit testing 101
Erkin Ünlü
 
PDF
How to improve your unit tests?
Péter Módos
 
PDF
Unit Testing SQL Server
Giovanni Scerra ☃
 
PDF
Efficient JavaScript Unit Testing, JavaOne China 2013
Hazem Saleh
 
PDF
Unit testing JavaScript using Mocha and Node
Josh Mock
 
PPT
Project Quality Planning and KickOff
kaushikanirudh
 
PPTX
An Introduction to Unit Testing
Joe Tremblay
 
PPTX
JUnit- A Unit Testing Framework
Onkar Deshpande
 
PDF
Unit testing of spark applications
Knoldus Inc.
 
PPTX
Introduction to White box testing
Aliaa Monier Ismaail
 
PPTX
UNIT TESTING PPT
suhasreddy1
 
PPT
Software Testing
Mousmi Pawar
 
Unit testing 101
Erkin Ünlü
 
How to improve your unit tests?
Péter Módos
 
Unit Testing SQL Server
Giovanni Scerra ☃
 
Efficient JavaScript Unit Testing, JavaOne China 2013
Hazem Saleh
 
Unit testing JavaScript using Mocha and Node
Josh Mock
 
Project Quality Planning and KickOff
kaushikanirudh
 
An Introduction to Unit Testing
Joe Tremblay
 
JUnit- A Unit Testing Framework
Onkar Deshpande
 
Unit testing of spark applications
Knoldus Inc.
 
Introduction to White box testing
Aliaa Monier Ismaail
 
UNIT TESTING PPT
suhasreddy1
 
Software Testing
Mousmi Pawar
 
Ad

Similar to Database Unit Testing Made Easy with VSTS (20)

PDF
SELJE_Database_Unit_Testing.pdf
Eric Selje
 
PPT
Test Levels & Techniques
Dhanasekaran Nagarajan
 
PPT
Unit testing
medsherb
 
PDF
SELJE_Database_Unit_Testing_Slides.pdf
Eric Selje
 
ZIP
Unit Testing in Java
guy_davis
 
PPT
A testing framework for Microsoft SQL-Server
elliando dias
 
PPTX
Black & White Box testing
Mohamed Zeinelabdeen Abdelgader Farh jber
 
PPTX
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
Alessandro Alpi
 
PPT
An overview to Software Testing
Atul Mishra
 
PPT
Types of Software Testing
Nishant Worah
 
PPTX
1.1 Chapter_22_ Unit Testing-testing (1).pptx
tiyaAbid
 
PPS
Why Unit Testingl
priya_trivedi
 
PPS
Why Unit Testingl
priya_trivedi
 
PPS
Why unit testingl
Priya Sharma
 
PPTX
A Software Testing Intro
Evozon Test Lab
 
PPT
Automated Testing with Databases
elliando dias
 
PPT
software testing
Mayank Gupta
 
PPT
Chapter 3 SOFTWARE TESTING PROCESS
st. michael
 
KEY
Client Side Unit Testing
cloud chen
 
PPT
Using xUnit as a Swiss-Aarmy Testing Toolkit
Chris Oldwood
 
SELJE_Database_Unit_Testing.pdf
Eric Selje
 
Test Levels & Techniques
Dhanasekaran Nagarajan
 
Unit testing
medsherb
 
SELJE_Database_Unit_Testing_Slides.pdf
Eric Selje
 
Unit Testing in Java
guy_davis
 
A testing framework for Microsoft SQL-Server
elliando dias
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
Alessandro Alpi
 
An overview to Software Testing
Atul Mishra
 
Types of Software Testing
Nishant Worah
 
1.1 Chapter_22_ Unit Testing-testing (1).pptx
tiyaAbid
 
Why Unit Testingl
priya_trivedi
 
Why Unit Testingl
priya_trivedi
 
Why unit testingl
Priya Sharma
 
A Software Testing Intro
Evozon Test Lab
 
Automated Testing with Databases
elliando dias
 
software testing
Mayank Gupta
 
Chapter 3 SOFTWARE TESTING PROCESS
st. michael
 
Client Side Unit Testing
cloud chen
 
Using xUnit as a Swiss-Aarmy Testing Toolkit
Chris Oldwood
 
Ad

Recently uploaded (20)

PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 

Database Unit Testing Made Easy with VSTS

  • 2. DATABASE UNIT TESTING MADE EASY WITH VISUAL STUDIO Sanil Mhatre Database Developer, Scottrade
  • 3. About Me  Database Developer –Scottrade (@scottradejobs)  MCTS – MS SQL Server 2008 Database Development  http://SQLWithSanil.com  @SQLSuperGuru  MSDN Forums & SQLServerCentral.com  SQL Saturday #154 | St.Louis | Sept 15
  • 4. Pre-requisites  MS Visual Studio Team system framework & tools  MS Visual Studio Team System (VSTS) 2010 & 2012  Ultimate & Premium Editions – create, modify & run database unit tests  Professional Edition – run database unit tests but cannot create or modify them  MS Visual Studio Team System 2008 Database
  • 5. Agenda  Software Testing – Basics  Unit Testing – Basics  Database Unit Testing – Principles, Terminology & Levels  Demo – Implement Database Unit Testing with VSTS 2010 & MS SQL Server 2008 R2  New features in VSTS 2012
  • 6. Software Testing  Meet Requirements & Expectations  Deterministic & Predictable outcome
  • 7. Types of Software Testing Criteria Black Box Testing White Box Testing Method in which the Method in which the internal design/ internal design/ implementation of the Definition implementation of the item being tested is item being tested is NOT known to the known to the tester. tester Mainly applicable to Mainly applicable to higher levels of lower levels of Levels Applicable To testing:Acceptance testing:Unit Testing Testing Integration Testing System Testing Generally, independent Generally, Software Responsibility Software Testers Developers Programming Not Required Required Knowledge
  • 8. Levels of Software Testing  Unit Testing  Integration Testing  System Testing  System Integration Testing
  • 9. What is Unit Testing ?  Validation & Verification Methodology  Belongs to the White Box testing category  Test individual units of Source Code  Unit – smallest testable part of application  Method, Function, Class  Tests created before or during development  Tests conducted during development
  • 10. Goals of Database Unit Testing  Ensure quality & accuracy of database deliverables  Establish a baseline state of your database  Verify Subsequent changes made to database objects  Identify regression issues throughout the application lifecycle
  • 11. Database Unit Testing Terminology • Isolated Environment (database) • Local development, testing & SandBox validation • Created by Script, VSTS Project or Restoring backup • Exercises a targeted code path TestCase • Multiple assertions
  • 12. Database Unit Testing Terminology • Simple Condition to indicate success or failure • Returns a True or False • Verifies Expected Assertion Interface • Verifies extraneous Results • Verifies data modification behavior
  • 13. Database Unit Testing Terminology • Collection of all test cases Unit for a given stored procedure • Tests interface, code & Test behavior • TSQL Scripts that executes a test case Test • May include assertions like; • Return values Script • Output parameters • Expected Errors
  • 14. Database Unit Testing Terminology • Logical & named grouping of related unit tests • Multiple test lists can be Test created • Can be run as a unit List • A test suite • Builds & Check in Policy • Deprecated in VSTS 2012
  • 15. Database Unit Testing Terminology • TSQL Scripts • Prepare database for unit Setup testing & • Returns database back to pre test state after testing Cleanu • Framework also provides p common Initialize & Cleanup Scripts Scripts • Pre Test and Post Test Scripts • Data Generation Plans
  • 16. Database Unit Testing Principles Isolation • Outcome of one test must not affect the outcome of any other test(s) • Each test must return the database back to its previous state after execution Independence • One test case must not depend on any other test case • Each test case must be run independently of any other test case • Test case assertion must be independent of the order of it’s execution
  • 17. Database Unit Testing Principles Characteristics of Ideal Unit Test • Exercise all possible code paths • Evaluate all possible conditions • Validate correct behavior for each path/condition Considerable efforts for exhaustive testing • Non Trivial stored procedures • Number of input parameters • Permutations of optional parameters • Error code paths
  • 18. Testable Interfaces of a Stored Procedure Input & • Name Output • Data Type (Length) Parameters • Optionality Return Code • Success/failure Row Count • SET NOCOUNT ON/OFF
  • 19. Testable Interfaces of a Stored Procedure • One or more SELECT statements • Number of Columns Result Set • Column Ordinal position • Column Name & Data Type Informational • PRINT Messages Messages • RaiseError – Severity 10 & below Error • RaiseError – Severity 10 & above Messages
  • 20. Unit Test Conditions Predefined Test conditions in VSTS 2010  Data Checksum  Empty ResultSet/Non Empty Result Set  Execution Time  Expected Schema  Row Count  Scalar Value  Inconclusive
  • 21. Levels of Unit Testing Factors Affecting the choice of Appropriate Level of Unit testing Costs of Unit test development & maintenance Added Value of Quality Application Criticality & Frequency of use Project Deadlines
  • 22. Levels of Unit Testing • Smallest amount of testing • Ensures error free compiles • No code is exercised • Consists of single test case Minimal with SET FMTONLY ON • Executes with NULL inputs • Intrinsic Assertion – No Errors
  • 23. Levels of Unit Testing • Exercises commonly used code paths & conditions • One step above Minimal • Tests Empty/Non-Empty Margina Result sets l • Some assertion of typical behavior & expected interface • Not a thorough & complete test
  • 24. Levels of Unit Testing • Exercises all code paths & conditions • Test cases for all permutations of optional parameters Complet • Multiple Assertions to completely verify interface & behavior e • Could also verify column names of result set • It’s an exhaustive unit test to verify all but unexpected errors
  • 25. Levels of Unit Testing  Possible to develop and un-testable stored procedure ?  A search stored procedure with 8 optional parameters will need over 2000 test cases  Numerous found/not found conditions  Error validation  Possibly an indicator of flawed design  Consider refactoring to facilitate testability
  • 26. Demo  Prerequisite : Database Project Exists in VSTS  Create a Unit Test Project in VSTS  Configure SandBox  Create Tests  Run Tests
  • 27. New in VSTS 2012  Redesigned Unit Test Explorer  Support for 3rd party testing frameworks  Code Analysis improvements  Continuous test runner  Deprecated Features  Test lists  Generate Unit Test Wizards
  • 28. Conclusion  Software Testing - Basics  Unit Testing – Basics  Database Unit Testing – Detailed discussion on Principles, Goals & Levels  Demo – Implementation of Database Unit Testing with VSTS 2010 & SQL Server 2008 R2
  • 29. Resources  MSDN  http://msdn.microsoft.com/en- us/library/aa833283.aspx  http://msdn.microsoft.com/en- us/library/aa833423.aspx  Wikipedia  http://en.wikipedia.org/wiki/Software_testing  Image - http://i.swebee.com/content/error-404-
  • 30. THANK YOU ! Questions & Feedback

Editor's Notes

  • #4: http://msdn.microsoft.com/en-us/library/dd172118.aspxhttp://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14258
  • #5: http://msdn.microsoft.com/en-us/library/dd172118.aspxhttp://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14258
  • #7: Goals of Software Testing ;Assure the Quality of a Software DeliverableEnsure the software meets requirement specsEnsure the software meets user expectations as well as stakeholder expectationsEnsure that the behaviour of the system is predictable and deterministichttp://en.wikipedia.org/wiki/Software_testingImage - http://i.swebee.com/content/error-404-road.jpg
  • #8: White-box testing is when the tester has access to the internal data structures and algorithms including the code that implements these.Black-box testing treats the software as a "black box"—without any knowledge of internal implementation. The black-box tester has no "bonds" with the code, and a tester's perception is very simple: a code must have bugs. Using the principle, "Ask and you shall receive," black-box testers find bugs where programmers do not. On the other hand, black-box testing has been said to be "like a walk in a dark labyrinth without a flashlight," because the tester doesn't know how the software being tested was actually constructed. As a result, there are situations when (1) a tester writes many test cases to check something that could have been tested by only one test case, and/or (2) some parts of the back-end are not tested at all.Grey-box testinginvolves having knowledge of internal data structures and algorithms for purposes of designing tests, while executing those tests at the user, or black-box level. By knowing the underlying concepts of how the software works, the tester makes better-informed testing choices while testing the software from outside. Grey-box testing implements intelligent test scenarios, based on limited information. http://en.wikipedia.org/wiki/Software_testinghttp://softwaretestingfundamentals.com/differences-between-black-box-testing-and-white-box-testing/
  • #9: Unit testing - also known as component testing, refers to tests that verify the functionality of a specific section of code, usually at the function levelIntegration testing - Integration testing is any type of software testing that seeks to verify the interfaces between components against a software designSystem testing - tests a completely integrated system to verify that it meets its requirementsSystem integration testing -  verifies that a system is integrated to any external or third-party systems defined in the system requirements
  • #12: SandboxA database sandbox is a private environment used for local unit testing and development. The sandbox allows development and testing to be done in isolation from other development activity and ensures repeatable results. Database developers use sandboxes to perform unit testing and validate rollout script behavior. Application developers may use local database sandboxes to test application code without affecting, or being affected by, other development activity. A database sandbox may be created from script, by deploying a VSTSDE database project locally, or by restoring a database backup at a known state.Test CaseA test cast exercises a targeted code path. Success or failure is ascertained after test case execution by asserting that the expected outcome was realized. Multiple assertions are commonly needed to validate the desired outcome of a specific test case.
  • #13: AssertionAn assertion is a simple condition that returns "true" to indicate test success or "false" to indicate failure of a test case. A test case assertion verifies:expected interface output values (e.g. output parameter values, number of resultsets, number of rows, resultset values, etc.)no extraneous results (e.g. errors, extra resultsets, unexpected informational messages, etc.)data modification behavior (e.g. data correctly inserted/updated/deleted)
  • #14: Unit TestA unit test is the collection of all of the test cases that exercise a stored procedure interface and code along with the assertions need to verify correct behavior.Test ScriptA test script is a T-SQL script that executes a test case. A test script may also include assertions implemented in T-SQL, such as checking return code values, output parameter values or a TRY/CATCH to assert an expected RAISERROR of a user-defined error occurred.
  • #15: Multiple related unit tests may be grouped together in a test list within VSTSDE so all can be run as a unit and for logical organizational purposes (a.k.a. test suite). http://msdn.microsoft.com/en-us/library/ms182461.aspxhttp://msdn.microsoft.com/en-us/library/ms182463.aspx
  • #16: Setup and Cleanup ScriptsSetup and cleanup scripts (a.k.a. fixture and teardown scripts) are T-SQL scripts used to prepare the database for unit testing and return the database back to the initial state afterward. Setup scripts typically insert data needed by a test case while cleanup scripts remove testing artifacts after test case execution. The VSTSDE unit test framework provides common Test Initialize and Test Cleanup scripts that are run before/after each test case within a unit test. This allows the same scripts to be shared by all test cases within a unit test. VSTSDE also includes the ability to run Pre-Test and Post-Test scripts before/after an individual test case. Pre/Post scripts are especially appropriate for data tailored for a specific test case. VSTSDE Data Generation Plans provide an alternative to unit test setup scripts. However, data values must be customized so that test cases can be developed against known data values. Care must be used to ensure DGP changes do not adversely affect existing unit tests and that cleanup scripts restore modified data back to the original state after test case execution.
  • #28: Unit Test explorer replaces the old test view and test results windowUsing simple plugin adapters, third party test frameworks can plug into the test platform layer and get the full experience of running inside of Visual Studio