Re: unit testing gone mad

2011-06-06 Thread Tristan Reeves
Yeah... I think the problem is that all the tests were done on the base class and none on the actual class. But there shouldn't have even been a base/sub class pair. There was only one class, and the author then proceeded to split it into 2 justifying the decision by saying that he needed one for

Re: unit testing gone mad

2011-06-05 Thread Les Hughes
Tristan Reeves wrote: Hi list, I'll describe the situation in as little detail as possible. There's some code in which a class BaseClass, and a class ClassForUse : BaseClass are defined. BaseClass is used in a unit test that calls its constructor with mocks. ClassForUse is used in production

Re: unit testing gone mad

2011-06-05 Thread djones147
-To: ozDotNet ozdotnet@ozdotnet.com Subject: unit testing gone mad Hi list, I'll describe the situation in as little detail as possible. There's some code in which a class BaseClass, and a class ClassForUse : BaseClass are defined. BaseClass is used in a unit test that calls its constructor with mocks

Re: unit testing gone mad

2011-06-05 Thread Mark Ryall
There's a lot of opinion and not much science with TDD. I'd be sceptical of someone who introduced themselves as a TDD ninja. It takes an enormous amount of practice to develop expertise (5,000 hours) so almost everyone is a beginner. Read Kent Beck and Uncle Bob on what they think is best to

Re: unit testing gone mad

2011-06-05 Thread Tristan Reeves
Many thanks to all respondents. There's something there for me to mull over. Regards, Tristan. On Sun, Jun 5, 2011 at 8:03 PM, Mark Ryall mark.ry...@gmail.com wrote: There's a lot of opinion and not much science with TDD. I'd be sceptical of someone who introduced themselves as a TDD ninja.

Re: unit testing gone mad

2011-06-05 Thread Heinrich Breedt
Just wondering, what is the name of the test? On Jun 5, 2011 5:06 PM, Tristan Reeves tree...@gmail.com wrote: Hi list, I'll describe the situation in as little detail as possible. There's some code in which a class BaseClass, and a class ClassForUse : BaseClass are defined. BaseClass is

Re: unit testing gone mad

2011-06-05 Thread mike smith
On Sun, Jun 5, 2011 at 5:06 PM, Tristan Reeves tree...@gmail.com wrote: Hi list, I'll describe the situation in as little detail as possible. There's some code in which a class BaseClass, and a class ClassForUse : BaseClass are defined. BaseClass is used in a unit test that calls its

Re: unit testing gone mad

2011-06-05 Thread Tristan Reeves
ClassForUseInheritsBaseClass On Mon, Jun 6, 2011 at 6:22 AM, Heinrich Breedt heinrichbre...@gmail.comwrote: Just wondering, what is the name of the test? On Jun 5, 2011 5:06 PM, Tristan Reeves tree...@gmail.com wrote: Hi list, I'll describe the situation in as little detail as possible.

Re: unit testing gone mad

2011-06-05 Thread Heinrich Breedt
As an exercise, try making the method name articulate what you are testing. Use underscore for space. Don't be afraid to use longish sentence On Jun 6, 2011 12:32 PM, Tristan Reeves tree...@gmail.com wrote: ClassForUseInheritsBaseClass On Mon, Jun 6, 2011 at 6:22 AM, Heinrich Breedt

Re: unit testing gone mad

2011-06-05 Thread Mark Hurd
I wouldn't be writing these tests just for themselves, but they do check if someone attempts to change the base class without knowing what is going on. Similarly for the member tests. If these were perhaps created automatically, that would be OK, just. -- Regards, Mark Hurd, B.Sc.(Ma.)(Hons.)

Re: unit testing gone mad

2011-06-05 Thread Stephen Price
I follow the suggested naming from The Art of Unit testing by Roy Osherove. MethodBeingTested_Inputs_ExpectedResult ie: Constructor_PassInDependencies_IsNotNull CreateInstance_PassValidJobId_CreatesInstance or whatever. I just make it up as I go along, but by following the three part template

Re: unit testing gone mad

2011-06-05 Thread Heinrich Breedt
The biggest benefit of proper test naming is that it forces you to think what you are testing. IMHO of course. Resharper allows you to have multiple naming styles. On Jun 6, 2011 1:35 PM, Stephen Price step...@littlevoices.com wrote: I follow the suggested naming from The Art of Unit testing by

Re: unit testing gone mad

2011-06-05 Thread Scott Baldwin
Hi Tristan, I would argue that this sort of testing is a natural part of TDD. It seems as though the author is testing HOW the class is implemented, not that the class implements the functionality that it was created to perform. At some point you have to trust your compiler, if you derive one

Re: unit testing gone mad

2011-06-05 Thread Scott Baldwin
I would argue that this sort of testing is a natural part of TDD By this I mean that I believe it is NOT a natural part of TDD... just realized this could be mis-interpreted. On Mon, Jun 6, 2011 at 3:46 PM, Scott Baldwin carpenoctur...@gmail.comwrote: Hi Tristan, I would argue that this sort of