Unit Tests


M

mick

I've never done these. I've looked into them on a few occasions but it always
seemed such a fart on and I never really got past the thought that if you can
write crappy code then you can just as well write crappy tests, defeating the
whole point of having them in the first place.

Anyhow I've decided to at least learn about them properly and in doing so a
might start to see their value. So what I was wondering is if anyone knows of a
good video series that will take me from the absolute basics to a decent level.

TIA,

mick
 
Ad

Advertisements

A

Anders Eriksson

I've never done these. I've looked into them on a few occasions but it
always seemed such a fart on and I never really got past the thought
that if you can write crappy code then you can just as well write crappy
tests, defeating the whole point of having them in the first place.

Anyhow I've decided to at least learn about them properly and in doing
so a might start to see their value. So what I was wondering is if
anyone knows of a good video series that will take me from the absolute
basics to a decent level.

I have not tested it yet (pun intended ;-) but Julie Lerman have a
number of good videos on EF, so I guessing that this also is good!

Automated Testing for Fraidy Cats Like Me

http://pluralsight.com/training/Courses/TableOfContents/automated-testing-fraidy-cats

// Anders
 
Ad

Advertisements

A

Arne Vajhøj

I've never done these. I've looked into them on a few occasions but it
always seemed such a fart on and I never really got past the thought
that if you can write crappy code then you can just as well write crappy
tests, defeating the whole point of having them in the first place.

Anyhow I've decided to at least learn about them properly and in doing
so a might start to see their value. So what I was wondering is if
anyone knows of a good video series that will take me from the absolute
basics to a decent level.

A few random comments:
* you should write the unit tests before the code to be unit tested
that way knowledge about what the implementation does not cause
you to write unit tests that will always pass
* it is possible to create bugs in both unit test and implementation,
but the chance of those cancelling each other is very small
* you should obviously write unit tests when writing new code
* you should also write a unit test every time you fix a bug: start
by creating a unit test that is impacted by the bug an fails, fix the
bug and see the test pass - not only do you test your fix, but you
also prevent the bug from being reintroduced (yes - that happens
frequently)
* you will get some benefits by unit tests in initial development - a
lot of simple bugs will be found before the code goes into QA and that
saves resources
* you will get huge benefits from unit tests later when the code goes
into maintenance - a developer that has to change something can use
an extensive unit test suite to check if his changes are breaking
some existing functionality (and that is a major risk when modifying
existing code)
* use a well respected unit test framework - I happen to like NUnit,
but there are others available

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top