Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Test Driven Development (Unit Test)

Posted on 2009-04-09
13
Medium Priority
?
581 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 400 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Accepted Solution

by:
b_levitt earned 600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

718 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