Solved

Test Driven Development (Unit Test)

Posted on 2009-04-09
13
573 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

18 Experts available now in Live!

Get 1:1 Help Now