software-design/

Architecture, patterns, testing, refactoring and code review.

6 results
software-design/refactoring-how-to-tidy-working-code-without-breaking-it.md Refactoring: how to tidy working code without breaking it Refactoring means changing how code is built on the inside without changing what it does. It sounds risky, but there is a simple routine… 6 min read · 24 Oct software-design/unit-tests-why-four-passing-tests-don-t-prove-a-function-works.md Unit tests: why four passing tests don't prove a function works Your function gave the right answer four times. Is it correct? Not necessarily: passing tests only show the bug isn't where you looked… 4 min read · 21 Oct software-design/dependency-injection-why-a-test-passes-at-9am-and-fails-at-3pm.md Dependency injection: why a test passes at 9am and fails at 3pm A test that passes in the morning and fails in the afternoon, with no change to the code, is a puzzle many beginners meet. The cause is… 5 min read · 12 Oct software-design/pure-functions-why-the-same-call-can-give-two-different-answers.md Pure functions: why the same call can give two different answers Call a function twice with the same input and get two different answers? Python isn't broken. The function is doing something extra, called… 5 min read · 9 Oct software-design/refactoring-tidy-messy-code-without-breaking-it-using-tests-as-a-net.md Refactoring: tidy messy code without breaking it, using tests as a net Refactoring means changing how code is written without changing what it does, so the next person (often you) can read it. It sounds risky… 5 min read · 6 Oct software-design/your-first-unit-test-catch-the-leap-year-bug-a-quick-check-misses.md Your first unit test: catch the leap-year bug a quick check misses A unit test is a tiny piece of code that checks another piece of code: you pick an input, write down the answer you expect, and let the… 5 min read · 3 Oct