The Art of Unit Testing: With Examples in .Net

The Art of Unit Testing: With Examples in .Net
by Roy Osherove

The Art of Unit Testing: With Examples in .Net
List Price: $39.99
Our Price: $21.99
You Save: $18.00 (45%)
Availability: Usually ships in 1-2 business days
Buy Used: from $19.95 (click here)
Category: Book
See more book details and other editions


or

Book Summary Information

Author: Roy Osherove
Edition: Paperback
Audio: English (Unknown); English (Original Language); English (Published)
Published: 2009-07-05
ISBN: 1933988274
Number of pages: 320
Publisher: Manning Publications
Product features:
  • ISBN13: 9781933988276
  • Condition: New
  • Notes: BRAND NEW FROM PUBLISHER! 100% Satisfaction Guarantee. Tracking provided on most orders. Buy with Confidence! Millions of books sold!

Book Reviews of The Art of Unit Testing: With Examples in .Net

Book Review: The art of Unit Testing with Examples in .NET
Summary: 5 Stars

First time when I familiarized with unit testing was 5 or 6 years ago. It was start of my developing career. I remember that somebody told me about code coverage. At that time I didn't write any Unit tests. Guy, who was my team lead, told me "Do you see operator if with three conditions? You should check all of these conditions". So, after that I had written some code, I should go to interface and try to invoke all code which I wrote from user interface. Nice? At current time I know little more about tests and unit testing. I have not participated in projects, designed by Test Driven Development (TDD). Basics of my knowledge are a spying code of my colleagues, some articles and screencasts. I had decide that I should know much more, and became a real professional of unit testing, this is why I had start to read book The art of Unit Testing with Examples in .NET. More than, in my current job place looks like I'm just one who writing unit tests for my code. I should show good examples of my tests.

The book was written about half year ago. Most of samples was written with C#. I saw a lot of recommendation for reading this book.

Author of this book is Roy Osherove. He is famous blogger, also he is lecturing TDD master classes, sometimes he is working consultant for IT companies, if they want to implement TDD in their projects (he wrote not one time about this, bring successful and unsuccessful cases). He is working as a main architect in company Typemock. Typemock developing paid instruments for tests/unit testing and code analysis.

The book will be useful for developers of any platforms. Like I said before most of examples was written with C# (some of examples with Java). In book author use NUnit framework for unit tests, Rhino Mocks for Mock and Stub objects in Unit tests (before that I didn't know that Stub and Mock are different, I knew only about Mocks).
So, what you will find in the book? You can download a few chapters from official book's site, so before buy the book you can read first is it good for you or not. First chapter of book is "Hello world!". It is about what you need to write tests, what kind of frameworks, tools, and of course first test is there. Next chapter about frameworks which author use in his book: NUnit and Rhino Mocks. He used Rhino Mocks at book as I understand because he got statistic that Rhino Mocks is frequently used framework for creating Mocks and Stubs. I think that today situation little different, I like Moq. And NUnit today is still most used unit testing framework. One time I used MbUnit, because it has more features, but NUnit today has the same features.

It the book you will find information about how to write tests, how you should design them. And also you will find antipatterns: I found out all of them, I had used them in my code. :(

Also I found answer for my old question. I wrote some article about testing applications with NHibernate, and I got comment about why you are testing ORM? I thought that this man know more than me in unit testing, so really maybe I shouldn't test ORM Repositories. At that time I had really specific case, so I said that I need it, and said why I need these tests. I didn't know why this guy asked me this question. Really this is my integration test. With this test I check that database schema is equal to xml-mapping, mapping is equal to classes, and if I use special queries I check them too with my tests. It is really helpful. In the book I found answer for my question - tests for ORM is really helpful, author if this book always write tests for his Data Access Layer, and he said why.

Also in the book you will find how to introduce TDD in your company, how to work with Legacy code (this is really important when you introduce TDD in exist project, not new). Also a lot of questions and answers for guy, who want to introduce TDD in his group/company, he will get a lot of questions for his colleagues (money, time, knowledge, etc).

At the end of book author made an inventory of frameworks, which you can use for testing. Of course in his list you will find paid frameworks, which was written by Typemock, where author are working.

Really I recommend this book for all companies, which use TDD in their practice and which write unit tests, so for all companies. My recommendation for team leads and managers, don't say "You must write tests", read book first, or ask your colleagues to read the book, make a lectures, trainings, and you will see the result.

Summary of The Art of Unit Testing: With Examples in .Net

Unit testing, done right, can mean the difference between a failed project and a successful one, between a maintainable code base and a code base that no one dares touch, and between getting home at 2 AM or getting home in time for dinner, even before a release deadline.

The Art of Unit Testing builds on top of what's already been written about this important topic. 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 Isolator and Rhino Mocks. And you'll learn about advanced test patterns and organization, working with legacy code and even untestable code. The book discusses tools you need when testing databases and other technologies. It's written for .NET developers but others will also benefit from this book.

Table of Contents:

  1. The basics of unit testing
  2. A first unit test
  3. Using stubs to break dependencies
  4. Interaction testing using mock objects
  5. Isolation (mock object) frameworks
  6. Test hierarchies and organization
  7. The pillars of good tests
  8. Integrating unit testing into the organization
  9. Working with legacy code

Java Books

Book Subjects
Most talked about in Java Books
Who's Afraid of Java? ImageWho's Afraid of Java?
by Steve Heller
Academic Press; Published: 1997-07-30; Paperback; Book
Best price: $19.92
Price in other shops: $39.95
Decompiling Java (Java Masters) ImageDecompiling Java (Java Masters)
by Godfrey Nolan
McGraw-Hill Education; Published: 1998-11; Paperback; Book
A Comprehensive Introduction to Object-oriented Programming with Java ImageA Comprehensive Introduction to Object-oriented Programming with Java
by C. Thomas Wu
McGraw-Hill Higher Education; Published: 2007-03; Paperback; Book
Best price: $69.99
Android Application Development For Dummies ImageAndroid Application Development For Dummies
by Donn Felker
For Dummies; Published: 2010-12-07; Paperback; Book
Best price: $10.99
Price in other shops: $29.99
Java For Dummies ImageJava For Dummies
by Barry Burd
For Dummies; Published: 2011-08-11; Paperback; Book
Best price: $16.90
Price in other shops: $29.99
The Jini(TM) Specification (The Jini(TM) Technology Series) ImageThe Jini(TM) Specification (The Jini(TM) Technology Series)
by Ken Arnold, Robert W. Scheifler, Jim Waldo, Ann Wollrath, Robert Scheifler, Bryan O'Sullivan
Addison-Wesley Pub (Sd); Published: 1999-06; Paperback; Book
Best price: $7.36
Price in other shops: $39.95
Thinking in Java (2nd Edition) ImageThinking in Java (2nd Edition)
by Bruce Eckel
Pearson Education; Published: 2000-05-31; Paperback; Book
Best price: $3.32
Price in other shops: $44.99
Essential Jni: Java Native Interface (Essential Java) ImageEssential Jni: Java Native Interface (Essential Java)
by Robert Gordon, Rob Gordon
Prentice Hall PTR; Published: 1998-03; Paperback; Book
Best price: $32.00
Price in other shops: $34.95
Introduction to Java Programming, Comprehensive (8th Edition) ImageIntroduction to Java Programming, Comprehensive (8th Edition)
by Y. Daniel Liang
Prentice Hall; Published: 2010-01-13; Paperback; Book
Best price: $95.00
Price in other shops: $135.00
Instant Java Servlets (Book/CD-ROM package) ImageInstant Java Servlets (Book/ CD-ROM package)
by Phil Hanna
McGraw-Hill Companies; Published: 2000-05-22; Paperback; Book
Best price: $34.92
Price in other shops: $49.99
Similar Books and other products
CLR via C# ImageCLR via C#
by Jeffrey Richter
Microsoft Press; Published: 2010-02-11; Paperback; Book
Best price: $32.50
Price in other shops: $59.99
Programming Entity Framework: Building Data Centric Apps with the ADO.NET Entity Framework ImageProgramming Entity Framework: Building Data Centric Apps with the ADO.NET Entity Framework
by Julia Lerman
O'Reilly Media; Published: 2010-08-26; Paperback; Book
Best price: $32.50
Price in other shops: $59.99
Pro C# 2010 and the .NET 4 Platform ImagePro C# 2010 and the .NET 4 Platform
by Andrew Troelsen
Apress; Published: 2010-05-14; Paperback; Book
Best price: $70.36
Pro ASP.NET MVC 3 Framework ImagePro ASP.NET MVC 3 Framework
by Steven Sanderson, Adam Freeman
Apress; Published: 2011-06-27; Paperback; Book
Best price: $33.47
Price in other shops: $54.99
Working Effectively with Legacy Code ImageWorking Effectively with Legacy Code
by Michael Feathers
Prentice Hall; Published: 2004-10-02; Paperback; Book
Best price: $38.33
Price in other shops: $59.99
C# in Depth, Second Edition ImageC# in Depth, Second Edition
by Jon Skeet
Manning Publications; Published: 2010-11-22; Paperback; Book
Best price: $27.99
Price in other shops: $49.99
Refactoring: Improving the Design of Existing Code ImageRefactoring: Improving the Design of Existing Code
by Martin Fowler, Kent Beck, John Brant, William Opdyke, Don Roberts
Addison-Wesley Professional; Published: 1999-07-08; Hardcover; Book
Best price: $25.00
Price in other shops: $64.99
Test Driven Development: By Example ImageTest Driven Development: By Example
by Kent Beck
Addison-Wesley Professional; Published: 2002-11-18; Paperback; Book
Best price: $28.02
Price in other shops: $49.99
Clean Code: A Handbook of Agile Software Craftsmanship ImageClean Code: A Handbook of Agile Software Craftsmanship
by Robert C. Martin
Prentice Hall; Published: 2008-08-11; Paperback; Book
Best price: $32.89
Price in other shops: $49.99
Dependency Injection in .NET ImageDependency Injection in .NET
by Mark Seemann
Manning Publications; Published: 2011-09-28; Paperback; Book
Best price: $28.80
Price in other shops: $49.99