Working Effectively with Legacy Code Quotes

4,624 ratings, 4.14 average rating, 283 reviews
Working Effectively with Legacy Code Quotes
Showing 1-30 of 40
“Code without tests is bad code. It doesn't matter how well written it is; it doesn't matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don't know if our code is getting better or worse.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Programming is the art of doing one thing at a time”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Legacy code. The phrase strikes disgust in the hearts of programmers. It conjures images of slogging through a murky swamp of tangled undergrowth with leaches beneath and stinging flies above. It conjures odors of murk, slime, stagnancy, and offal. Although our first joy of programming may have been intense, the misery of dealing with legacy code is often sufficient to extinguish that flame.ï»�”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“To me, legacy code is simply code without tests.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Encapsulation is important, but the reason why it is important is more important. Encapsulation helps us reason about our code.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Remember, code is your house, and you have to live in it.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“As the amount of code in a project grows, it gradually surpasses understanding. The amount of time it takes to figure out what to change just keeps increasing.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“How do I test private methods?â€� Many people spend a lot of time trying to figure out how to get around this problem, but, as I mentioned in an earlier chapter, the real answer is that if you have the urge to test a private method, the method shouldn’t be private; if making the method public bothers you, chances are, it is because it is part of a separate responsibility. It should be on another class.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Effective software change, like effective surgery, really involves deeper skills. Working with care doesn’t do much for you if you don’t use the right tools and techniques. Cover”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Big classes can hide too much. This question comes up over and over again from people new to unit testing: “How do I test private methods?â€� Many people spend a lot of time trying to figure out how to get around this problem, but, as I mentioned in an earlier chapter, the real answer is that if you have the urge to test a private method, the method shouldn’t be private; if making the method public bothers you, chances are, it is because it is part of a separate responsibility. It should be on another class.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Encapsulation is a good thing, right? Well, don’t ask testers about that; they are liable to bite your head off. Classes that are too big often hide too much. Encapsulation is great when it helps us reason about our code and when we know that certain things can be changed only under certain circumstances. However, when we encapsulate too much, the stuff inside rots and festers. There isn’t any easy way to sense the effects of change, so people fall back on Edit and Pray (9) programming. At that point, either changes take far too long or the bug count increases. You have to pay for the lack of clarity somehow.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Over time, the system will get better as long as people aren’t introducing duplication behind your back. If they are, you can take steps with them short of physical violence, but that is another issue.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“The most subtle bugs that we can inject are bugs related to inheritance.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“In a well-maintained system, it might take a while to figure out how to make a change, but once you do, the change is usually easy and you feel much more comfortable with the system. In a legacy system, it can take a long time to figure out what to do, and the change is difficult also.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Tests that take too long to run end up not being run.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“In poorly structured code, the move from figuring things out to making changes feels like jumping off a cliff to avoid a tiger. You hesitate and hesitate. "Am I ready to do it? Well, I guess I have to.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“One of the biggest challenges in getting legacy code under test is breaking dependencies.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“A seam is a place where you can alter behavior in your program without editing in that place.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“When you have to make a change in a legacy code base, here is an algorithm you can use. 1. Identify change points. 2. Find test points. 3. Break dependencies. 4. Write tests. 5. Make changes and refactor.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“The Legacy Code Dilemma When we change code, we should have tests in place. To put tests in place, we often have to change code.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Dependency is one of the most critical problems in software development. Much legacy code work involves breaking dependencies so that change can be easier.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“A unit test that takes 1/10th of a second to run is a slow unit test.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Here are qualities of good unit tests: 1. They run fast. 2. They help us localize problems.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Unit testing is one of the most important components in legacy code work. System-level regression tests are great, but small, localized tests are invaluable. They can give you feedback as you develop and allow you to refactor with much more safety.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Changes in a system can be made in two primary ways. I like to call them Edit and Pray and Cover and Modify. Unfortunately, Edit and Pray is pretty much the industry standard.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Preserving existing behavior is one of the largest challenges in software development. Even when we are changing primary features, we often have very large areas of behavior that we have to preserve.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“In general, three different things can change when we do work in a system: structure, functionality, and resource usage.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Programming can be very rewarding and enjoyable work.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code
“legacy code is simply code without tests.”
― Working Effectively with Legacy Code
― Working Effectively with Legacy Code