Unit Testing and Tools

50 %
50 %
Information about Unit Testing and Tools

Published on February 28, 2014

Author: wbsimms

Source: slideshare.net


This talk was give at the South Shore .NET Users Group.

Unit Testing is now considered a required skill for developers. There are a ton of tools out there. However, there's nothing that shows you how to tie them all together to make your software fast, testable, and flexible. This talk will go over my toolset:

• MSTest
• Moq - Mocking framework
• NCover - for coverage
• MSBuild - for automation
• Dotcover - coverage from VS
• Unity - for dependency injection

This talk has a very long demo

Unit Testing and Tools @wbsimms @southshorenet

Vocabulary Unit test • Code you write to test your code Coverage • Measure of how much code is tested Mock • Replacement for something else Dependency Injection (DI) • • Builder design pattern Object and dependencies are created for you Continuous Integration (CI) • Responds to checkins, builds code, and generates code metrics (coverage, unit test pass fail, etc.)

Why Unit Test? Which would you rather do? Write Tests Fix Production Bugs

That’s cute… but really… why? 1) Catches regression bugs at the developers desk 2) Documents how code works 3) Catalog of the business rules

What makes a good unit test? • • • • Repeatable Fast Test by layers Good Coverage

Layers? Web • Controllers • ViewModels • Helpers DataAccessLayer • Repositories (or what ever) • Models • Helpers Other Libraries • Rules Logic • Etc…

Test documentation? 1. public void MethodName_Case_ExpectedResultTest() 2. [Description(“Your text here”)] public void MethodNameCaseTest()

When to run your test? All tests all the time!      After pull / sync Before commits During CI builds Before you merge After you merge

So… the tools? • MSTest • Unit testing framework • Moq • Creating mock objects from interfaces • Unity • Dependency Injection • MSBuild • Build automation • DotCover/Ncover • For coverage analysis

Demo time… Deep breath….

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Unit Testing Tools - Java, Javascript, .NET, PHP, Python ...

Unit Testing and Mocking Tools: C/C++, Java, Javascript, .NET, PHP, Python, Ruby, Flex
Read more

PHPUnit – The PHP Testing Framework

PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks.
Read more

NUnit - Home

What Is NUnit? NUnit is a unit-testing framework for all .Net languages. Initially ported from JUnit, the current production release, version 3.0, has ...
Read more

Unit Testing - hitex.com

Hitex bietet einen Unit-Testing-Service für Quellcode von C/C++ Anwendungen unter Einsatz des bewährten Test-Tools von TESSY.
Read more

Unit testing - Wikipedia

Testing tools like QuickCheck exist to generate test inputs for PUTs. ... The objective in unit testing is to isolate a unit and validate its correctness.
Read more

Unit Test Your Code - msdn.microsoft.com

The unit test tools include: Test Explorer. Test Explorer lets you run unit tests and view their results. ... Unit testing managed code:
Read more

QUnit: A JavaScript Unit Testing framework.

A unit testing framework is presented with general introduction into Unit Testing, API documetation, downloads, guide and plugin links.
Read more

Automated Unit Testing Framework | C & C++ | Cantata - QA ...

Certified Unit & Integration Test Tool - Embedded Safety Standards Compliance. Easy To Use Eclipse GUI Integrated With Requirements & Development Tools.
Read more

Software testing - Wikipedia

Software testing is an investigation ... This method of test can be applied to all levels of software testing: unit, ... Software testing tools and ...
Read more

Software Testing Tools - uTest

Tools; Projects; Events; Sign In / Sign Up; Welcome to the uTest Community! A confirmation email has been sent to . Please click the link in the email when ...
Read more