views:

156

answers:

3

Hi
I am new in unit testing and need some book or tutorial. I have looked alot in google, but can't find anything. I saw this question, but there is no answer, that's why I am asking it too.
Is there anything from which I can start?
Thanks.

+6  A: 

The art of Unit testing

by Roy Osherove

I didn't understand the concept of unit testing until I read this great book!

It guides you step by step from simple tests to tests that are maintainable, readable and trustworthy. It covers advanced subjects like mocks, stubs and frameworks such as TypeMock and Rhine.

HTH

Stephane
Thanks for link, I will download that book.
Samvel Siradeghyan
+3  A: 

The NUnit website has a good easy tutorial in the documentation for each release. More of a quick start guide than an in-depth book on testing.

Heres a link: http://www.nunit.org/index.php?p=getStarted&r=2.5.7

rmx
+2  A: 

If you are new to unit testing, in addition to learning the tools, I would recommend learning a bit about how to write testable code. E.g. using dependency injection and abstraction as a test seam.

This video goes over the basics: http://www.youtube.com/watch?v=wEhu57pih5w. It is more at the conceptual level than being a tutorial, but nevertheless is well worth watching.

Alex Peck
can you expand on what you mean by a "test seam"?
Neil N
Sure, that was, perhaps, a completely non-descriptive statement. I think of seams as being related to depending on abstractions rather than concretions. If your class depends on an abstraction, it is easy to substitute collaborator classes with mocks. Abstractions therefore act as the seams between the testable units of your program. Typically, you test at these seams by verifying state and/or behaviour.
Alex Peck
@Alex: Nice video!
Nam Gi VU