<div><p>Your code is a testament to your skills as a developer. No matter what language you use, code should be clean, elegant, and uncluttered. By using test-driven development (TDD), you'll write code that's easy to understand, retains its elegance, and works for months, even years, to come. With
Learning Test-Driven Development: A Polyglot Guide to Writing Uncluttered Code
β Scribed by Saleem Siddiqui
- Publisher
- O'Reilly Media
- Year
- 2021
- Tongue
- English
- Leaves
- 331
- Edition
- 1
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
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
β¦ Table of Contents
Preface
What is Test-Driven Development
A technique
Designing and structuring code
Enhanced 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
The Apologies
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 & 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. Multi-currency 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
Go
JavaScript
Python
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. A Living Document
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 Github account
Verify 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
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 3 languages
Go
JavaScript
The assert module
The module mechanism
Python
C. Acknowledgments
π SIMILAR VOLUMES
<span><div><p>Your code is a testament to your skills as a developer. No matter what language you use, code should be clean, elegant, and uncluttered. By using test-driven development (TDD), you'll write code that's easy to understand, retains its elegance, and works for months, even years, to come.
Your code is a testament to your skills as a developer. No matter what language you use, code should be clean, elegant, and uncluttered. By using test-driven development (TDD), you'll write code that's easy to understand, retains its elegance, and works for months, even years, to come. With this ind
<p><span>Learn how to write a simple testing framework and extend it to drive the design of your logging library</span></p><h4><span>Key Features</span></h4><ul><li><span><span>Learn how to solve various challenges when testing in C++ with the help of effective solutions</span></span></li><li><span>
Code. Learn how to apply a test-driven development process by building ready C# 7 and .NET Core applications. Key Features Create tests to quickly detect and resolve issues when writing portable code Uncover code integration issues that improve code quality using continuous integration Set up and us