Saturday, January 26, 2019

How specific do you get with your tests?

First off - this is not dotnet specific, but I am writing the tests in C#.

I'm adding tests to a product that was rushed to production. Not ideal, but its very modular and mockable so its not so bad. My question is, how far do you go when trying to get full coverage?

I'm currently testing a UserService, that handles registration and authentication of users. When I'm testing the register component, I started by writing a test for every failure that should happen. For example:

RegisterFailNoUsername()

RegisterFailUsernameInUse()

RegisterFailNoPassword()

RegisterFailBadPassword()

I don't think this is bad per se, but I also feel like I might be writing too much of what is essentially validation. At the same time, I could see these tests coming in handy. I'm curious what other people do?

How specific do you get with your tests? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team