1 / 6

Refactoring

Refactoring. What is Refactoring? Martin Fowler’s Definition. Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure

nancy
Download Presentation

Refactoring

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Refactoring

  2. What is Refactoring? Martin Fowler’s Definition • Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure • When you refactoryou are improving the design of the code after it has been written

  3. What sorts of actions occur during refactoring? • Break functions into smaller subfunctions. • Re-design class and class hierarchies • Rename variables and functions • Remove common cut/pasted code

  4. Why Refactor? • If it works, don’t fix it. Right? • Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -Martin Fowler • Code “Rots” • Original design does not anticipate needed modifications • What seems like a good design at first, proves not to be during implementation.

  5. Why Refactor? (continued) • Refactoring improves the design of software • Refactoring makes software easier to understand • Refactoring helps you find bugs • Refactoring helps you program faster

  6. When do you refactor? • Refactor when you add function • Refactor when you need to fix a bug • Refactor when you do a code review

More Related