• Complain

Jay Fields - Working Effectively with Unit Tests

Here you can read online Jay Fields - Working Effectively with Unit Tests full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2015, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Working Effectively with Unit Tests
  • Author:
  • Genre:
  • Year:
    2015
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Working Effectively with Unit Tests: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Working Effectively with Unit Tests" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Jay Fields: author's other books


Who wrote Working Effectively with Unit Tests? Find out the surname, the name of the author of the book and a list of all author's works by series.

Working Effectively with Unit Tests — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Working Effectively with Unit Tests" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Working Effectively with Unit Tests Jay Fields This book is for sale at - photo 1
Working Effectively with Unit Tests
Jay Fields

This book is for sale at http://leanpub.com/wewut

This version was published on 2015-01-26

This is a Leanpub book Leanpub empowers authors and publishers with - photo 2

* * * * *

This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.

* * * * *

2014 - 2015 Jay Fields

For Dana, the love of my life.

Foreword

Its taken quite a while but we finally have consensus around the ideathat unit testing is a necessity for most of todays projects.Occasionally, I see a voice in the wilderness challenge the idea - butjust as quickly people whove been doing unit testing reflect back ontheir experience and notice the benefits that theyve received. Theidea of going without unit tests on a large project is justunthinkable for many people.

To me, this is success of the best kind - people are able to get morework done with less stress and fewer headaches. But that doesnt meanthat its all easy. Even though unit testing has been a stronglyrecommended practice since at least the early 2000s, people stillstruggle. They struggle because it is easy to get lost in the designdecisions that you have to make when you are writing tests.

Tests are just as important as production code, but they aredifferent. Through trial and error we are learning better practicesbut much of that knowledge is not yet widespread.

This is why I am very excited by Jay Fields book. Ive known Jay forclose to a decade and over that time Ive seen him approach problemsin software with conscientiousness and deep curiosity - trying thingsout, discussing them and not being satisfied with answers that dontquite ring true. The book youre about to read is a culmination ofthat inquiry. Reading it, youll learn a lot about unit testing.But, more than that, if you read between the lines youll learn a lotabout how to see and think about software.

Michael Feathers, Director, R7K Research & Conveyance

Preface

Over a dozen years ago I read Refactoringfor the first time; it immediately became my bible.While Refactoring isnt about testing, it explicitly states: if you want to refactor,the essential precondition is having solid tests. At that time, if Refactoring deemed itnecessary, I unquestionably complied. That was the beginning of my quest to create productiveunit tests.

Throughout the 12+ years that followed my first reading of Refactoring I made many mistakes, learnedcountless lessons, and developed a set of guidelines that I believe make unit testing aproductive use of programmer time. This book provides a single place to examine thosemistakes, share the lessons learned, and provide direction in a way that Ive foundto be the most effective.

Why Test?

The answer was easy for me: Refactoring told me to. Unfortunately, doing something strictlybecause someone or something told you to is possibly the worst approach you could take.The more time Ive invested in testing, the more Ive found myself returning to the question:Why am I writing this test?

There are many motivators for creating a test or several tests:

  • validate the system
    • immediate feedback that things work as expected
    • prevent future regressions
  • increase code-coverage
  • enable refactoring
  • document the behavior of the system
  • your manager told you to
  • Test Driven Development
    • improved design
    • breaking a problem up into smaller pieces
    • defining the simplest thing that could possibly work
  • customer acceptance
  • ping pong pair-programming

Some of the above motivators are healthy in the right context, others are indicators of largerproblems. Before writing any test, I would recommend deciding which of the above are motivatingyour testing. If you first understand why youre writing a test, youll have a muchbetter chance of writing a test that is maintainable and will make you more productive in thelong run.

Once you start looking at tests while considering the motivator, you may find you have teststhat arent actually making you more productive. For example, you may have a test that increasescode-coverage, but satisfies no other motivator. If your team requires 100% code-coverage, then thetest provides value. However, if your team has abandoned the (in my opinion harmful) goal of 100%code-coverage, then youre in a position to perform my favorite refactoring: delete.

Who Should Read This Book

This book is aimed at a professional programmer, someone who writes software for a living. Theexamples and discussion include a lot of code to read and to understand.

Although this book is focused on testing, testable codecan have a large impact on the design of a system.It is vital for senior designers and architects to understandthe principles recommended and to use them in their projects.The principles within this book are best introduced to a teamby a respected and experienced developer. Such a developer canbest understand the principles and adapt themto their specific context. In addition, familiarity with this bookscontent will allow experienced developers to provide it as a referencefor the less experienced members of their team.

Despite my opinion on who should introduce these concepts, Ive attempted to write this bookfor both people experienced with and those brand-new to unit testing. Ideally, a respectedprogrammer will look to implement the ideas within this book, and begin by passing this bookon to those on the team that would likely share interest in this approach.If youre already writing testsI believe this book will provide concepts and suggestions that will prove usefulfor years to come. If you arent already writing tests youlllikely want to pick up an intro to unit testing book as well. The concepts in this bookshould be understandable to developers of all levels; however, we will not coverconcepts such as framework selection, framework configuration, or writing your first test.

Building on the Foundations Laid by Others

While this book does contain an Acknowledgments section, it wouldnt be practical to thankeveryone that has contributed to creating the practices that this book details. I can say withfull confidence that I wouldnt be in the position to write this book without at least thefollowing groups:

  • creators and maintainers of both NUnit and JUnit
  • creators and maintainers of NMock, (James Meads) Mocha, Mockito, JMock, and RSpec
  • each team member from each of my projects at ThoughtWorks & DRW Trading
  • every conference speaker or attendee whos provided feedback on my (sometimes radical) ideas
  • every person who left a comment on blog.jayfields.com

Thank you all, I deeply appreciate the feedback youve given throughout the years.

Acknowledgments

After writing Refactoring: Ruby Edition, I swore Id never write another book. Book writingis unquestionably a labor of love, and I wouldnt be able to do it without the support ofmy many friends in the industry.

  • Martin Fowler: Thank you for allowing me to reference and reuse content fromRefactoring. Its still my favorite technical book of all time.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Working Effectively with Unit Tests»

Look at similar books to Working Effectively with Unit Tests. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Working Effectively with Unit Tests»

Discussion, reviews of the book Working Effectively with Unit Tests and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.