Visual Studio 2010: Test Driven Development

Páginas: 22 (5347 palabras) Publicado: 4 de enero de 2013
Visual Studio 2010: Test Driven Development
Version: 1.1.0
Description
Visual Studio 2010 brings with it several enhancements to help cut development friction and enable the developer to focus on the task at hand: writing high-quality code. In the following exercises we'll highlight several of the new features that the TDD developer can use to enhance his/her development cadence. Visual Studiohelps your cadence by cutting the number of keystrokes to accomplish frequently performed tasks, speeds navigation through your solution, and enables you to use test frameworks other than MSTest.
Overview
Test Driven Development (TDD), also frequently referred to as Test Driven Design, is a development methodology where developers create software by first writing a unit test, then writing theactual system code to make the unit test pass. The unit test can be viewed as a small specification around how the system should behave; writing it first helps the developer to focus on only writing enough code to make the test pass, thereby helping ensure a tight, lightweight system which is specifically focused meeting on the documented requirements.
TDD follows a cadence of “Red, Green,Refactor.” Red refers to the visual display of a failing test – the test you write first will not pass because you have not yet written any code for it. Green refers to the step of writing just enough code in your system to make your unit test pass – your test runner’s UI will now show that test passing with a green icon. Refactor refers to the step of refactoring your code so it is tighter, cleaner, andmore flexible. This cycle is repeated constantly throughout a TDD developer’s workday.
Note:
This lab is not meant to teach you how to work with TDD; instead, it is intended to highlight Visual Studio 2010’s support for working in TDD. If you are interested in learning more about the TDD methodology and its benefits then you should look to the following books as a starting point:
Test DrivenDevelopment in Microsoft .NET by James Newkirk and Alexei Voronstov, ISBN 0735619484
Pragmatic Unit Testing in C# with NUnit, 2nd Edition by Andy Hunt, Dave Thomas, and Matt Hargett, ISBN 0977616673
A critical aspect of TDD is developer cadence. Getting into a productive development rhythm (the elusive “zone”) involves having the right mindset, but also working with tools that assist thedeveloper in working rapidly and with as little friction as possible.
Visual Studio 2010 brings with it several enhancements to help cut development friction and enable the developer to focus on the task: writing high-quality code. In the following exercises, you will learn several of the new features that the TDD developer can use to enhance his/her development cadence. VS10 helps your cadence bycutting the number of keystrokes to accomplish frequently performed tasks, speeds navigation through your solution, and enables you to use test frameworks other than MSTest.
To demonstrate the new features you will build an implementation of a stack in a test-first manner, showing how tests drive the design and implementation of a SimpleStack class.
Note:
In computer science, a stack is an abstractdata type and data structure based on the principle of Last In First Out (LIFO).
If you are unfamiliar with the concept of a stack as a data structure, or just need a quick refresher, please see the full Wikipedia article for a more thorough definition.
Objectives
In this Hands-On Lab, you will learn how to:
• Use the new Smart Tag actions to save keystrokes by letting the IDE generatesmall bits of code for you.
• Use Quick Search to move around in the code base with just a few keystrokes.
System Requirements
You must have the following items to complete this lab:
• Microsoft Visual Studio 2010
• .NET Framework 4.0
Setup
All the requisites for this lab are verified using the Configuration Wizard. To make sure that everything is correctly configured, follow...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Visual Studio 2010
  • Visual Studio Test Professional
  • 60 Propiedades De Visual Studio 2010
  • Creando instaladores en visual studio 2010
  • Programas Hechos En Visual Studio 2010
  • Componente Prinform Visual Studio 2010
  • Manual De Instalación De “Microsoft Visual Studio 2010”
  • Manual para aprender a usar visual studio 2010

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS