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

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 can't tell your arguments apart. Value objects in modern C#, the bugs they delete, and when they're overkill.

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 (extract method, introduce a seam, replace conditional with polymorphism).

Read article →
6 min read

Clean code is a vibe until you measure it

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

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.