Northwest Arkansas.Net User Group Jay Smith Tyson Foods, Inc. Unit Testing nUnit, nUnitAsp, nUnitForms.

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

.NET Technology. Introduction Overview of.NET What.NET means for Developers, Users and Businesses Two.NET Research Projects:.NET Generics AsmL.
Acceptance Testing.
COM vs. CORBA.
Testing and Quality Assurance
Test-Driven Development José Almeida, Microsoft
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
Case Tools Trisha Cummings. Our Definition of CASE  CASE is the use of computer-based support in the software development process.  A CASE tool is a.
Server-Side vs. Client-Side Scripting Languages
1 Chapter 12 Working With Access 2000 on the Internet.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Data Structures and Programming.  John Edgar2.
UNIT-V The MVC architecture and Struts Framework.
Your Interactive Guide to the Digital World Discovering Computers 2012.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
2012 National BDPA Technology Conference Creating Rich Data Visualizations using the Google API Yolanda M. Davis Senior Software Engineer AdvancED August.
Introduction to VB.NET Tonga Institute of Higher Education.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
PHASE 4 SYSTEMS IMPLEMENTATION Application Development SYSTEMS ANALYSIS & DESIGN.
ABSTRACT Zirous Inc. is a growing company and they need a new way to track who their employees working on various different projects. To solve the issue.
1 Shawlands Academy Higher Computing Software Development Unit.
Catlyn Colson. Recap of Previously Completed Work Previously I had done the following: Built the Database, started basic layout of the webpage, connected.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Testing -- Part II. Testing The role of testing is to: w Locate errors that can then be fixed to produce a more reliable product w Design tests that systematically.
Placement Consultants Software Project team members: Jambukia Shweta(09it040) Komal Makadiya(09it055) Nilisha Jain(09it057)
Problem Statement: Users can get too busy at work or at home to check the current weather condition for sever weather. Many of the free weather software.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Software Construction Lecture 18 Software Testing.
Intermediate 2 Software Development Process. Software You should already know that any computer system is made up of hardware and software. The term hardware.
Module 2: Using Microsoft Visual Studio.NET. Overview Overview of Visual Studio.NET Creating an ASP.NET Web Application Project.
The Software Development Process
In the Labs… X-Bot 2003 by Overtech Technologies.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
NUnit 1.  What Is NUnit?  NUnit is a unit-testing framework for all.Net languages. Initially ported from JUnit, the current production release, version.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Cross Language Clone Analysis Team 2 November 10, 2010.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
CS451 Software Implementation and Integration Yugi Lee STB #555 (816) Note: This lecture was designed.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Test Driven Development Introduction Issued date: 8/29/2007 Author: Nguyen Phuc Hai.
Tools for Automated Testing Presented by: Žygimantas Mockus.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
START Application Spencer Johnson Jonathan Barella Cohner Marker.
Unit testing with NUnit Anne Lam & Chris James CMPS 4113 – Software Engineering April 15, 2015.
Powerpoint Templates Page 1 Powerpoint Templates Unit Testing Ari Seppi
1 Middle East Users Group 2008 Self-Service Engine & Process Rules Engine Presented by: Ryan Flemming Friday 11th at 9am - 9:45 am.
Development Environment
Unit Testing.
Test-driven development
Unit testing your metro style apps built using XAML
Introduction to Visual Basic 2008 Programming
Coupling and Cohesion 1.
Chapter 8 – Software Testing
The Client/Server Database Environment
VISUAL BASIC.
Web Development Using ASP .NET
CIS16 Application Development Programming with Visual Basic
CIS16 Application Development – Programming with Visual Basic
SYSTEMS ANALYSIS & DESIGN
CS 240 – Advanced Programming Concepts
Presentation transcript:

Northwest Arkansas.Net User Group Jay Smith Tyson Foods, Inc. Unit Testing nUnit, nUnitAsp, nUnitForms

2 Jay Smith Sr. Programmer Analyst for Tyson Foods, Inc. Developer since Visual Basic 3 Tyson’s Development Standards Committee Tyson’s Data Standards Committee Tyson’s Project Management Advisory Group Windows Server Engineer for Wal-Mart Stores, Inc. Over 15 Years Development Experience

3 Agenda What is Unit Testing? Advantages Disadvantages nUnit nUnitAsp nUnitForms Demo DotNetMock & nMock nCover TestDriven.NET Resources

4 What is Unit Testing? Unit Test From Wikipedia, the free encyclopedia. In computer programming, a unit test is a procedure used to verify that a particular module of source code is working properly. The idea about unit tests is to write test cases for all functions and methods so that whenever a change causes a regression, it can be quickly identified and fixed. Ideally, each test case is separate from the others; constructs such as mock objects can assist in separating unit tests. This type of testing is mostly done by the developers and not by end-users.

5 Advantages The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. Unit testing provides a strict, written contract that the piece of code must satisfy. As a result, it affords several benefits. Unit testing allows the programmer to re-factor code at a later date, and make sure the module still works correctly (i.e. regression testing). This provides the benefit of encouraging programmers to make changes to the code since it is easy for the programmer to check if the piece is still working properly.

6 Advantages Unit testing helps eliminate uncertainty in the pieces themselves and can be used in a bottom-up testing style approach. By testing the parts of a program first and then testing the sum of its parts, integration testing becomes much easier. Unit testing provides a sort of "living document". Clients and other developers looking to learn how to use the class can look at the unit tests to determine how to use the class to fit their needs and gain a basic understanding of the API.

7 Advantages Because some classes may have references to other classes, testing a class can frequently spill over into testing another class. A common example of this is classes that depend on a database: in order to test the class, the tester often writes code that interacts with the database. This is a mistake, because a unit test should never go outside of its own class boundary. As a result, the software developer abstracts an interface around the database connection, and then implements that interface with their own mock object. This results in loosely coupled code, minimizing dependencies in the system

8 Disadvantages Unit-testing will not catch every error in the program. By definition, it only tests the functionality of the units themselves. Therefore, it will not catch integration errors, performance problems and any other system-wide issues. In addition, it may not be easy to anticipate all special cases of input the program unit under study may receive in reality. Unit testing is only effective if it is used in conjunction with other software testing activities. It is unrealistic to test all possible input combinations for any non-trivial piece of software. A unit test can only show the presence of errors; it cannot show the absence of errors.

9 nUnit NUnit is a unit-testing framework for all.Net languages. Initially ported from JUnit, the current production release, version 2.2, is the fourth major release of this xUnit based unit testing tool for Microsoft.NET. It is written entirely in C# and has been completely redesigned to take advantage of many.NET language features, for example custom attributes and other reflection related capabilities. NUnit brings xUnit to all.NET languages.

10 nUnitAsp nUnitAsp is a class library for use within your NUnit tests. It providesNUnit with the ability to download, parse, and manipulate ASP.NET web pages. With nUnitAsp, your tests don't need to know how ASP.NET renders controls into HTML. Instead, you can rely on the nUnitAsp library to do this for you, keeping your test code simple and clean. For example, your tests don't need to know that a DataGrid control renders as an HTML table. You can rely on nUnitAsp to handle the details. This gives you the freedom to focus on functionality questions, like whether the DataGrid holds the expected values.

11 nUnitForms nUnitForms is an nUnit extension for unit and acceptance testing of Windows Forms applications nUnit test can open a window and interact with the controls. The test will automatically manipulate and verify the properties of the GUI. nUnitForms takes care of cleaning up the forms between test, detecting and handling modal dialog boxes, and verifying that your expectations for the test are fullfilled.

12 DEMO

13 DotNetMock & nMock DotNetMock is a dynamic mock-object library for.NET. Its purpose is to provide a clean API for rapidly creating mock implementations of custom objects and verifying that objects interact with them correctly from unit tests. NMock is a dynamic mock-object library for.NET. Its purpose is to provide a clean API for rapidly creating mock implementations of custom objects and verifying that objects interact with them correctly from unit tests.

14 nCover nCover provides statistics about your code, telling you how many times each line of code was executed during a particular run of the application. The most common use of code coverage analysis is to provide a measurement of how thoroughly your unit tests exercise your code. After running your unit tests under nCover, you can easily pinpoint sections of code that are poorly covered and write unit tests for those portions. Code coverage measurement is a vital part of a healthy build environment.

15 TestDriven.Net TestDriven.NET makes it easy to run unit tests with a single click, anywhere in your Visual Studio solutions. It supports all versions of Microsoft Visual Studio.NET meaning you don't have to worry about compatibility issues and fully integrates with all major unit testing frameworks including nUnit, MbUnit, & MS Team System.

16 Resources nUnit nUnitAsp nUnitFormshttp://nunitforms.sourceforge.net DotNetMock nMockhttp:// TestDriven.NEThttp:// nCoverhttp:// Open Source Testinghttp://opensourcetesting.org

17 Closing Jay Nwa.NET User Group