Solved

Test Driven Development (Unit Test)

Posted on 2009-04-09
13
575 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 …
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!
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now