Learning Test-Driven Development: A Polyglot Guide to Writing Uncluttered Code
- Length: 275 pages
- Edition: 1
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2021-11-09
- ISBN-10: 1098106474
- ISBN-13: 9781098106478
- Sales Rank: #1623945 (See Top 100 Books)
Your code is a testament to your skills as a developer. No matter what language you use, your code should be clean, elegant, and uncluttered? With test-driven development (TDD), you’ll write better code–code that’s easy to understand, retains its elegance, and works for years to come.
This indispensable guide will show you how TDD works in three different languages: Go, JavaScript, and Python. With Learning Test-Driven Development at your side, you’ll be able to:
- Tame domain complexity using a divide-and-conquer approach
- Understand how TDD works across languages, testing frameworks, and domain concepts
- See how TDD enables continuous integration and continuous delivery
- Support refactoring and redesign with TDD
- Set up a continuous integration environment with the unit tests produced during TDD
- Write clean, uncluttered code using TDD in Go, JavaScript, and Python
Foreword Preface What Is Test-Driven Development? A Technique Designing and Structuring Code A Bias Toward Simplicity Increased Confidence Who Is This Book For? What Are the Prerequisites for Reading This Book? How to Read This Book Follow the Book One Language at a Time Follow the Book in Two Languages First and Then in the Third Language Follow the Book in All Three Languages Simultaneously Conventions Used in This Book Typographical Conventions Lexical Conventions Using Code Examples How to Contact Us TDD—The Whys Why Does This Book Use Go, JavaScript, and Python? Why Not This Other Language? Why Does This Book Have a “Chapter 0”? Chapter 0: Introduction and Setup Setting Up Your Development Environment Common Setup Go JavaScript Python Where We Are I. Getting Started 1. The Money Problem Red-Green-Refactor: The Building Blocks of TDD What’s the Problem? Our First Failing Test Go JavaScript Python Going for Green Go JavaScript Python Cleaning Up Go JavaScript Python Committing Our Changes Where We Are Go JavaScript Python 2. Multicurrency Money Enter the Euro Go JavaScript Python Keeping Code DRY Go JavaScript Python Didn’t We Just Say “Don’t Repeat Yourself”?! Divide and Conquer Go JavaScript Python Cleaning Up Go JavaScript Python Committing Our Changes Where We Are 3. Portfolio Designing Our Next Test Go JavaScript Python Committing Our Changes Where We Are II. Modularization 4. Separation of Concerns Test and Production Code Unidirectional Dependency Dependency Injection Packaging and Deployment Modularization Removing Redundancy Where We Are 5. Packages and Modules in Go Separating Our Code into Packages Go Modules Creating a Package Encapsulation Removing Redundancy in Tests Committing Our Changes Where We Are 6. Modules in JavaScript Separating Our Code into Modules A Segue into JavaScript Modules CommonJS Asynchronous Module Definition (AMD) Universal Module Definition (UMD) ESModules Improving Our Tests Removing Redundancy in Tests Adding a Test Class and Test Methods Discovering and Running Tests Automatically Produce Output When Tests Run Successfully Run All Tests Even When an Earlier Test Assertion Fails Committing Our Changes Where We Are 7. Modules in Python Separating Our Code into Modules Removing Redundancy in Tests Committing Our Changes Where We Are III. Features and Redesign 8. Evaluating a Portfolio Mixing Money Go JavaScript Python Committing Our Changes Where We Are 9. Currencies, Currencies, Everywhere Making a Hash(map) of Things Go JavaScript Python Committing Our Changes Where We Are 10. Error Handling Error Wish List Go JavaScript Python Committing Our Changes Where We Are 11. Banking on Redesign Dependency Injection Putting It All Together Go JavaScript Python Committing Our Changes Where We Are IV. Finishing Up 12. Test Order Changing Exchange Rates Go JavaScript Python Committing Our Changes Where We Are 13. Continuous Integration Core Concepts Version Control Build Server and Agent Artifact Repository Deployment Environment Putting It All Together Create Your GitHub Account Verify Your GitHub Account Push Code Repository to GitHub Prepare for CI Build Scripts Go JavaScript Python Committing Our Changes Where We Are 14. Retrospective Profile Cyclomatic Complexity Coupling Succinctness Purpose Cohesion Completeness Process Putting It All Together Go JavaScript Python Isn’t TDD Dead? Where We Are A. Development Environment Setup Online REPLs Repl.it LeetCode CoderPad The Go Playground The Comprehensive List of Online REPLs Integrated Development Environments (IDEs) Visual Studio Code IntelliJ IDEA Eclipse Installing Language Tools Go JavaScript / ES6 Python B. A Brief History of the Three Languages Go JavaScript The assert Module The Module Mechanism Python C. Acknowledgments Index
Donate to keep this site alive
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: Learning Test-Driven Development: A Polyglot Guide to Writing Uncluttered Code
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.