Click here to Skip to main content
15,888,236 members
Home / Discussions / C#
   

C#

 
GeneralRe: Stack Trace incorrect in release mode Pin
KaurGurpreet12-Apr-10 22:50
KaurGurpreet12-Apr-10 22:50 
GeneralRe: Stack Trace incorrect in release mode Pin
Martin Jarvis12-Apr-10 22:58
Martin Jarvis12-Apr-10 22:58 
GeneralRe: Stack Trace incorrect in release mode Pin
KaurGurpreet12-Apr-10 23:20
KaurGurpreet12-Apr-10 23:20 
GeneralRe: Stack Trace incorrect in release mode Pin
Martin Jarvis12-Apr-10 23:51
Martin Jarvis12-Apr-10 23:51 
AnswerRe: Stack Trace incorrect in release mode Pin
Paulo Zemek13-Apr-10 9:01
mvaPaulo Zemek13-Apr-10 9:01 
QuestionFile Convert Pin
mjawadkhatri12-Apr-10 20:19
mjawadkhatri12-Apr-10 20:19 
AnswerRe: File Convert Pin
Dave Kreskowiak13-Apr-10 2:07
mveDave Kreskowiak13-Apr-10 2:07 
QuestionIs not Test Driven Development an Oxymoron or just for Algorithms ? Pin
Nadia Monalisa12-Apr-10 19:59
Nadia Monalisa12-Apr-10 19:59 
Hi everyone,

Today I am highly unpleased about a matter and that is "Test Driven Development". I just want to share my idea with you and want to hear back from you if what I am thinking is right or wrong. Also would like to hear about your idea.

Last few days, I am highly studying about Test Driven Development and to me, it sounds like, there is a magical framework which will allow me to run automated Unit Tests on methods I write. OWE, that can be awesome. I can only just dream about it. But when I wanted to practice, I realized that, it is not applicable to any of the project I have developed so far. What a weired. The articles and books tells me lots of benefits about Test Driven Development, like, 'You will get confidence when you write code...etc...blah blah blah..' But I dont think it is now unknown to any developer. To my thinking, almost all developers develop some kind of test project to test the application he/she is developing. So, what is really irritating me is, I have following Projects:

1. WinForm Custom Control.
2. ASP.NET WebForm Custom Control.
3. ASP.NET Web Application.
4. Windows Form Application.
5. Some Class Libraries in C#.


Ok, Now, I started to apply TDD to WinForm Custom Control and ASP.NET Custom Control which is purely UI oriented. Now, I found that, TDD is not good for UI. It is really not possible to automate the test on my control for some weired activities done by my user. I need to manually do something using Mouse/Keyboard to generate a problem and then, write solution to that problem. Yeah, I read there are some very very complex frameworks for testing UI, but I believe those are all commercial advertisement, not a developer friendly framework.

Then, I tried to apply VS integrated Unit Test feature to test my ASP.NET Web Application, Alas, it is sooo rigid that, I can test only if the user clicked a button or not. I wanted to test to simulate Login, But I found I cannot provide password to the Login Control and then, I gave up. Also many many limitations are there, I cannot test what I really worry about.

Then, I tried on Windows Form Application, again, same problem. Windows Form is highly UI oriented. Some of the experts are telling me that, I should not test UI. Rather, I should separate the UI from Business logic and test only Business Logic. Well, I thought, ok, lets try to test the Business Logics, when I separated my UI from Business Logic, I did not find really much code there. Because, Business logics are somehow related to UI. Anyway, of course it is my OOP practice that my Business logic code which is not used outside of the scope, I create them as private methods. So, I found that, TDD cannot test Private Methods. Hell!! then, what I gonna test ? I searched the google and found some article where someone is telling that, 'Private methods are AntiPattern' HUH!!! ? Just because TDD cannot be used, so now I will have to forget about OOP principles of encapsulation and think that, private methods are AntiPattern !! Now, I will have to make all my methods public which gonna clash with names ...one with another... ? I really got irritated to read that. The writer in that article wrote that, " I can bet, most of your private methods can be written as public "!! I was really angry to read that Smile | :) . Yeah, well, if I just change all the methods from private to public then, yes, my application wont break, but then ? is that the way I can maintian my project ?

Finally I found it useful, only if I develop an algorithm like 'Search', 'Sort' etc which does not have anything to do with UI and Website, Session etc, then, yes, I can use TDD. I dont know, unless I create an enterprize application, I wont find any really big algorithm development project. So, I am asking your opinion. What do you think about it ?

Thanks for your time reading this post.

Regards.
AnswerRe: Is not Test Driven Development an Oxymoron or just for Algorithms ? Pin
Martin Jarvis12-Apr-10 21:04
Martin Jarvis12-Apr-10 21:04 
GeneralRe: Is not Test Driven Development an Oxymoron or just for Algorithms ? Pin
Nadia Monalisa12-Apr-10 21:12
Nadia Monalisa12-Apr-10 21:12 
AnswerRe: Is not Test Driven Development an Oxymoron or just for Algorithms ? PinPopular
Pete O'Hanlon13-Apr-10 1:37
mvePete O'Hanlon13-Apr-10 1:37 
GeneralRe: Is not Test Driven Development an Oxymoron or just for Algorithms ? Pin
Nadia Monalisa13-Apr-10 1:47
Nadia Monalisa13-Apr-10 1:47 
GeneralRe: Is not Test Driven Development an Oxymoron or just for Algorithms ? Pin
Pete O'Hanlon13-Apr-10 1:53
mvePete O'Hanlon13-Apr-10 1:53 
Questionhosting control in grid cell Pin
Member 59031012-Apr-10 19:31
Member 59031012-Apr-10 19:31 
AnswerRe: hosting control in grid cell Pin
Abhinav S12-Apr-10 19:50
Abhinav S12-Apr-10 19:50 
Questiondraw / rectangle / bounds Pin
xilefxilef12-Apr-10 12:32
xilefxilef12-Apr-10 12:32 
AnswerRe: draw / rectangle / bounds Pin
Luc Pattyn12-Apr-10 12:43
sitebuilderLuc Pattyn12-Apr-10 12:43 
GeneralRe: draw / rectangle / bounds Pin
AspDotNetDev12-Apr-10 13:48
protectorAspDotNetDev12-Apr-10 13:48 
AnswerRe: draw / rectangle / bounds Pin
DaveyM6912-Apr-10 14:51
professionalDaveyM6912-Apr-10 14:51 
Question3rd party pre-built user security for c# application Pin
jaydelg12-Apr-10 11:56
jaydelg12-Apr-10 11:56 
AnswerRe: 3rd party pre-built user security for c# application Pin
Eddy Vluggen12-Apr-10 13:18
professionalEddy Vluggen12-Apr-10 13:18 
GeneralRe: 3rd party pre-built user security for c# application Pin
jaydelg12-Apr-10 15:46
jaydelg12-Apr-10 15:46 
QuestionRemoving leading zeros from negative string Pin
mprice21412-Apr-10 10:00
mprice21412-Apr-10 10:00 
AnswerRe: Removing leading zeros from negative string Pin
Dave Kreskowiak12-Apr-10 10:01
mveDave Kreskowiak12-Apr-10 10:01 
GeneralRe: Removing leading zeros from negative string Pin
mprice21412-Apr-10 10:38
mprice21412-Apr-10 10:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.