العودة إلى القاموس
مراجعة الكود والجودة

Legacy Code

Existing code that is difficult to change due to lack of tests, poor documentation, outdated technologies, or original developers no longer available.

التعريف

Michael Feathers defines legacy code simply as "code without tests" because without tests, changes are risky. Legacy code often has: unclear architecture, missing documentation, deprecated dependencies, complex interdependencies, and accumulated workarounds. However, legacy code is also valuable — it represents working business logic that has been tested in production.

لماذا هو مهم

Most developers spend more time maintaining legacy code than writing new code. Understanding how to safely modify legacy systems is a critical skill. Techniques include: adding characterization tests, strangler fig pattern, and incremental refactoring.

مثال

A 15-year-old PHP monolith processes millions in transactions daily. It has no tests, uses deprecated libraries, and the original team left. Developers must add tests before making changes to avoid breaking production.

المصطلحات ذات الصلة

legacy codewhat is legacy codelegacy systemworking with legacy code

أتمتة مراجعة الكود مع diffray

نظام ذكاء اصطناعي متعدد الوكلاء لمراجعة الكود. يجد الأخطاء والثغرات الأمنية ومشاكل البنية تلقائياً.