Don't Repeat Yourself (DRY)

Don't Repeat Yourself (DRY) image
A coding principle stating that every piece of knowledge should have a single, authoritative representation in a system. When logic is duplicated across a codebase, any change must be made in multiple places, increasing the risk of inconsistency and bugs.ย 

Illustrated this with a value-added tax example: rather than scattering a raw multiplier throughout the code, extracting it into a named method means the logic lives in one place and can be updated once. The opposing backronym is WET (Write Everything Twice), used humorously to describe code that violates DRY.
Explore MoT
Test Forward 2027 ยท Software Quality in the age of AI image
Tue, 19 Jan 2027
Test Forward is one afternoon at Station F with the QA and engineering people closing that gap in their own teams.
MoT Software Testing Essentials Certificate image
Boost your career in software testing with the MoT Software Testing Essentials Certificate. Learn essential skills, from basic testing techniques to advanced risk analysis, crafted by industry experts.
This Week in Quality image
Debrief the week in Quality via a community radio show hosted by Simon Tomes and members of the community
Subscribe to our newsletter