Cover image for Test-Driven Development with Mockito.
Test-Driven Development with Mockito.
Title:
Test-Driven Development with Mockito.
Author:
Acharya, Sujoy.
ISBN:
9781783283309
Personal Author:
Physical Description:
1 online resource (186 pages)
Contents:
Test-Driven Development with Mockito -- Table of Contents -- Test-Driven Development with Mockito -- Credits -- About the Author -- About the Reviewer -- www.PacktPub.com -- Support files, eBooks, discount offers and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. Getting Familiar with TDD -- Definition of test -- The big picture -- Refactoring -- Summary -- 2. Refactoring - Roll the Dice -- Refactoring -- Reasons behind refactoring -- Refactoring schedule -- When not to refactor -- Stopping refactoring -- Code smell -- Switch statements -- Duplicate code -- Comments -- Long methods and parameter list -- Large classes (aka GOD object) -- Agent classes -- Lazy, dead classes and dead code -- Over engineering (speculative generality) -- Wrong inheritance (refused bequest) -- Summary -- 3. Applying TDD -- Understanding different test types -- Understanding TDD - a real-life example -- Definition -- Common healthcare vocabulary -- Procedure -- The service catalogue -- MRN -- Encounter -- Summary -- 4. Understanding the Difference between Inside-out and Outside-in -- Understanding outside-in -- An example of ATDD -- Understanding the advantages and disadvantages of outside-in -- Understanding inside-out -- Understanding the advantages and disadvantages of inside-out -- Summary -- 5. Test Doubles -- Categories of test doubles -- Dummy -- Stub -- Fake -- Mock -- Summary -- 6. Mockito Magic -- An overview of Mockito -- Why you should use Mockito -- Qualities of unit testing -- Drinking Mockito -- Verifying redundant invocation -- Rationale -- The argument matcher -- Rationale -- Why we need wildcard matchers.

The ArgumentMatcher class -- Throwing exceptions -- Consecutive calls -- Stubbing with callbacks - using the Answer class -- Spying objects -- Using doReturn() -- Working with Void methods -- Argument capture -- Summary -- 7. Leveraging the Mockito Framework in TDD -- Applying Mockito -- Customer requirements -- Building the application -- Summary -- 8. World of Patterns -- Characteristics of a bad design -- Design principles -- Design patterns -- Classification of patterns -- Replacing conditional logic with command -- Applying a command pattern -- Replacing conditional logic with strategy -- Strategy pattern -- Summary -- 9. TDD, Legacy Code, and Mockito -- What is legacy code? -- Problems with legacy code -- Diving into the legacy puzzle -- Refactoring legacy code -- The role of Mockito -- Summary -- A. TDD Tools and Frameworks -- Discovering Eclipse -- Useful keys for TDD and refactoring -- General settings -- JUnit 4.x -- Running the first unit test -- Exception handling -- The test suite -- Ignoring a test -- Asserting a value -- Summary -- B. Agile Practices -- Exploring continuous integration -- Exploring Jenkins -- Configuring Jenkins -- Adding a build job -- Source code management -- Build triggers -- Scripting -- Post-build actions -- Security -- Revealing Agile methodologies -- Working with the Scrum methodology -- Roles -- Meetings -- The story board -- Exploring the Kanban development process -- Summary -- Index.
Abstract:
This book is a hands-on guide, full of practical examples to illustrate the concepts of Test Driven Development.If you are a developer who wants to develop software following Test Driven Development using Mockito and leveraging various Mockito features, this book is ideal for you. You don't need prior knowledge of TDD, Mockito, or JUnit.It is ideal for developers, who have some experience in Java application development as well as a basic knowledge of unit testing, but it covers the basic fundamentals of TDD and JUnit testing to get you acquainted with these concepts before delving into them.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: