Skip to content

Python Refactoring Legacy Code

About

  • Level: Intermediate to Advanced
  • Lectures: 20 hours
  • Self-study: 10 hours
  • Exercises: 22
  • Lines of Code to write: 118
  • Format: e-learning + weekly online teleconference with instructor
  • Language: English or Polish

Description

This practical, hands-on course teaches strategies and techniques for analyzing, refactoring, and modernizing legacy Python codebases. Following the syllabus, students learn to identify problematic areas, use static and dynamic analysis tools, create diagrams and documentation, and introduce tests into previously untested code. Labs focus on safe refactorings such as extracting functions and classes, reducing complexity and duplication, incrementally applying design patterns, and updating dependencies and language features through guided exercises and a practical project.

Advantages

Participants will reduce risk when changing legacy systems by learning disciplined refactoring workflows, test-introduction patterns, and CI-driven validation. The course improves maintainability and code quality, shortens debugging and onboarding time via better documentation and visualization, and equips engineers with practical tools and patterns to modernize codebases and migrate safely to newer Python versions.

Target Audience

  • Experienced Python developers and maintainers working with legacy code who need practical refactoring strategies.
  • Engineers responsible for maintaining long-lived codebases who must add tests and documentation to reduce regression risk.
  • Software architects and technical leads planning modernization and dependency upgrades while minimizing disruption.
  • QA engineers and test authors who will design tests for hard-to-reach areas of legacy systems.
  • DevOps and release engineers integrating refactoring work into CI/CD pipelines and release management.
  • Advanced students and developers who want hands-on experience improving and modernizing real-world Python projects.

Format

The course is delivered as a blended learning experience, comprising numerous short videos that progressively introduce concepts and techniques through a series of practical examples. The course format combines e-learning modules with weekly online teleconferences with the instructor for Q&A, discussions, and code reviews.

During the self-study phase, students complete practical exercises that apply the learned techniques. Each exercise is designed to have 100% test coverage, allowing students to verify their solutions. Additionally, students will have access to a spreadsheet to track their progress.

Students will also receive downloadable resources, including code samples, exercise templates, and reference materials to support their learning journey. Since 2015, we have refined our materials based on student feedback to ensure clarity, engagement, and practical relevance. All code listings undergo automatic testing (over 28,000 tests) to ensure accuracy and reliability. All materials, code listings, exercises, and assignments are handcrafted by our trainers without the use of AI. All case studies and examples are based on real-world scenarios drawn from our extensive experience in software engineering.

Working language of the course is either English or Polish.

Course Outline

  1. Introduction to Working with Legacy Code:

    • Definition and characteristics of legacy code
    • Common challenges and issues
    • Strategies for working with legacy code
  2. Code Analysis and Documentation:

    • Tools for static and dynamic analysis
    • Creating diagrams and visualizing code
    • Documenting existing code
  3. Code Refactoring:

    • Identifying problematic areas
    • Refactoring techniques: extracting functions, reducing complexity, eliminating duplication
    • Introducing design patterns into legacy code
  4. Testing Legacy Code:

    • Introducing tests to untested code
    • Creating unit and integration tests
    • Tools for test coverage
  5. Code Modernization:

    • Updating dependencies and libraries
    • Migrating to newer Python versions
    • Using modern Python language features
  6. Tools Supporting Work with Legacy Code:

    • Linters and static analyzers
    • Tools for visualizing code architecture
    • Version control systems and their use in working with legacy code
    • CI/CD systems and automation of test execution
    • Code review process
  7. Practical Project:

    • Analysis, refactoring, and modernization of a legacy code segment
    • Introducing tests and documentation
    • Retrospective and discussion of results

Our Experience

AATC trainers have been teaching software engineering since 2015. We have already delivered over 11,000 (eleven thousand) hours of software engineering training to more than 32,000 (thirty-two thousand) students worldwide.

Requirements

  • Intermediate knowledge of Python programming
  • Familiarity with using an IDE (e.g., PyCharm, VSCode)
  • Familiarity with using version control systems (e.g., Git)
  • Understanding of AI-assisted coding tools (e.g., GitHub Copilot, ChatGPT)

Setup

  • Newest version of Python
  • IDE of your choice (e.g., PyCharm, VSCode)
  • Git installed and configured
  • GitHub account
  • Web browser (e.g., Chrome, Firefox, Safari, etc.)

Apply

If you are interested in taking this course, please contact us at info@astronaut.center