Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The best way to improve a system like this is to slowly make it better. If your system is anything like the systems I've worked on, changing the code often leads to bugs. Automated tests are a way to reduce the chance of introducing new bugs, but often the code wasn't written with testing in mind, and changing the code to make it easier to write tests can lead to bugs.</p> <p>The way around this problem is to introduce some automated integration tests, and use those tests as a safety net as you carefully refactor the code and introduce tests at a lower level. Making code more testable often results in introducing interfaces and abstractions that make the code easier to work with. It also often requires separating business logic from presentation logic (since testing both together is painful) and breaking out our code into modules (since classes with many dependencies can be hard to test).</p> <p>When you write new code for your system, try to write unit tests while you write the code. This is much easier (and therefore less frustrating) than writing tests for legacy code, and gives you a chance to see where you might go when you refactor your legacy code.</p> <p>I know of two excellent bugs on this subject: <a href="http://rads.stackoverflow.com/amzn/click/0131177052" rel="nofollow noreferrer">Working Effectively with Legacy Code</a> by Robert C. Martin and <a href="http://rads.stackoverflow.com/amzn/click/0321213351" rel="nofollow noreferrer">Refactoring to Patterns</a> by by Joshua Kerievsky.</p> <p>Finally, consider using a dependency injection framework, like Spring or Guice. Dependency injection makes it easier to make your code testable with unit tests. It also makes it easier to follow good design practices like the <a href="http://www.objectmentor.com/resources/articles/dip.pdf" rel="nofollow noreferrer">Dependency Inversion Principle</a> and the <a href="http://www.objectmentor.com/resources/articles/isp.pdf" rel="nofollow noreferrer">Interface Segregation Principle</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload