Personal Development for Smart People Forums

Personal Development for Smart PeopleTM Forums

 

Go Back   Personal Development for Smart People Forums > Personal Development > Technology & Technical Skills

Notices

Technology & Technical Skills Computer skills, hardware, software, internet topics, gadgets, programming

Reply
 
Thread Tools Display Modes
Old 06-02-2008, 12:41 PM   #1 (permalink)
Love in Action (Mod)
 
Join Date: May 2008
Location: Ohio
Posts: 2,527
pianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nice
Default Unit Testing

Hi,

Does anyone know of a good unit testing framework for C#? I'm trying to get more into the agile development mindset, even though I work by myself, and want to do unit testing.
pianoperformer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-02-2008, 01:45 PM   #2 (permalink)
Family Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 1,823
JimOfferman is on a distinguished road
Default

www.csunit.org (first result in Google, if you type in C# unit testing)

Note that unit testing is not the Holy Grail of software development and doesn't make you more agile per se.
JimOfferman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-02-2008, 02:17 PM   #3 (permalink)
Love in Action (Mod)
 
Join Date: May 2008
Location: Ohio
Posts: 2,527
pianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nice
Default

Yeah I know I could have searched, but wanted to know what people have used and liked.

Hmm, isn't unit testing usually one of the core ideas of agile development?

Thanks for the link.
pianoperformer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-03-2008, 07:15 PM   #4 (permalink)
Member
 
Join Date: May 2008
Posts: 36
SomebodySomewhere is on a distinguished road
Default

You could also use NUnit. If you have Visual Studio 2008 Professional then you could use the built in unit testing capability for .NET !
SomebodySomewhere is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-03-2008, 08:15 PM   #5 (permalink)
Senior Member
 
Join Date: Sep 2007
Posts: 962
Trezker is on a distinguished road
Default

NUnit is good.

Unit testing is not be the holy grail, nothing is. But it's a damn good tool that lets you be 100% sure of what parts of your code is working and exactly when it breaks.

Simply put, Unit testing is good for heart, soul and a good nights sleep.
Trezker is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-03-2008, 09:22 PM   #6 (permalink)
Love in Action (Mod)
 
Join Date: May 2008
Location: Ohio
Posts: 2,527
pianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nice
Default

Oh, Visual Studio 2008 has unit testing? And I was thinking I wasn't going to need to upgrade. *sees wallet emptying*

Oh yes, I remember nUnit. I used it a while back I think.

I already know that unit testing is useful. I used it a while back in C# but couldn't remember what I used, and I used it in PHP quite a bit.
pianoperformer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-04-2008, 06:06 AM   #7 (permalink)
Family Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 1,823
JimOfferman is on a distinguished road
Default

Unit testing is a tool for agile development, not the tool.

The problem with unit testing is that when all your tests succeed, you still don't really know if the program as whole functions as it should. Also, you can't really unit test a complex user interface or anything that has emergent behavior (such as the games I work on).

I prefer a "design by a contract" approach, where you define and check the pre- and post-conditions of any interface method, as well as the invariants.
JimOfferman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-04-2008, 11:52 AM   #8 (permalink)
Love in Action (Mod)
 
Join Date: May 2008
Location: Ohio
Posts: 2,527
pianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nice
Default

Jim,

If the individual parts work, then the entire thing should work together, if you have really come up with enough tests.

This is why you use functional testing for the entire program (including the user interface). Have you ever used Selenium? I've had limited experience with it but it looks very useful for exactly that.
pianoperformer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-04-2008, 01:14 PM   #9 (permalink)
Family Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 1,823
JimOfferman is on a distinguished road
Default

Quote:
Originally Posted by pianoperformer View Post
If the individual parts work, then the entire thing should work together, if you have really come up with enough tests.
Yes, in theory unit testing is great. But the problem is that the theory doesn't always work out in practice.

1. It may not be possible or practical to come up with enough tests.
2. Unit tests only work within the scope of a wholly controlled environment, which excludes all major OS-es.

Quote:
This is why you use functional testing for the entire program (including the user interface). Have you ever used Selenium? I've had limited experience with it but it looks very useful for exactly that.
Never heard of it. Quite frankly, I have little incentive to investigate testing methods, because we have a big QA department at work (the little programming I do at home doesn't warrant anything beyond the most basic 'does it work?' testing). We catch most of our bugs by doing peer reviews, btw.
JimOfferman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-04-2008, 03:25 PM   #10 (permalink)
Love in Action (Mod)
 
Join Date: May 2008
Location: Ohio
Posts: 2,527
pianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nice
Default

Jim,

If you use TDD (test-driven development), you write your tests before your code, and are really only supposed to write the code to fulfill exactly those tests. If there is something new it needs to do, you first write a test, then write code until it passes. Well that's how it goes in XP, anyway.

Not sure what you mean about the OS. Hopefully the development environment should be fairly similar to the production environment.
pianoperformer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-04-2008, 07:58 PM   #11 (permalink)
Family Member
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 1,823
JimOfferman is on a distinguished road
Default

I'm familiar with TDD and XP. Again, there are limits to what you can write tests for. I work in real-time graphics... you can't write units tests for a lot of the things I do on a daily basis. You can't write a test that tells you if the shadows look good.

By OS I meant the Operating System. You know, Windows and all

You can never have a system complex as your garden variety multi-tasking, multi-processor OS in the exact same state twice; that only works in theory. This makes it hard to fully unit test complex applications that are designed to run in such an environment.
JimOfferman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-04-2008, 08:35 PM   #12 (permalink)
Love in Action (Mod)
 
Join Date: May 2008
Location: Ohio
Posts: 2,527
pianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nice
Default

True. But I guess it depends on what the program does. I certainly wouldn't use it for graphics.

I mostly make web sites, so my experience with it is limited to that domain, which it works quite well for.
pianoperformer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-05-2008, 09:53 AM   #13 (permalink)
Senior Member
 
Join Date: Sep 2007
Posts: 962
Trezker is on a distinguished road
Default

I heard behaviour driven development is a better way to think of unit testing.

Beyond Test Driven Development: Behaviour Driven Development
Trezker is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-05-2008, 12:11 PM   #14 (permalink)
Love in Action (Mod)
 
Join Date: May 2008
Location: Ohio
Posts: 2,527
pianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nicepianoperformer is just really nice
Default

Weird, I've never heard of that. I'm not sure if I agree yet, but it sounds interesting. I just looked it up on wikipedia real quick. I'll listen to the video later.

The outside in sounds like a top-down approach, which I tend to agree with.

Anyway, thanks for the link.
pianoperformer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-14-2008, 10:38 PM   #15 (permalink)
Member
 
Join Date: Jun 2008
Location: Redmond, WA
Posts: 95
igmistro is on a distinguished road
Default

Quote:
Originally Posted by pianoperformer View Post
Oh, Visual Studio 2008 has unit testing? And I was thinking I wasn't going to need to upgrade. *sees wallet emptying*

Oh yes, I remember nUnit. I used it a while back I think.
I've been using VS2008 since last December. Built in unit tests are nice but you don't need to upgrade if that's all you want. Since you've used nUnit before I'd go back to that...
igmistro is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Women testing men ... Jamie Social & Relationships 104 06-24-2008 08:59 PM
LoA Testing with a Control Group Zukin Intention-Manifestation 9 10-23-2007 12:54 PM
Koestler Parapsychology Unit Markus74 Psychic & Paranormal 2 12-25-2006 09:10 PM
Testing IM via PayPal Radical Intention-Manifestation 12 12-04-2006 11:00 PM
The Most Profitable Adsense Ad Unit Henry Business & Financial 13 11-13-2006 11:26 PM


All times are GMT. The time now is 12:13 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2010 by Pavlina LLC