Hot Best Seller

The Art of Unit Testing: With Examples in .NET PDF, ePub eBook

4.6 out of 5
30 review

The Art of Unit Testing: With Examples in .NET

Availability: Ready to download

File Name: The Art of Unit Testing: With Examples in .NET .pdf

How it works:

1. Register a free 1 month Trial Account.

2. Download as many books as you like (Personal use)

3. Cancel the membership at any time if not satisfied.


The Art of Unit Testing: With Examples in .NET PDF, ePub eBook 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 guid 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. Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book. Table of Contents The basics of unit testing A first unit test Using stubs to break dependencies Interaction testing using mock objects Isolation (mock object) frameworks Test hierarchies and organization The pillars of good tests Integrating unit testing into the organization Working with legacy code

30 review for The Art of Unit Testing: With Examples in .NET

  1. 4 out of 5

    Roy

    I am the author, so.. I think I like it! but the 2nd edition fixes things in the first edition that today I disagree with.

  2. 4 out of 5

    Recep Karabıçak

    A well written introductory book on the topic of unit testing. It covers a lot of ground, there is even a chapter on how to introduce unit testing to an organization. But be wary. The book is a highly opiniated one. The author has strong opinions and does not shy away from presenting them. Of course that is not a bad thing but something to keep in mind.

  3. 4 out of 5

    Vasil Todorov

    A must-read for every .NET developer. Anyway, Java and C# are similar, so it might be useful for Java devs too. The book shows many ways of writing a highly-testable code. Writing good test cases, what needs to be tested, and what not. How to structure our testing project/classes.

  4. 4 out of 5

    Lisandro

    The chapter about answering hard questions is invaluable I you trying to bring unit test to be used! Wish I had read this book back in the day!

  5. 5 out of 5

    Robert

    As with many other things, sometimes it is hard to know where to start to explore a new topic of interest, and TDD and unit testing itself was no exception from this. Fortunately for us, the above situation is no longer the case for the aforementioned subjects, as R. Osherove presents us with an excellent starting point with his book (I read the 2nd edition). Before going into (some) specifics though, it is important to note that this book is not about TDD (although it touches the subject), but As with many other things, sometimes it is hard to know where to start to explore a new topic of interest, and TDD and unit testing itself was no exception from this. Fortunately for us, the above situation is no longer the case for the aforementioned subjects, as R. Osherove presents us with an excellent starting point with his book (I read the 2nd edition). Before going into (some) specifics though, it is important to note that this book is not about TDD (although it touches the subject), but rather about the technicalities of unit testing. And excellent technicalities it gives. At first glance, the title might be a bit intimidating: "The Art of Unit Testing". To some, it might translate as "The Finer Aspects of Unit Testing", inferring, that you have to be a pro to gain any benefit from it. But, thanks to the author's good presentation skills, this can't be farther away from the truth, as people with any or no skills will equally benefit from it. As a matter of fact, it ensures this by starting from the very basic topics, like explaining what units, tests and unit tests are and what they are not, what makes them useful, what unit testing frameworks can be used and why they should be used, etc. The book then dives into more serious stuff like making a very clean distinction between stubs and mocks, giving useful advice and examples when and how these should be used, showing how to refactor code for testability, when and how to use isolation frameworks, what types isolation frameworks have and what advantages/disadvantages they have, how to write and organize unit tests for reliability, readability and maintainability and more. The book finally touches finer aspects, like how to integrate unit testing into organization, what will make you fail or succeed in this quest, and how to be an effective constructive person in general. It also gives a good intro about how to work with legacy code from a unit testing perspective, and what considerations one has to make when deciding for or against testing parts of a legacy code base. All in all, I'm very satisfied with this book, as it steadily builds a fair understanding of this very important programming topic from the ground, and does so by presenting plentiful (C#) code examples. Also, the code presented in the book is easily comprehensible even by those, who do not have any prior knowledge of the particular programming language (including me), as no language über-specific features are used. I must also emphasize the fact, that the author quite frequently gives very useful "further reading" recommendations throughout the book, which I personally think to be a very nice touch. So, do I have some complaints? I honestly cannot think of one. I really enjoyed it from beginning to end, so the only thing left to say is that I highly recommend this to anyone interested in unit testing.

  6. 4 out of 5

    Sonny Recio

    I would like to give this one a perfect score since it explains a lot of stuff about Unit Testing and how can beginners start cleaner, maintainable code. In the beginning, I find it hard and challenging to write Unit Tests myself, especially when making TDD due to the fact that I'm not used to the "Test-fail first" approach of coding. But as I go along the book and trying some samples(MULTIPLE TIMES), I was able to grasp the concepts the book was talking about. It took me a lot of time to underst I would like to give this one a perfect score since it explains a lot of stuff about Unit Testing and how can beginners start cleaner, maintainable code. In the beginning, I find it hard and challenging to write Unit Tests myself, especially when making TDD due to the fact that I'm not used to the "Test-fail first" approach of coding. But as I go along the book and trying some samples(MULTIPLE TIMES), I was able to grasp the concepts the book was talking about. It took me a lot of time to understand it. This book teaches you to write test first, and how to make maintainable tests. Furthermore, I believe this book also entails making your code cleaner through TOOD(Testable Object-Oriented Design) approach. In the end, what the book stated totally makes sense. I highly prefer this to beginners to expert programmers alike.

  7. 5 out of 5

    Mohammed Kamil

    The writer goes on sharing his distilled knowledge on unit testing and various patterns on making a maintainable automated unit tests, and by giving a clear recommendation on unit testing framework ,the author relief the novice unit tester approacher from the hustle of evaluating different unit test frameworks and giving the reader a solid introductory dose enabling him to adapt unit testing,the book also has a chapter explaining some of the pattern in dealing with introducing automated unit tes The writer goes on sharing his distilled knowledge on unit testing and various patterns on making a maintainable automated unit tests, and by giving a clear recommendation on unit testing framework ,the author relief the novice unit tester approacher from the hustle of evaluating different unit test frameworks and giving the reader a solid introductory dose enabling him to adapt unit testing,the book also has a chapter explaining some of the pattern in dealing with introducing automated unit tests into a legacy code, being a technical book reading that is not accompanied with immediate implementation doesn't let you reap the most benefits of the advices and patterns displayed in the book, that's why I am planning on reading it for a second time.

  8. 4 out of 5

    Viktor Nilsson

    This book was a mixed bag for me. On the one hand, explanations are very clear and everything is easy to follow. On the other hand, it's organized quite haphazardly, with references back and forth and with no clear line to follow in order to progress step by step. Much of it reads like a collection of assorted blog posts, and some parts discuss very small details, such as features of different framework versions etc. Such fresh information should not be recorded in a book, since it will quickly This book was a mixed bag for me. On the one hand, explanations are very clear and everything is easy to follow. On the other hand, it's organized quite haphazardly, with references back and forth and with no clear line to follow in order to progress step by step. Much of it reads like a collection of assorted blog posts, and some parts discuss very small details, such as features of different framework versions etc. Such fresh information should not be recorded in a book, since it will quickly go out of date. If you're struggling with getting a grasp of unit testing however, this book will surely get you there.

  9. 4 out of 5

    Vỹ Hồng

    This is a must read for anyone interested in writing good unit tests. The book introduces various concepts, tools, techniques and principles for unit testing. All are valuable. You'll get most out of this book if you're using a static typed language. If you're using dynamic language, some sections of the book might not be applicable (e.g. constrained vs. unconstrained test framework, design for testability). However, there is still much value to take from this book even if you're using a dynamic This is a must read for anyone interested in writing good unit tests. The book introduces various concepts, tools, techniques and principles for unit testing. All are valuable. You'll get most out of this book if you're using a static typed language. If you're using dynamic language, some sections of the book might not be applicable (e.g. constrained vs. unconstrained test framework, design for testability). However, there is still much value to take from this book even if you're using a dynamic language.

  10. 4 out of 5

    Nilofar Mew

    The book touches pretty much everything related to Unit testing on high level. It is a good book to start with and to get your head around the idea of unit testing. This will not teach you to write all kind of test that you might write, but it will definitely provide you with all the necessary information that you would need to write any test. The book of course has Roy's personality all over it. His sarcasm makes it fun and delight reading the book.

  11. 4 out of 5

    Madan Meena

    When i became serious with whole writing unit test thought process, I started with this book. It gave me good idea and direction and confidence to go about the actual act. This book will get you to speed about various aspect of unit test writing but you need to actually start writing to get the full benefit of the book.

  12. 4 out of 5

    Kyle Wilson

    Still trying to see where unit test fits in the scheme of things for the sorts of work I do. This book really wasn't all that helpful as its examples showed rather trivial fakes compared to anything I run across and suggested that anything more complex isn't really a unit test. If that is really the case then integration tests meet most of my needs better...

  13. 5 out of 5

    Mike Nguyen

    Strongly recommend for software developer who aims to produce bug-free applications. This book not only recommends set of practice of doing TDD properly but also gives suggestion on managing and handling legacy code those without automated tests in the first place.

  14. 4 out of 5

    Cedd

    This book is maybe useful to give to someone to persuade them why they should care about unit testing, but is next to useless at making you better at unit testing. XUnit Test Patterns is the canonical book for improving your unit testing skills.

  15. 4 out of 5

    Kyle Butler

    A must read for any software professional whether you design, code, or test for a living. Jam packed with insight, real world examples, tips for everything from testing to design for test, it is a wealth of useful actionable information.

  16. 5 out of 5

    Branimir Kirilov

    In my opinion this book is a must for every .NET developer.

  17. 5 out of 5

    Sergey Shchurko

    Excellent introductory book about unit tests. It describes a entire set of aspects related to test.

  18. 4 out of 5

    Jeremy West

    Not only a great introduction but also a great reference. It goes from rock bottom to some pretty in depth topics with a pretty good transition.

  19. 5 out of 5

    Thinh Kieu

    Must-read book for someone who is working on unit tests. Everything you need to know about unit testing is here.

  20. 4 out of 5

    Mateusz Stępniak

    If you're looking for an introduction to unit testing, look no further.

  21. 4 out of 5

    Eugene Popovych

    Great book to start writing unit tests if you don't know anything about it.

  22. 5 out of 5

    Pat Swanson

    This is, bare none, the best book about unit testing I have ever read. While it is focused on .Net, a lot of the principles here translate to other languages.

  23. 5 out of 5

    Scott

    Great introduction to unit testing that is very readable with lots of examples.

  24. 5 out of 5

    Cliff Roberson

    1 2 3 4 5 Isolation Frameworks 6 Digging deeper into isolation frameworks 7 Test Hierarchies and Organization 8 9 Integrating Unit Testing into the organization 10 Working with legacy code 11 Design and Testability

  25. 4 out of 5

    Ireney Berezniak

    This title has been crossing my path for a number of years now, mainly through Amazon recommendations, and now also Goodreads recommendations. The second edition has been released a few months ago, and so I finally decided to purchase it and see whether I could learn anything from it. I have been a practitioner for many years, and felt that I have mastered the art, but if I learned anything from my years of experience, is that "there is always room for improvement". Turns out that Osherove's book This title has been crossing my path for a number of years now, mainly through Amazon recommendations, and now also Goodreads recommendations. The second edition has been released a few months ago, and so I finally decided to purchase it and see whether I could learn anything from it. I have been a practitioner for many years, and felt that I have mastered the art, but if I learned anything from my years of experience, is that "there is always room for improvement". Turns out that Osherove's book did not teach me anything new after all. The theory, techniques, and tools that the author outlined in his book I have developed myself through years of experimentation, failures, and research. If anything, I feel that the author could have expanded his title to cover additional subjects. For instance, anyone interested in mastering the art of unit testing would undoubtedly benefit to learn of patterns to manage a library of hand-coded stubs or stub factories that will certainly grow as the system gains more features and units that need to be tested. How to build stubs, for instance; how to organize them for maximum reusability and minimum duplication and management? Should one draw on the dubiously-named Object Mother pattern outlined by Martin Fowler perhaps, or maybe the Builder pattern? This is not to say that this title is useless. Osherove progresses the subject in a highly approachable manner that will be quite helpful to a beginner. The author explains concepts and theory, and provides concrete code examples which encourage experimentation, and aid the learning process. Anyone starting with unit testing, or struggling with finding the optimal approach to unit testing, will most certainly benefit from this book.

  26. 4 out of 5

    David

    I rather liked this book, and learned a lot from it (far more than I have from a lot of other computer programming books). The things I liked about it is: 1) While the concepts are demonstrated in .NET, there's references to other languages (Java and Ruby) and the concepts I imagine would transfer fairly easily. 2) The book is written almost as if you were talking to the author right there. It didn't feel as artificial as other books, and you can see there's 'personality' in parts of the book. 3) T I rather liked this book, and learned a lot from it (far more than I have from a lot of other computer programming books). The things I liked about it is: 1) While the concepts are demonstrated in .NET, there's references to other languages (Java and Ruby) and the concepts I imagine would transfer fairly easily. 2) The book is written almost as if you were talking to the author right there. It didn't feel as artificial as other books, and you can see there's 'personality' in parts of the book. 3) There's discussion of both technical skills, and soft skills. Part of his assumption is that you may need to try and influence the organization to do more testing. There may have been example code out there, but I didn't notice it referenced. If there wasn't an example project that he wrote to demo the proper patterns he's talking about, then that's really the only thing I can think of that this book could use a good amount of improvement on. I was reading this book right as I was beginning a new project, and really 'took to heart' a lot of stuff he said, and implemented tests following his guidelines. I'm confident to say, that in the short time it took me to go through this book (maybe a month) that the tests written in this project already saved me twice. If others are thinking of reading this book, I kinda recommend a similar idea..that being, work on a new project starting about half way through this book. It's nice to get pretty immediate feedback regarding how the concepts help.

  27. 5 out of 5

    Lucas Teixeira

    This is a good book for those uninitiated in proper unit testing, but there are a lot o things I didn't like. The book has a conversational tone, which can be very good, but there's a line writers should not cross. The author insists in using some dumb jokes throughout the book. I was pissed by the third time I read "you have three options: A, B, or quit your job". Another problem with this book is that it doesn't connect the code examples in a manner that the build on top of each other. Most of t This is a good book for those uninitiated in proper unit testing, but there are a lot o things I didn't like. The book has a conversational tone, which can be very good, but there's a line writers should not cross. The author insists in using some dumb jokes throughout the book. I was pissed by the third time I read "you have three options: A, B, or quit your job". Another problem with this book is that it doesn't connect the code examples in a manner that the build on top of each other. Most of the examples cannot be run and you have to figure out how to complete the missing pieces to make it work. If you don't intend to type and execute the code presented, this shouldn't be a problem. Overall, I think the presentation of the concepts is spot on. But the issues with the examples was a major setback for me. I'd still recommend this book to anyone who wants to dip their toes into unit testing waters.

  28. 4 out of 5

    Hovhannes Gulyan

    Very informative and practical book on Unit Testing, IoC containers, mocking frameworks, automation builds, continues integrations and object-oriented programming. This book gives a huge insight on good development skills, making code testable and readable, which a lot of companies value the most. Besides that Roy Osherove gives a lot of information about tools and frameworks, that are good to know and use in modern applications. Along with improving design skills, you will feel yourself more com Very informative and practical book on Unit Testing, IoC containers, mocking frameworks, automation builds, continues integrations and object-oriented programming. This book gives a huge insight on good development skills, making code testable and readable, which a lot of companies value the most. Besides that Roy Osherove gives a lot of information about tools and frameworks, that are good to know and use in modern applications. Along with improving design skills, you will feel yourself more comfortable developing code of a good value. For further reading author recommends Clean Code by Robert C. Martin ( https://www.goodreads.com/book/show/3... ) and Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce ( https://www.goodreads.com/book/show/4... ) Thank you, Roy, for a great book!

  29. 5 out of 5

    pluton

    This book is a great introduction into unit testing if you only heard about it and want to dive in. It can also help you understand some missing points from your own unit test practice. Although the examples are in C#, it's quite easy to understand what's going on, and adapt to your language. The book is explicitly only about unit testing, not integration testing or TDD (they are covered very briefly); you'll see the design principles allowing for easier testing and pieces of advice how to intro This book is a great introduction into unit testing if you only heard about it and want to dive in. It can also help you understand some missing points from your own unit test practice. Although the examples are in C#, it's quite easy to understand what's going on, and adapt to your language. The book is explicitly only about unit testing, not integration testing or TDD (they are covered very briefly); you'll see the design principles allowing for easier testing and pieces of advice how to introduce testing in your projects.

  30. 5 out of 5

    Eric

    More like 3.5 stars. Dated references but good foundation and intro to NUnit as opposed to the built in Visual Studio tools. Don't have a lot of experience with automated testing and continuous integration, but interested in moving in that direction. The discussion of integration testing frameworks and by extension, web testing frameworks (Selenium anyone?) were also engaging and something I've been looking for for a while. I know that c#/.net has started including a lot of fakes and other testi More like 3.5 stars. Dated references but good foundation and intro to NUnit as opposed to the built in Visual Studio tools. Don't have a lot of experience with automated testing and continuous integration, but interested in moving in that direction. The discussion of integration testing frameworks and by extension, web testing frameworks (Selenium anyone?) were also engaging and something I've been looking for for a while. I know that c#/.net has started including a lot of fakes and other testing tools, but it's good to get some info on how the other guys do it.

Add a review

Your email address will not be published. Required fields are marked *

Loading...
We use cookies to give you the best online experience. By using our website you agree to our use of cookies in accordance with our cookie policy.