Skip to content

An example project demonstrating cleaning up legacy code and improving testability

License

Notifications You must be signed in to change notification settings

samitrimal/refactoring-dotnet

 
 

Repository files navigation

refactoring-dotnet

An example project demonstrating cleaning up legacy code in a .NET Core MVC project

This repository was created for the Productive Dev YouTube series on refactoring legacy code (here's the link).

Key concepts

  • Improving testability
  • Inversion of control via dependency injection
  • Message-sending between objects
  • Making smaller things
  • Improving naming
  • Extracting configuration
  • Programming to abstractions instead of implementations
  • Replacing conditional logic with polymorphism
  • Using factory methods
  • Using async / await
  • Using Task.FromResult for non-asynchronous overiddes of Task methods
  • Writing unit and integration tests
  • Monitoring code quality using static code analysis
  • Creating a continuous integration loop

To Follow along via YouTube series

The main branch contains the result of refactoring the legacy code. The legacy_code branch contains the starting point of the project, from where the refactoring begins.

  • Clone the repository
  • Checkout the legacy_code branch
  • Complete the refactor

About

An example project demonstrating cleaning up legacy code and improving testability

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 81.3%
  • HTML 13.3%
  • CSS 4.7%
  • JavaScript 0.7%