Book Image

Mockito Cookbook

By : Marcin Grzejszczak
Book Image

Mockito Cookbook

By: Marcin Grzejszczak

Overview of this book

Table of Contents (17 chapters)
Mockito Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Programmers rarely have the opportunity to work with code that they create from scratch. Often, we have to support systems that have been there for several years and were written at the time when programmers were paid for the number of typed lines of code. However, this is not always the case. Nowadays, when there are so many start-up companies emerging, people tend to sacrifice quality for money. It's all about faster delivery of new features. How you write your code is not that important until the application works fine.

This leads to maintaining legacy systems (take a look at Working Effectively with Legacy Code, Martin Feathers, available at http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052, for details on how to work with such systems). Such code monster-like classes are also called god classes. Most likely, their names end with a manager or helper suffix since they do everything and have access to all the possible dependencies in the system...