After accessing the program, I often see refactoring. Because I cannot use it, I am not familiar with it. Today I saw refactoring and testing in the course of reading a book, this is the case for Baidu on the Internet. Now let's take a look at our own understanding. refactoring is to add or modify the program code to improve the quality and performance of the program code and make the program design mode and architecture more reasonable, improve software scalability and maintainability.
Why should we rebuild the program? As the society advances, the program may not meet the original needs and need to add features. This may violate the original design architecture and may lead to bugs and performance defects, at this time, we need to do one thing, refactoring. If the refactoring cannot satisfy this program, we may have to rewrite it.
The purpose of refactoring is to improve the software design to make it easier to understand, locate bugs, and improve the software development speed.
Unit Testing, also known as module testing, is usually performed by programmers on their own modules during the programming stage to check whether the modules have implemented the specified functions and algorithms, unit testing mainly finds errors in programming and detailed design. The unit test plan should be formulated at the detailed design stage.
Refactoring and unit testing