We may earn an affiliate commission when you visit our partners.
Younes Charfaoui

Master The Art of Refactoring Messy Codebases Into a Software Masterpiece and Become the go-to expert for codebase transformations by learning to take messy code as an opportunity to innovate and grow.

But what is legacy code in the first place?

Read more

Master The Art of Refactoring Messy Codebases Into a Software Masterpiece and Become the go-to expert for codebase transformations by learning to take messy code as an opportunity to innovate and grow.

But what is legacy code in the first place?

Legacy code refers to software code or applications that were created in the past and have been in use for a significant period. However, such code often poses challenges because it may be outdated, poorly documented, or not aligned with current coding standards and best practices. These challenges can make it difficult to maintain, update, or extend the software, thereby causing potential problems for developers to refactor to make it easy for future work.

In his Amazing book Working Effectively With Legacy Code, According to Michael Feathers, Legacy Code refers to any code that lacks automated tests: To me, legacy code is simply code without tests.

In this course, we will explore practical ways of dealing with legacy codebases. Our approach covers everything from automated tests to detailed techniques for making codebases flexible and enjoyable to work with.

By the end of the course...

  • You'll spot refactoring signals.

  • You'll be able to cover legacy code with tests.

  • You'll master refactoring principles and best practices.

  • You'll master techniques to improve the test coverage.

  • You'll identify common code smells and anti-patterns.

  • You'll confidently tackle complex legacy codebases.

Before You BUY This Course

If you're new to the world of code refactoring and looking for an affordable starting point, we recommend diving into specific books on the subject. Books (less than 60$) such as Refactoring or Working Effectively with Legacy Code provide a cost-effective way to build a strong foundation in refactoring principles, allowing you to learn at your own pace.

Once you're ready to put your knowledge into action on real legacy code, our comprehensive course guides you through practical application and advanced techniques, ensuring you're fully equipped to tackle complex code bases confidently.

What's the Use case?

In this course, we will refactor a codebase that calculates prayer times provided by Prayer Times Organization. We will address the challenges posed by outdated technologies, inadequate code organization, and the need to improve code readability.

With clear objectives in mind, we'll break down the refactoring process into manageable steps, including:

  • Code analysis.

  • Test setup.

  • Modularization.

  • Extracting meaningful abstraction.

  • Reducing the clutter.

  • Emphasizing best practices.

  • And much more.

The use case presents a good enough complex code to showcase the difficulties you can face when refactoring a real project. By the end of the course, you'll be well-prepared to take on real-world refactoring projects with confidence and expertise.

You can check the preview up in a video for a full explanation of the domain problem, so if that excites you, join now, and let us refactor a messy codebase.

Language Agnostic

This course is designed to be language-agnostic, meaning you can acquire essential principles and techniques that apply universally across various codebases in different programming languages.

While our use cases in the course choose Kotlin, you can still find on the domain problem website other versions that apply to Java, Python, C#, C++, and PHP; the skills and insights you gain are easily transferable to any other language.

We emphasize Kotlin to provide a practical learning experience, but the knowledge you acquire will empower you to excel in legacy code refactoring, regardless of your chosen programming language.

Enroll now

What's inside

Learning objectives

  • Learn how to spot refactoring signals.
  • Learn techniques to improve the test coverage.
  • Master refactoring principles and best practices.
  • You'll confidently tackle complex legacy codebases.

Syllabus

Introduction
Course Introduction
Domain Problem
Extra Resources
Read more
Testing
Project Setup
Test Coverage
Parametrized Tests
Complete Code Coverage
Test Cleaning
Mutation Testing
1st Round of Refactoring: The Fundamentals
Kotlin Conversion
Why Refactoring?
Declutter
Top Level Functions
Primitive Obsession
Depending on Abstractions
Function Splitting
Capturing Logic
Helping Other Devs
Action to Calculation
Public API
Pair Programming
2nd Round of Refactoring: Overengineering
Extracting The Responsibility of Formatting
Simplifying Format Utils
Refactoring The Core Logic
Refactoring The Core Logic 2
Refactoring The Core Logic 3
Refactoring The Core Logic 4
Scratch Refactoring
Conclusion & Feedback
Wrap-up

Save this course

Save Refactoring Legacy Code like a Pro: a Use Case. to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Refactoring Legacy Code like a Pro: a Use Case. with these activities:
Read 'Working Effectively with Legacy Code'
Solidify your understanding of legacy code challenges and solutions. This book provides a comprehensive guide to the principles and practices covered in the course.
View Brutal Refactoring on Amazon
Show steps
  • Obtain a copy of 'Working Effectively with Legacy Code'.
  • Read the book, focusing on chapters related to testing and refactoring techniques.
  • Take notes on key concepts and strategies.
  • Relate the book's content to the course's use case and examples.
Practice Writing Unit Tests
Sharpen your unit testing skills before diving into legacy code. Writing effective tests is crucial for safely refactoring and improving code quality.
Browse courses on Unit Testing
Show steps
  • Choose a language and testing framework (e.g., JUnit for Java, pytest for Python, or KotlinTest for Kotlin).
  • Write unit tests for simple functions or classes.
  • Practice writing different types of tests (e.g., boundary tests, error handling tests).
  • Review testing best practices and principles.
Create a Test Suite for an Open-Source Project
Apply your testing and refactoring skills to a real-world project. This will give you hands-on experience with legacy code and the challenges it presents.
Show steps
  • Find an open-source project with limited test coverage.
  • Analyze the codebase and identify areas that need testing.
  • Write unit tests to improve the project's test coverage.
  • Submit your tests as a pull request to the project.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Refactor Code Smells
Hone your ability to identify and refactor common code smells. This will improve your code quality and make it easier to maintain.
Show steps
  • Find code examples with common code smells (e.g., long methods, duplicated code, large classes).
  • Refactor the code to remove the code smells.
  • Compare the original code with the refactored code.
  • Ensure that the refactored code is more readable and maintainable.
Document Refactoring Steps
Reinforce your understanding by documenting the refactoring process. This will help you internalize the steps and principles involved.
Show steps
  • Choose a refactoring technique covered in the course.
  • Find a code example that can be refactored using that technique.
  • Document the steps involved in refactoring the code.
  • Explain the benefits of the refactoring.
Read 'Refactoring: Improving the Design of Existing Code'
Deepen your knowledge of refactoring techniques and patterns. This book provides a comprehensive catalog of refactorings with detailed explanations and examples.
View Melania on Amazon
Show steps
  • Obtain a copy of 'Refactoring: Improving the Design of Existing Code'.
  • Read the book, focusing on the refactorings that are most relevant to your work.
  • Practice applying the refactorings to your own code.
  • Compare your results with the examples in the book.
Help Others Refactor
Solidify your understanding by helping others with their refactoring challenges. Teaching is a great way to learn.
Show steps
  • Offer to help colleagues or friends with their refactoring projects.
  • Provide guidance and support as they work through the refactoring process.
  • Share your knowledge and experience with them.
  • Answer their questions and address their concerns.

Career center

Learners who complete Refactoring Legacy Code like a Pro: a Use Case. will develop knowledge and skills that may be useful to these careers:

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Refactoring Legacy Code like a Pro: a Use Case..
Cornerstone resource for anyone tackling legacy code. It provides practical strategies for understanding, testing, and refactoring codebases without tests. Feathers' definition of legacy code as 'code without tests' is central to the course's philosophy, making this book essential for building a solid foundation in refactoring.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser