From ... From: Erik Naggum Subject: Re: Testing approaches Date: 2000/03/14 Message-ID: <3162005254869991@naggum.no>#1/1 X-Deja-AN: 597233704 References: <8a2naf$e4v$1@nnrp1.deja.com> <38C4EE83.AF3BDA64@pindar.com> <8a2t3p$hpv$1@nnrp1.deja.com> <8a32uj$m10$1@nnrp1.deja.com> <8a351o$nff$1@nnrp1.deja.com> <38CCF7CF.71C4@iol.ie> <8aj0sk$t17$1@nnrp1.deja.com> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 953016461 7845 195.0.192.66 (14 Mar 2000 06:47:41 GMT) Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; http://www.naggum.no User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 Mime-Version: 1.0 NNTP-Posting-Date: 14 Mar 2000 06:47:41 GMT Newsgroups: comp.lang.lisp * Ray Blaak | For example, how many kinds of invalid values can you pass to a function? | A string, an atom, a list, a vector, a float, an integer,... If your | function was restricted to integers, say, then you could simply | concentrate on the invalid integer values. (check-type ) takes care of this one for you, or you can use assert or throw your own errors if you really have to. I don't see the problem. writing safe code isn't hard in Common Lisp. | Static typing is dramatically useful in integration tests. A unit test | will not exhaustively exercise other units. Static typing allows units | to fit together without the piles of dumb stupid interface errors, | allowing you to concentrate on the smart stupid logic errors :-). when the compiler stores away the type information, this may be true. when the programmers have to keep them in sync manually, it is false. static typing is like a religion: it has no value outside the community of believers. inside the community of believers, however, it is quite impossible to envision a world where static types do not exist, and they think in terms that restrict their concept of "type" to that which fits the static typing religion. to break out of the static typing faith, you have to realize that there is nothing conceptually different between an object of type t that holds a value you either know or don't know how to deal with, and an object of a very narrow type that holds a value you either know or don't know how to deal with. the issue is really programming pragmatics. static typing buys you exactly nothing over dynamic typing when push comes to shove. yes, it does buy you something _superficially_, but look beneath it, and you find that _nothing_ has actually been gained. the bugs you found are fixed, and the ones you didn't find aren't fixed. the mistakes you made that escaped the testing may differ very slightly in expression, but they are still there. the mistakes you did find may also differ slightly in expression, but they are still gone. what did you gain by believing in static typing? pain and suffering and a grumpy compiler. what did you gain by rejecting this belief and understanding that neither humans nor the real world fits the static typing model? freedom of expression! of course, it comes with a responsibility, but so did the static typing, only the dynamic typing responsibility is not to abuse freedom, while the static typing responsibility is not to abuse the power of restriction. personally, I think this is _actually_ a personality issue. either you want to impose control on your environment and believe in static typing, or you want to understand your environment and embrace whatever it is. #:Erik