Uncovering the Secret to Refactoring Legacy Code!

Опубликовано: 26 Апрель 2023
на канале: Foad Alavi
577
25

The secrets of refactoring a legacy code, which has no unit test by generating unit tests automatically add having 100% unit test coverage. You will learn how snapshot testing, mutation testing, and unit testing will help you refactor a C#legacy code.

Buy me a coffee: https://buymeacoffee.com/foadalavix
Patreon:   / foadalaviyoutube  

⏱️⏱️VIDEO CHAPTERS⏱️⏱️
00:00 - Intro
01:56 - 100% coverage using snapshot Testing
12:32 - Mutation testing to test our unit test
17:00 - Start Refactoring- Lifting up conditions
38:06 - Single Responsibility principle
52:19 - Verify testing

🔔 Subscribe for more tips just like this: https://www.youtube.com/@Foad_Alavi?s...

More Description:
The video is about how to refactor legacy code without affecting existing functionality. The speaker discusses an example of code, which lacks unit tests and has a method that needs to be refactored. The speaker emphasizes the importance of having a fully covered code before refactoring. They introduce the concept of snapshot testing, where they use the library called Verify to create a snapshot of the test result. The speaker demonstrates how to use Verify to generate data for all conditions of the method, using nested loops to create all possible combinations of values that the method accepts. The goal is to generate unit test coverage of 100% for the code.

GitHub Repo: https://github.com/foadalavi/Test-Fou...

All About Testing Playlist:    • All About Testing  

#csharp #testing #refactoring