Best Practices

In this section, we list some practical considerations to keep in mind when testing and debugging applications.

Unit Testing Best Practices

Now that we've seen examples of some of the more popular unit testing tools out there, here are a few tips that enable these tools to yield their maximum benefit:

  • Write unit tests early. Some people even say that the test cases for a class should be written before the class itself. When a component of a system is designed, the desired behavior of the component is encoded into a series of unit tests. The implementation of the component is complete when all the tests run successfully.

  • When writing the tests first isn't possible, extra care should be taken to prevent writing tests that simply make ...

Get BEA WebLogic Server™ 8.1 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.