UnitTesting Unit Test template code generation in Visual Studio

Source: Internet
Author: User

In the process of software development, the importance of unit testing directly affects the quality of software. Experience shows that a responsible unit test method will find a lot of bugs at some point in the software development process, and the cost of modifying them is low. In the late stages of software development, the discovery and modification of bugs becomes more difficult and consumes a lot of time and development costs. Whenever a change is made, complete regression testing is performed, and testing of software products early in the life cycle will ensure the best possible efficiency and quality. The system integration process is greatly simplified in the case of a tested unit. Developers can focus on the interaction between the units and the implementation of the global functionality, rather than being stuck in a unit full of bugs.

1. Unit Test Generator

Today we look at the unit test template generation under Visual Studio 2013. Download and install the unit Test Generator. This feature has been integrated in the VS2015. After installation, right-click in the IDE

Then pop up the dialog box, you can configure the type of build unittesting, Xunit,mstest,nunit, we see support for the mainstream framework.

Finally we get the generated code:

public class Datebaseauthtests
{
[Fact ()]
public void Checkauthusertest ()
{

}
}
2. Microsoft Code Digger

Another tool is the Microsoft Code digger from Rise, which can dynamically detect problems with local methods. Only portable Class Libraries is supported by default, but can be configured:

In the IDE, right-click Generate Inputs/outputs Table

As a result, there has been a dynamic detection of the problem with the method

All right, we'll be here first today. In general, unit tests inspire programmers to create decoupled and cohesive code bodies. Unit testing practices are beneficial to promoting healthy software development habits. Design patterns, unit tests, and refactoring often come together at work, and with them, developers can produce the perfect solution.
We hope to help you with your software development.

Evolution of real-time measurement system of enterprise application performance
A few examples of cloud computing reference architectures
Simplifying unit Testing with UNITYAUTOMOQ
Unit testing of the data access layer
5 unit tests easy to put error
Smart Mobile Guide Solution Brief
Evolution of human resource management system

If you want to know more software, System IT, enterprise information information, please follow my subscription number:


Petter Liu
Source: http://www.cnblogs.com/wintersun/
This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.
The article was also published in my Independent blog-petter Liu blog.

UnitTesting Unit Test template code generation in Visual Studio

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.