Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 3rd, 2005, 11:21 AM
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unit Testing

I bought this book a few months ago and it's improved my desing ability 10x. Then I started reading up on unit testing. I decided I would look at unit testing as I coded a website. How can you go about unit testing business objects methods when all the business layer objects create a new data layer object within most methods. I've been racking my brains on how to change this around but then I thought does a solution like this warrent unit testing? Any commnets on this would be very very appreciated!
I'm using NUnit if that helps. I've read a little about Mock objects which seem to be close to what I require...but because the data objects are created within the methods and not passed in this seems like its not the correct solutuion.
Cheers for any help!

  #2 (permalink)  
Old November 5th, 2005, 12:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should first write unit tests for your DAL objects. Once done, you write unit tests for your business objects. Yes, the business objects will call DAL functions, but so what? You need to test the business objects as black boxes. You give it a known set of inputs and you expect a certain set of outputs.

If a business object fails a test, the actual problem might be in the DAL or DB, but the fact remains that the business object gave you a red light. Hopefully your DAL tests will tell you if the problem is at that layer. But regardless of where the bug is located, the user of the business object sees that he's not getting the expected result, so the unit test still has validity.

Unit tests can help you find bugs, but they don't take the place of traditional debugging techniques. If they did, many of us would be out of a job!
  #3 (permalink)  
Old November 9th, 2005, 10:35 AM
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

cheers englere. thanks for the advice.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Requirement base unit testing elliscnck Assembly Language 0 February 14th, 2008 10:32 AM
Unit Test josericardo_jr BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 August 9th, 2007 08:19 AM
Unit Testing jeffmorris BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 7 May 14th, 2007 06:51 AM
Unit Testing XSLT N.Todd XSLT 2 March 1st, 2005 08:31 PM



All times are GMT -4. The time now is 06:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.