https://github.com/productive-dev/refactoring-dotnet
An example project demonstrating cleaning up legacy code and improving testability
https://github.com/productive-dev/refactoring-dotnet
dotnet legacy-code refactoring unit-test unit-testing
Last synced: about 2 months ago
JSON representation
An example project demonstrating cleaning up legacy code and improving testability
- Host: GitHub
- URL: https://github.com/productive-dev/refactoring-dotnet
- Owner: productive-dev
- License: gpl-2.0
- Created: 2020-10-13T17:24:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-24T15:24:51.000Z (over 4 years ago)
- Last Synced: 2024-10-24T02:30:14.722Z (6 months ago)
- Topics: dotnet, legacy-code, refactoring, unit-test, unit-testing
- Language: C#
- Homepage:
- Size: 43.9 KB
- Stars: 18
- Watchers: 3
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://www.youtube.com/watch?v=uj0RWP3DdUo&list=PL3_YUnRN3Uhh8H3Zw2M6KDdP3aAlbfT8j)).
## 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