473,722 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unit testing tools for .NET ?

Hi!

I'm looking for unit-testing tools for .NET.
Somthing like Java has --> http://www.junit.org
regards,
gicio
Nov 15 '05 #1
14 2748
HI Gicio,

Please take alook at NUnit -
http://www.nunit.org/

Regards,
Aravind C
<gi***@web.de > wrote in message news:bo******** *****@news.hans enet.net...
Hi!

I'm looking for unit-testing tools for .NET.
Somthing like Java has --> http://www.junit.org
regards,
gicio

Nov 15 '05 #2
<gi***@web.de > wrote:
I'm looking for unit-testing tools for .NET.
Somthing like Java has --> http://www.junit.org


See http://nunit.sf.net - and please limit your cross-posting in
future.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
I may add the excellent NUnit Addin for integration with visual studio.net

http://weblogs.asp.net/NUnitAddin/

You can also look at mock objects, which are a different approach of unit
testing...

--
Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/
"Jon Skeet [C# MVP]" <sk***@pobox.co m> a écrit dans le message de news:
MP************* ***********@msn ews.microsoft.c om...
<gi***@web.de > wrote:
I'm looking for unit-testing tools for .NET.
Somthing like Java has --> http://www.junit.org


See http://nunit.sf.net - and please limit your cross-posting in
future.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #4
SBC
There's also csUnit (http://www.csunit.org/index.php).
There's also a weblog posting about unit testing tools:
http://weblogs.asp.net/sbchatterjee/posts/29566.aspx

SBC
"Sebastien Lambla" <se************ **@6sens.com> wrote in message
news:uW******** ******@TK2MSFTN GP12.phx.gbl...
I may add the excellent NUnit Addin for integration with visual studio.net

http://weblogs.asp.net/NUnitAddin/

You can also look at mock objects, which are a different approach of unit
testing...

--
Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/
"Jon Skeet [C# MVP]" <sk***@pobox.co m> a écrit dans le message de news:
MP************* ***********@msn ews.microsoft.c om...
<gi***@web.de > wrote:
I'm looking for unit-testing tools for .NET.
Somthing like Java has --> http://www.junit.org


See http://nunit.sf.net - and please limit your cross-posting in
future.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Nov 15 '05 #5
I would be interested in hearing some real-world success stories using Unit
testing. Our company employed it and I have to honestly say that it really
didn't help much. I would completely accept the fact that we did it
incorrect, or used it improperly since this was our first time using it, but
it just didn't save us from that many bugs.

Do people typically have the developers who write the code write the unit
tests? Do you people typically have their QA department write the tests?

The most practical use we found for unit testing was for "after-the-fact"
testing. In other words, we identified what area caused a bug, and then
wrote a unit test to make sure that it was fixed. That way we can regression
test easier in the future. But, I'm interested in other people's thoughts
and experiences on this topic. I hear a lot of people point towards NUnit,
but I never hear how it was used in the field.

We do web applications, so we used NunitASP as well, but used classic NUnit
for our libraries.

Thanks,
Ben
"SBC" <es****@attbi.c om> wrote in message
news:uF******** ******@TK2MSFTN GP09.phx.gbl...
There's also csUnit (http://www.csunit.org/index.php).
There's also a weblog posting about unit testing tools:
http://weblogs.asp.net/sbchatterjee/posts/29566.aspx

SBC
"Sebastien Lambla" <se************ **@6sens.com> wrote in message
news:uW******** ******@TK2MSFTN GP12.phx.gbl...
I may add the excellent NUnit Addin for integration with visual studio.net
http://weblogs.asp.net/NUnitAddin/

You can also look at mock objects, which are a different approach of unit testing...

--
Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/
"Jon Skeet [C# MVP]" <sk***@pobox.co m> a écrit dans le message de news:
MP************* ***********@msn ews.microsoft.c om...
<gi***@web.de > wrote:
> I'm looking for unit-testing tools for .NET.
> Somthing like Java has --> http://www.junit.org

See http://nunit.sf.net - and please limit your cross-posting in
future.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too



Nov 15 '05 #6
Ben,

I think that having the developers write the testing code is not a good
idea at all. Granted, they might actually have to ^write^ the code, but the
user cases should be created by QA or whomever helps decide what the
functionality should be and how the user will do it. It is a collaborative
process, because some people can think of things that others can not, but
generally, the people using the software (or the people who understand how
it is going to be used) should create the tests.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Ben Rush" <kw*****@yahoo. com> wrote in message
news:Ot******** ******@TK2MSFTN GP10.phx.gbl...
I would be interested in hearing some real-world success stories using Unit testing. Our company employed it and I have to honestly say that it really
didn't help much. I would completely accept the fact that we did it
incorrect, or used it improperly since this was our first time using it, but it just didn't save us from that many bugs.

Do people typically have the developers who write the code write the unit
tests? Do you people typically have their QA department write the tests?

The most practical use we found for unit testing was for "after-the-fact"
testing. In other words, we identified what area caused a bug, and then
wrote a unit test to make sure that it was fixed. That way we can regression test easier in the future. But, I'm interested in other people's thoughts
and experiences on this topic. I hear a lot of people point towards NUnit,
but I never hear how it was used in the field.

We do web applications, so we used NunitASP as well, but used classic NUnit for our libraries.

Thanks,
Ben
"SBC" <es****@attbi.c om> wrote in message
news:uF******** ******@TK2MSFTN GP09.phx.gbl...
There's also csUnit (http://www.csunit.org/index.php).
There's also a weblog posting about unit testing tools:
http://weblogs.asp.net/sbchatterjee/posts/29566.aspx

SBC
"Sebastien Lambla" <se************ **@6sens.com> wrote in message
news:uW******** ******@TK2MSFTN GP12.phx.gbl...
I may add the excellent NUnit Addin for integration with visual studio.net
http://weblogs.asp.net/NUnitAddin/

You can also look at mock objects, which are a different approach of unit testing...

--
Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/
"Jon Skeet [C# MVP]" <sk***@pobox.co m> a écrit dans le message de news: MP************* ***********@msn ews.microsoft.c om...
> <gi***@web.de > wrote:
> > I'm looking for unit-testing tools for .NET.
> > Somthing like Java has --> http://www.junit.org
>
> See http://nunit.sf.net - and please limit your cross-posting in
> future.
>
> --
> Jon Skeet - <sk***@pobox.co m>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Nov 15 '05 #7
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard .caspershouse.c om> wrote:
I think that having the developers write the testing code is not a good
idea at all. Granted, they might actually have to ^write^ the code, but the
user cases should be created by QA or whomever helps decide what the
functionality should be and how the user will do it. It is a collaborative
process, because some people can think of things that others can not, but
generally, the people using the software (or the people who understand how
it is going to be used) should create the tests.


Most unit tests I've written haven't had anything to do with the user
experience - that should usually be more covered by system tests (or at
least, it's considerably harder to unit test than business logic etc).

IMO, unit tests should (if possible) be written before the code that
they're testing is written. It shouldn't be about user input, it should
be about as wacky and wild input as possible to the methods, as well as
more normal input, of course.

I don't unit test as often as I probably should, I'm afraid to say, but
when I do it often has signficant results. Sometimes the unit test code
ends up being longer than the code it's testing, but it usually finds
problems which otherwise might not have been found.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #8
I like csunit a little better for c#.

--
William Stacey, MVP

"SBC" <es****@attbi.c om> wrote in message
news:uF******** ******@TK2MSFTN GP09.phx.gbl...
There's also csUnit (http://www.csunit.org/index.php).
There's also a weblog posting about unit testing tools:
http://weblogs.asp.net/sbchatterjee/posts/29566.aspx

SBC
"Sebastien Lambla" <se************ **@6sens.com> wrote in message
news:uW******** ******@TK2MSFTN GP12.phx.gbl...
I may add the excellent NUnit Addin for integration with visual studio.net
http://weblogs.asp.net/NUnitAddin/

You can also look at mock objects, which are a different approach of unit testing...

--
Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/
"Jon Skeet [C# MVP]" <sk***@pobox.co m> a écrit dans le message de news:
MP************* ***********@msn ews.microsoft.c om...
<gi***@web.de > wrote:
> I'm looking for unit-testing tools for .NET.
> Somthing like Java has --> http://www.junit.org

See http://nunit.sf.net - and please limit your cross-posting in
future.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too



Nov 15 '05 #9
I agree with Jon - the test should be written first, and absolutely must be
written by the same programmer as is writing the code. There seems to be
some confusion over what "unit tests" really are. As far as I've seen, unit
tests are small pieces of code written by a programmer to specifically
target pieces of required functionality, and ensure that the functionality
behaves properly. They're not usually high level tests, they are almost
always very small and specific.

Tests like someone saying "When I click this button, I want the form to save
and bring up the next one" is what I have heard called a User Acceptance
Test. A unit test would be more like code that calls a square root function
with 4 and makes sure it gets 2 back, then calls it with a few other
numbers, and calls it with -1 and makes sure it gets an exception, etc.

So with this definition of unit testing in mind, I think it's best that the
programmer who will be writing the business logic writes the test, and that
they do it first. They write the test to specify exactly what behaviour is
expected of the small piece of functionality they are about to write. Then
they write the functionality and use the test to tell if they have done it
properly. ANy time new functionality is needed or a bug is found, it should
be expressed as a test first, then implemented. This way, you end up with a
large collection of very small tests, such that when one fails, you get a
very strong indication of what has gone wrong, and hence you know where to
look.

User Acceptance Testing should definitely use tests written by people other
than the original programmer...

Niall

"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard .caspershouse.c om> wrote:
I think that having the developers write the testing code is not a good idea at all. Granted, they might actually have to ^write^ the code, but the user cases should be created by QA or whomever helps decide what the
functionality should be and how the user will do it. It is a collaborative process, because some people can think of things that others can not, but generally, the people using the software (or the people who understand how it is going to be used) should create the tests.


Most unit tests I've written haven't had anything to do with the user
experience - that should usually be more covered by system tests (or at
least, it's considerably harder to unit test than business logic etc).

IMO, unit tests should (if possible) be written before the code that
they're testing is written. It shouldn't be about user input, it should
be about as wacky and wild input as possible to the methods, as well as
more normal input, of course.

I don't unit test as often as I probably should, I'm afraid to say, but
when I do it often has signficant results. Sometimes the unit test code
ends up being longer than the code it's testing, but it usually finds
problems which otherwise might not have been found.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3684
by: Tom Verbeure | last post by:
Hello All, so I'm now convinced that unit testing is really the way to go and I want to add it to an existing project. The first thing that I find out, is that, well, it's hard work. Harder than writing the real functional code. My application manipulates graphs. I first write the skeleton in Python, then convert it to C++ for high performance (some graphs can have millions of nodes.)
7
329
by: | last post by:
Hi! I'm looking for unit-testing tools for .NET. Somthing like Java has --> http://www.junit.org regards, gicio
0
949
by: kferrara | last post by:
I am looking for a unit testing tool to use with VB.net and ASP.net. Nunit is good with VB.net however I haven't tried nUnitASP. Has anybody used any other unit testing tools? Any suggestions are greatly appreciated.
3
3693
by: | last post by:
I am working on a web/webservice application that has a service layer. Most service methods will perform an access-check before executing. This check uses the IPrincipal credentials available in HttpContext.Current. This works great. My issue is that I need to write unit tests for those service methods. These tests then run outside of IIS, thus there is no HttpContext.Current available - and the servicemethod will not execute. The two...
15
6951
by: Enrique | last post by:
Question I am posting this question again (3rd time) because some issues with my no spam alias. Here it is the question: I have not been able to run unit tests for a VSTO (2005) project. I have an Excel project and a unit test project in the same solution. I have not found the way to initialize the runtimecallback as required by the code generated
4
2163
by: Peter Rilling | last post by:
Does VS.NET 2005 Professional support integrated unit testing, or is that only with the team system?
72
5257
by: Jacob | last post by:
I have compiled a set og unit testing recommendations based on my own experience on the concept. Feedback and suggestions for improvements are appreciated: http://geosoft.no/development/unittesting.html Thanks.
7
1882
by: Diffident | last post by:
Hello All, Can anyone please suggest me a good unit testing tool. I have seen NUnit but not sure on how I can use it to test my methods which involve session variables, viewstate variables, textbox values. I understand that NUnit is more suitable for OO methods which take set of parameters and return an output parameter. How about tools for testing methods which use state variables and form values?
2
1857
by: mo.sparrow | last post by:
Typemock Isolator – A powerful mocking framework for .NET unit testing and Test Driven Development (in Visual Studio). http://www.typemock.com/learn_about_typemock_isolator.html NUnit - A unit testing framework development software that is open source written in C# (for Visual Studio). TestDriven.NET - .NET Unit Testing software development tool / developer tool (add-in) for Visual Studio .NET www.testdriven.net/
0
8863
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9238
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5995
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.