Learn how to improve your C# coding skills using unit testing. Despite it's name, unit testing is really a coding technique, not a testing technique. Unit testing is done by programmers, for programmers. It's primarily for our we get improved confidence in our code, better ability to make deadlines, less time spent in the debugger, and less time beating on the code to make it work correctly.This book shows how to write tests, but more importantly, it goes where other books fear to tread and gives you concrete advice and examples of what to test--the common things that go wrong in all of our programs. Discover the tricky hiding places where bugs breed, and how to catch them using the freely available NUnit framework. It's easy to learn how to think of all the things in your code that are likely to break. We'll show you how with helpful mnemonics, summarized in a handy tip sheet (also available from our www.pragmaticprogrammer.com website).With this book you We'll also cover how to use Mock Objects for testing, how to write high quality test code, and how to use unit testing to improve your design skills. We'll show you frequent "gotchas"--along with the fixes--to save you time when problems come up.But the best part is that you don't need a sweeping mandate to change your whole team or your whole company. You don't need to adopt Extreme Programming, or Test-Driven Development, or change your development process in order to reap the proven benefits of unit testing. You can start unit testing, the pragmatic way, right away.
Andy Hunt is a programmer turned consultant, author and publisher. He co-authored the best-selling book "The Pragmatic Programmer", was one of the 17 founders of the Agile Alliance, and co-founded the Pragmatic Bookshelf, publishing award-winning and critically acclaimed books for software developers.
Andy started writing software professionally in early 80's across diverse industries such as telecommunications, banking, financial services, utilities, medical imaging, graphic arts, and of course, the now-ubiquitous web.
Started reading the book earlier and could not even pass through a couple of chapters. The information in the book is outdated, configuration and setup is deprecated. I would not give it a rating as it was very helpful at the time of its writing, however, now, no way! For me, I switched to "The Art of Unit Testing, 2nd Edition" and it's super! I highly recommend that you switch too.
I didn't even know what unit testing was before I picked up this book.
At not much more than 150 pages, this book is small. It's part of a series called "The Pragmatic Starter Kit". That series is part of a larger series of books that started coming out after "The Pragmatic Programmer" was published.
I LOVE what unit testing promises. To be able to incrementally build code that is known to work AND be instantly alerted when you break it is very, very cool.
The book goes over the NUnit framework, walks you through the initial setup, and shows some unit tests in an example project.
After reading this book, I have no idea how to write a useful unit test.
My guess is that it must take a lot of experience to do it well and might even be a bit of an artform.
The book talks about testing principles, fence post errors, mock objects and edge case scenarios. Things like: testing for null or handing a pre-sorted algorithm to a sort algorithm.
None of that really helps me.
Because of this book, I understand why it's a good idea to write unit tests and what the common reasons are that developers give for not writing them.
Even though I scratch my head a lot when I try to write a unit test, I've started using them. I open the book up, look through the examples, and skim the chapters looking for an appropriate example. Most of the time I feel like I'm missing something.
I'm wondering if I need to read a different book, one that has more concrete examples or find an open source project that uses unit tests.
Ожидал большего и пожалел потраченного времени. Больше напоминает какую-то бакалаврскую работу, когда студент начал работу за неделю до даты сдачи, залез в поисковик и начал копировать все, что попадает в категории юнит-тесты, nunit и C#. Если Вы еще ни разу не сталкивались с понятием Юнит-тестов и желаете прочитать что-то обзорное, можно начать с этой книги. Действительно полезными могут быть акронимы, которые описаны в книге - FIRST, Right-BICEP, CORRECT.
I was looking for something that would help me more in terms of validation testing rather than unit testing so my fault for expecting more out of the book than the title said.