Thursday, July 14, 2005

The powerful unit testing.

The whole idea of unit testing is to ensure that you won't break already-working codes when you refactoring. Address Parsing is a very good example, there are a lot of different situations, and it's very easily that you break some codes when you modify the regular expression rules.

The better way is to put everything into an XML file, and run the parsing through the XML file every time when modifying something. That way, you will always ensure that something already working well won't be broken when regular expression rules are added, modified, or delete.

Another way to learn from JTS, the great library.

No comments: