Working Effectively with Legacy Code
Rate it:
Open Preview
6%
Flag icon
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.
Rajesh liked this
6%
Flag icon
Here are qualities of good unit tests: 1. They run fast. 2. They help us localize problems.
6%
Flag icon
A unit test that takes 1/10th of a second to run is a slow unit test.
6%
Flag icon
Unit tests run fast. If they don’t run fast, they aren’t unit tests. Other kinds of tests often masquerade as unit tests. A test is not a unit test if: 1. It talks to a database. 2. It communicates across a network. 3. It touches the file system. 4. You have to do special things to your environment (such as editing configuration files) to run it. Tests that do these things aren’t bad. Often they are worth writing, and you generally will write them in unit test harnesses. However, it is important to be able to separate them from true unit tests so that you can keep a set of tests that you can ...more
7%
Flag icon
Dependency is one of the most critical problems in software development. Much legacy code work involves breaking dependencies so that change can be easier.