Liknande böcker
Test-Driven Development with Mockito
Bok av Sujoy Acharya
Learn how to apply Test-Driven Development and the Mockito framework in real life projects, using realistic, hands-on examples
Overview
Start writing clean, high quality code to apply Design Patterns and principlesAdd new features to your project by applying Test-first development- JUnit 4.0 and Mockito frameworkMake legacy code testable and clean up technical debts In Detail
The usual life cycle of code involves adding code, breaking an existing functionality, fixing that and breaking a new area! This fragility can be fixed using automated tests and Test Driven Development.
TDDs test first approach expedites the development process and unit tests act as safety nets for code refactoring and help in maintaining and extending the code. This makes TDD highly beneficial for new projects.
This practical, hands-on guide provides you with a number of clear, step-by-step exercises that will help you to take advantage of the real power that is behind Test Driven Development and the Mockito framework. By using this book, you will gain the knowledge that you need to use the Mockito framework in your project.
This book explains the concept of Test Driven Development (TDD), including mocking and refactoring, as well as breaking down the mystery and confusion that surrounds the test first approach of TDD. It will take you through a number of clear, practical examples that will help you to take advantage of TDD with the Mockito framework, quickly and painlessly.
You will learn how to write unit tests, refactor code and remove code smells. We will also take a look at mock objects and learn to use Mockito framework to stub, mock, verify and spy objects for testability. You will also learn to write clean, maintainable, and extensible code using design principles and patterns.
If you want to take advantage of using Test Driven Development and learn about mocking frameworks, then this is the book for you. You will learn everything you need to know to apply Test Driven Development in a real life project, as well as how to refactor legacy code and write quality code using design patterns.
What you will learn from this book
Create your first unit test and discover the power of unit testingFamiliarize yourself with Test-first Development and the refactoring processAdd new features to your project applying Test Driven DevelopmentCreate readable, maintainable, and extensible software using design principles and patterns Start stubbing, mocking, spying, and verifying objects using Mockito APIsApply inside-out and outside-in TDD stylesExpedite the development process using Eclipse and keyboard shortcutsApply JUnit 4.0 and advanced Mockito features argument captor, callbacks, and answers Approach
This book is a hands-on guide, full of practical examples to illustr...