Linked by Eugenia Loli-Queru on Fri 13th Jul 2007 06:17 UTC, submitted by IdaAshley
Java The architecture you think you have is often different than what you actually have. It's time to take charge of your architecture and learn how you can discover deviations by writing tests using JUnit, JDepend, and Ant to discover problems proactively instead of long after the fact.
Thread beginning with comment 255216
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: Sounds good...
by rayiner on Fri 13th Jul 2007 13:05 UTC in reply to "Sounds good..."
rayiner
Member since:
2005-07-06

It can be! It's a 20-minute exercise to come up with some macros that let you define unit tests in Lisp code. Moreover, since the compiler fully evaluates top-level calls at compile-time, you can do stuff like:


; trees.lisp

(defun make-tree () ... ) ; make a tree

(defun add-to-tree (something tree) ...) ; add stuff to a tree
; more implementation

; this is a simple macro to write!
(define-unit-test some-test
(add-to-tree 5 (make-tree)))
; need more complete test!

(run-tests) ; run the tests at compile-time


This way, every time you compile the file, the compiler will execute (run-tests), and you'll get a compile-time error if your change broke any of the unit tests.

Edited 2007-07-13 13:07

Reply Parent Bookmark Score: 2