|
|
 |
BOOK: Beginning ASP.NET MVC 1.0 ISBN: 978-0-470-43399-7
 | This is the forum to discuss the Wrox book Beginning ASP.NET MVC 1.0 by Simone Chiaretta, Keyvan Nayyeri; ISBN: 9780470433997 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET MVC 1.0 ISBN: 978-0-470-43399-7 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

September 29th, 2009, 10:02 PM
|
|
Registered User
|
|
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Unit Testing Question
I have a question about unit testing. In general, should you try several values? I ask because in your example, you used addition for the Multiply() function to show a failing result.
But, what if you used Multiply(2, 2) and Assert.AreEqual(4, result)? The test would pass even if the code is wrong. I realize that in this simple example, it is easy to figure out that you shouldn't use 2 and 2, but in a more complex situation, I imagine it won't always be so obvious.
So, is it common testing practice to use more than one example test?
|

September 30th, 2009, 11:01 PM
|
|
Wrox Author
|
|
Join Date: Nov 2005
Location: Tehran, Iran
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
adimauro
Please note that Simone (the author of unit testing chapter) is on travel and it may take him a few days to respond.
|

October 6th, 2009, 06:23 AM
|
|
Registered User
|
|
Join Date: Apr 2009
Location: Milano, Italy
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Antonio,
in general you should test a general case when you are doing the first tests (or when you are designing the application via TDD.
And then you usually need to test the boundaries cases or the the special cases.
Simo
|

October 7th, 2009, 01:05 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 278
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
It does bring up an important point. The purpose of TDD is to require you to do proper program development. Good requirements research, good architecture planning, etc. If you plan out your tests and find your boundary cases well, your tests will demonstrate when the code that you're writing is doing a great job or not. If you quickly dash off some haphazard tests however, you can get into all kinds of trouble. So TDD can't save you from bad programming, it just makes it more obvious when you do.
__________________
-------------------------
Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe
When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper
Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Unit Testing |
jasonchrin |
BOOK: Professional Software Testing with Visual Studio 2005 Team System ISBN: 978-0-470-14978-2 |
2 |
July 7th, 2008 10:58 AM |
| Requirement base unit testing |
elliscnck |
Assembly Language |
0 |
February 14th, 2008 10:32 AM |
| Unit Testing |
jeffmorris |
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 |
7 |
May 14th, 2007 07:51 AM |
| Unit Testing |
userrob |
BOOK: ASP.NET Website Programming Problem-Design-Solution |
2 |
November 9th, 2005 10:35 AM |
| Unit Testing XSLT |
N.Todd |
XSLT |
2 |
March 1st, 2005 08:31 PM |
|
 |