Solved

Test Driven Development (Unit Test)

Posted on 2009-04-09
13
580 Views
Last Modified: 2012-05-06
Looking for Test Driven Development TDD (Unit Test) experts in vb.net! I am having  issues developing web app in TDD. Please reply if you have experience in TDD and i will post my questions here.


Thanks
Kerau
0
Comment
Question by:Kerau
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 2
13 Comments
 
LVL 11

Expert Comment

by:b_levitt
ID: 24107571
I generally only unit test my business teir classes.  I use nunit or the built in unit testing in visual stuidio.  If you're looking to test your ui teir, you may need to consider asp.net MVC.

http://www.asp.net/mvc/
0
 

Author Comment

by:Kerau
ID: 24107752
Thanks b_levitt, I am using tdd (nunit) to the whole web app from UI to Datamappers. Whenever a modification or a feature change needs to be added i start by writing the test first and since the test will/should not pass the first time then i have make changes to make it pass. Then i can add views which is the UI of the app. Just to give you an overview of my web app ..its something like (look image). Please suggest
err.JPG
0
 
LVL 12

Assisted Solution

by:topdog770
topdog770 earned 100 total points
ID: 24108526
As b_levitt said above, I create tests for all of my business level code, and then have the UI elements call into the business code.
In your example, you should be able to create tests that validate results based on input.  If the results are correct then your UI should be correct.   NUnit isn't really configured, as far as I know, to handle UI testing.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Accepted Solution

by:
b_levitt earned 150 total points
ID: 24109339
It is true that testing the actual UI isn't very practical.  However with MVC the 'View' doesn't really do anything anyway.  And unlike traditional webforms (code behind) you can at least test the the model.

Your project appears to have the MVC pattern (although you didn't say that you were using the actual MVC ASP.Net framework so I'll assume what you have is custom).  If it is at least close to ASP.Net MVC, then start here:

http://blogs.msdn.com/webdevtools/archive/2008/03/06/asp-net-mvc-test-framework-integration-demo.aspx

On that page they have a demo on testing MVC with nunit.
0
 

Author Comment

by:Kerau
ID: 24112637
thanks topdog770 and b_levitt...wow you both are absolutely right. I am hopeful now...The project is in MVC and its custom designed...Please help with the issues i am facing and unable to address. ...I will come up with a question tomorrow morning if thats okay with you...

thanks
kerau
0
 

Author Closing Comment

by:Kerau
ID: 31568531
Thanks
0
 
LVL 12

Expert Comment

by:topdog770
ID: 24113109
I'll keep an eye out for it
 
0
 

Author Comment

by:Kerau
ID: 24115465
Please help me with this one. I will give you a brief background of my project..there are two different app which i have to work on to make a feature change..The first app (app A) has all the ui and design page, since it contains different applications where as the second app (App B, this is the app i have been assigned to) has most of the code behind and this is designed using test driven development methodology MVC Model. Every time i make changes to the app B and execute it; it will generate a dll which i would paste in the first app's external assembly to check that my changes are working in UI..


Now the first issue i am trying to deal is to add more columns to the UI of my displayed grid. I have a search page in App A, it has 5 different search types(One of them is person). Once the user chooses one of these search types(lets assume person). Based on the search calculation it will display six different columns on a gridview(more information about that person). Now i have to add more columns to the grid. The good part, For that what i know is: i have to make changes to App B to get those values in App B and ONROWDATABIND of App A i will have to bind those values to the gridview control. The bad part:
i don't really know where should i write the tests related to it.


I went to get a second opinon from my senior colleague and he told me that i have to calculate the values on the runtime. As those values are already there huh..since i have just graduated and put into such a situation where the tasks are overohelming and with this retrogression i just don't want to loose my job by displeasing my leads. Hence i need your help to figure this issue out. If interested please reply back and i can post you the code behind.

Thanks
Kerau
0
 
LVL 12

Expert Comment

by:topdog770
ID: 24117090
Id be happy to help, but you'll need to create a new question in keeping with experts-exchange policy
 
0
 
LVL 12

Expert Comment

by:topdog770
ID: 24117094
u can even add a new link to new question from here.. to make it easier to follow!
 
0
 

Author Comment

by:Kerau
ID: 24117164
Sure thing, let me create a new question for you then..will be back =]
0
 

Author Comment

by:Kerau
ID: 24117552
0
 

Author Comment

by:Kerau
ID: 24130302
another issue with test driven development, if interested please have a look at it. Waiting for your response ...

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_24317336.html
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question