Search Ebook here:


Quality Code: Software Testing Principles, Practices, and Patterns



Quality Code: Software Testing Principles, Practices, and Patterns PDF

Author: Stephen Vance

Publisher: Addison-Wesley

Genres:

Publish Date: November 25, 2015

ISBN-10: 0321832981

Pages: 252

File Type: PDF

Language: English

read download

Book Preface

Lean production has revolutionized manufacturing over the last several decades. Frameworks like TQM, Just-In-Time, Theory of Constraints, and the Toyota Production System have vastly improved the general state of automotive and manufacturing quality and spawned a vital competitive landscape. The family of Agile software development approaches brings the principles of Lean production to the knowledge discipline of software product development, but it needs to adapt these principles to a less mechanical context.

The idea of building the quality into the product in order to increase customer satisfaction and reduce the overall lifetime cost of maintenance has resulted in practices like test-driven development (TDD) and other test-first and test-early approaches.

Regardless of which flavor you espouse, you need to understand what testable software looks like and master a wide range of techniques for implementing tests to be successful. I have found the gap between the principles and the state of the practice is often an unacknowledged source of failure in testing regimens.

It is easy to say “use test-driven development,” but when faced with a project, many developers do not know where to start. In showing people how to apply test-driven, or at least test-early, development, I often find that one of the obstacles is the mechanics of writing tests. Exercising a method as a mathematical function that purely translates inputs to easily accessible outputs is no problem. But much software has side effects, behavioral characteristics, or contextual constraints that are not as easy to test.

This book arose from a recurring need to show developers how to test the specific situations that stymied them. Consistently, we would sit down for a few minutes, we would write a unit test for the troublesome code, and the developer would have a new tool in his belt.

What Is This Book About?

This book is about easily and routinely testing all of your software. It primarily focuses on unit tests, but many of the techniques apply to higher-level tests as well. This book will give you the tools—the implementation patterns—to test almost any code and to recognize when the code needs to change to be testable.

What Are the Goals of This Book?

This book will help you • Understand how to easily unit test all of your code • Improve the testability of your software design • Identify the applicable testing alternatives for your code • And write tests in a way that will scale with the growth of your applications In support of these goals, this book provides you with • Over two-dozen detailed techniques for testing your code with lots of examples • Guidance on the right testing technique for a wide range of situations • And an approach to unit testing that helps you focus your efforts

Who Should Read This Book?

This book is primarily written for the professional software developer and software developer in test who want to increase their skill at codelevel testing as a means to improve the quality of their code. This book should be particularly useful to test-driven development (TDD) and test-early practitioners to help them ensure the correctness of their code from the start. Many of the techniques in this book also apply to integration and system testing.

What Background Do You Need?

This book assumes that the following points are true. • You are sufficiently fluent in object-oriented languages to be able to read and understand examples in Java, C++, and other languages and apply them to your language of choice. • You are familiar with concepts of code-level testing and xUnit framework members such as JUnit. • You are conversant in or have ready reference to information on design patterns and refactoring.

What Is in This Book?

Part I (Chapters 1–5) covers the principles and practices that guide successful testing. Chapter 1 puts the approaches in the book into an engineering context, discussing engineering, craftsmanship, and firsttime quality in general as well as some software-specific concerns. Chapter 2 examines the role of intent.

Chapter 3 outlines an approach to testing to help you focus your efforts. Chapter 4 discusses the interaction between design and testability, including some thoughts on scaling your testing efforts.

Chapter 5 presents a number of testing principles that you can use to guide your testing decisions. Part II (Chapters 6–13) details the implementation patterns for testing, starting with bootstrapping your tests and the basic catalog of techniques in Chapter 6.

Chapters 7 through 12 elaborate on the topics introduced in Chapter 6, with an interlude to investigate intent more deeply in Chapter 9.

Chapter 13 takes a deep technical dive into what many people consider impossible by introducing techniques for deterministically reproducing race conditions. Part III (Chapters 14 and 15) takes the principles and techniques from the rest of the book and provides a narrative for applying them in two real-life, worked examples. Chapter 14 examines using test-driven development to create a Java application from scratch, showing how to get started and how to apply the techniques in a strictly typed language.

Chapter 15 takes an untested, open-source JavaScript jQuery plugin and brings it under test, demonstrating an approach to taming legacy code in a dynamic language. Both examples contain references to the detailed GitHub commit history behind the narrative.

Those Who Came Before All advances build on the prior efforts of others. This work grew up in the context of a number of influences from the last fifteen years of computing. This list is not exhaustive, and I hope I do not offend those whom I missed or who did not receive as much publicity, but I would like to call out

• The influencers and signatories of the Agile Manifesto

• The pioneers of early Agile development approaches, such as Kent Beck with eXtreme Programming

• The Gang of Four and Martin Fowler for design patterns and refactoring

• The software craftsmanship movement and Robert C. “Uncle Bob” Martin

• More recent seminal work in software testing by Michael Feathers and Gerard Meszaros I have had the good fortune to work with several of the colleagues of these luminaries from their formative teams.


Download Ebook Read Now File Type Upload Date
Download here Read Now PDF July 22, 2020

How to Read and Open File Type for PC ?