Table of Contents

 

Copyright

Brief Table of Contents

Table of Contents

Preface

Acknowledgments

About this Book

About the Cover Illustration

1. Foundations

Chapter 1. The promise of good tests

1.1. State of the union: writing better tests

1.2. The value of having tests

1.2.1. Factors of productivity

1.2.2. The curve of design potential

1.3. Tests as a design tool

1.3.1. Test-driven development

1.3.2. Behavior-driven development

1.4. Summary

Chapter 2. In search of good

2.1. Readable code is maintainable code

2.2. Structure helps make sense of things

2.3. It’s not good if it’s testing the wrong things

2.4. Independent tests run easily in solitude

2.5. Reliable tests are reliable

2.6. Every trade has its tools and tests are no exception

2.7. Summary

Chapter 3. Test doubles

3.1. The power of a test double

3.1.1. Isolating the code under test

3.1.2. Speeding up test execution

3.1.3. Making execution deterministic

3.1.4. Simulating special conditions

3.1.5. Exposing hidden information

3.2. Types of test doubles

3.2.1. Test stubs are unusually short things

3.2.2. Fake objects do it without side effects

3.2.3. Test spies steal your secrets