Skip to content
Katabench
Try free

Topic

Testing & Refactoring

Techniques for changing C# safely, writing tests that catch real regressions, and measuring maintainability instead of debating it.

8 min read

Integration testing in .NET with Testcontainers and WebApplicationFactory

Integration testing in .NET with Testcontainers and WebApplicationFactory runs your API against real PostgreSQL, so constraints and query counts get tested.

Read article →
8 min read

Mutation Testing in C# with Stryker.NET

Mutation testing in C# plants controlled bugs and asks whether your tests notice. Learn Stryker.NET, triage survivors, and set useful CI gates.

Read article →
8 min read

Code smells: a working catalog of six, with C# examples

Code smells are symptoms, not verdicts. Six worth knowing, with C# examples: the tell for each, why it hurts, and the refactoring move that clears it.

Read article →
9 min read

Cyclomatic complexity: what the number actually tells you

Cyclomatic complexity counts the independent paths through a method. How to compute it by eye, what a score of 10 predicts, and how to reduce it for real.

Read article →
8 min read

Unit testing best practices: test behavior, not implementation

Unit testing best practices that survive refactoring: AAA structure, behavior-first assertions, a healthy test pyramid, and determinism over flakiness.

Read article →
7 min read

Primitive obsession: the bug the compiler was begging to catch

When everything is a string, a decimal, or a Guid, the type system cannot tell arguments apart. Value objects in modern C#, the bugs they delete, their limits.

Read article →
5 min read

A test-first playbook for refactoring legacy C# safely

How to refactor legacy C# without breaking it: write characterization tests first, then take small behavior-preserving steps like extract method and seams.

Read article →
6 min read

Clean code is a vibe until you measure it

Four code quality metrics you can automate in C#: cyclomatic complexity, nesting depth, method length, and duplication, with thresholds and a passing refactor.

Read article →

Get new puzzles and .NET tips in your inbox

A short note when fresh kata land, plus the C# and performance tricks behind the grading. No spam, unsubscribe anytime.