DEV Community

Discussion on: The Short Term Benefits of Unit Tests

Collapse
 
jamesrichmond24 profile image
James Richmond

I'm on your side - I'm also a big fan of unit testing.
I write unit tests whenever I can, but sometimes there is just not enough time..
About this part: "There’s also the benefit that a new developer in that code base will either not know how to properly test it or will use up a lot of another developer’s time in a knowledge transfer."
Don't you think it's a drawback? if a new developer needs to write unit tests and he doesn't know how to properly write them, he will waist both his and other developer's time..

Thread Thread
 
pbeekums profile image
Beekey Cheung

Ah, sorry. I wasn't clear there. My point was that if unit tests already exist, it helps a new developer a lot by serving as documentation on the test cases they need to think about.

Thread Thread
 
jamesrichmond24 profile image
James Richmond

No doubt about that!
What are the unit testing frameworks that you're familiar with?

Thread Thread
 
pbeekums profile image
Beekey Cheung

I'm a big fan of stock testing frameworks. Go and Python have decent ones.

I've worked with others, but one thing I really appreciate is simplicity. Granted, Go's testing framework is so bare bones it doesn't come with assertion functions, but that doesn't bother me that much.

I think complexity in set up or in trying to create the first test creates a lot of resistance to newcomers from building unit tests. Go and Python get you started in minutes. Frameworks tend to take a few hours at a minimum. They also have more random "gotchas" that result in lots of time on stack overflow.

Thread Thread
 
jamesrichmond24 profile image
James Richmond

I work with Typemock Isolator for C# - it's a very simple and user friendly tool, that allows you to perform unit testing by mocking almost anything you need.
It didn't take me a lot of time at all to understated how to work with it.
Have you heard about it?