News for hackers. Stuff that matters.
Re:Is the development of automated tests a waste of time for... by tx on Wednesday June 13, 2007 @04:53PM (#27884)
Without automatic testing dynamic languages are not very productive because they do not catch type mismatch errors during compilation time (there isn't one). With statically typed languages you get a lot of tiny issues taken care of once you hit magic "compile" button and compiler does some basic sanity checks.

Without solid unit tests backing you, activities like removing "obsolete" methods or renaming classes/modules turn into nightmare with duck typed languages.

Re:Is the development of automated tests a waste of time for... by SwellJoe on Wednesday June 13, 2007 @09:55PM (#27970)
"Without automatic testing dynamic languages are not very productive because they do not catch type mismatch errors during compilation time (there isn't one). With statically typed languages you get a lot of tiny issues taken care of once you hit magic "compile" button and compiler does some basic sanity checks."

You're just exhibiting a basic dislike of dynamic languages. Type mismatch errors are mostly orthogonal to testing.

"Without solid unit tests backing you, activities like removing "obsolete" methods or renaming classes/modules turn into nightmare with duck typed languages."

This is a nightmare regardless of typing. If you remove a method that is still used somewhere, you've broken something, and you may not spot it until after it ships to customers. It doesn't matter whether you have type checks or not. A compiled language that links in those classes and methods at compile time does resolve this issue, but it's not related to types (and you have to wait on the bloody thing to compile every time you change one character in the file). Testing does resolve this problem--but it's not a problem specific to dynamic languages.

If you get a warm fuzzy feeling from type checking from your compiler, then by all means, enjoy it. But there are tools for most mature dynamic languages (Perl and Python for example) that will do that checking without having to write tests manually. But, having never found type errors to be a problem in my Perl or Python code, I've never used them. Some problem sets are more prone to type mismatch bugs than others, and I guess my areas of interest are among the ones that are rarely effected.

Re:Is the development of automated tests a waste of time for... by weel on Saturday June 16, 2007 @11:15AM (#28547)
You say that type mismatch errors are orthogonal to testing. This may be the case in languages like Java, which has a strong but not very expressive type system. In strongly typed functional programming languages like ML and Haskell, though, you can, with a bit of good design, capture a lot of information about what you want your program to do in the type system, to be checked automatically. Take, for example, the comment on this page by somebody who says that the only testing s/he does is XHTML validation. With strongly typed functional programming, it is possible, and not really even all that hard, to write an embedded combinator library for XHTML such that programs that generate improper XHTML don't type check in the first place.
Re:Is the development of automated tests a waste of time for... by jey on Wednesday June 13, 2007 @11:19PM (#27991)
A compiled language that links in those classes and methods at compile time does resolve this issue, but it's not related to types (and you have to wait on the bloody thing to compile every time you change one character in the file).

How is it not related to the compile-time name resolution and type checking? In a compiled typed language, you would get a compile or link error if the symbol is not found. I regularly write and refactor C++ by inducing compile or link errors to identify the spots in the code where a specific method is called from.

Re:Is the development of automated tests a waste of time for... by SwellJoe on Thursday June 14, 2007 @05:00AM (#28041)
"How is it not related to the compile-time name resolution and type checking?"

Please re-read, carefully. I said that compiled and strongly typed are two orthogonal language characteristics, and that each of those characteristics solves one set of problems (while introducing some of its own).

I specifically said exactly what you've said about compiled languages identifying missing methods. But it's not because it is a strongly typed language, it's because it is compiled.

What's so bad about having a little clarity in our use of terms and concepts?

Re:Is the development of automated tests a waste of time for... by machine on Thursday June 14, 2007 @01:54PM (#28149)
A bit of semantics: what we are talking about here is the difference between statically typed and dynamically typed languages, not strongly and weakly typed. Python is strongly dynamically typed. Java is strongly statically typed. C is (arguably) weakly statically typed (because it let's you treat anything as anything through casts, void pointers, etc).

The point jey was trying to make is that only languages that are both statically typed and compiled can catch missing methods. Consider for example a piece of code:

a.doB();

If the language is not statically typed, then the compiler does not know the type of "a" at compile time, and therefore doesn't know what class to check for method "doB". This is why even if you were to compile python you would still end up getting missing method error messages occasionally.

Re:Is the development of automated tests a waste of time for... by richcollins on Wednesday June 13, 2007 @05:08PM (#27888)
We didn't write tests for our last startup and we never had too many problems with bugs.

We do write tests for this one and we don't have too many problems with bugs.

Tests take almost as much time to develop as the features do. I just wonder if it is worth the time and if other people with startups write automated tests.

Re:Is the development of automated tests a waste of time for... by jimbokun on Thursday June 14, 2007 @12:08AM (#28000)
Wil Shipley on unit tests:

http://wilshipley.com/blog/2005/09/unit-testing-is-teh-suck-urr.html

I think what he's saying is unit tests don't add much if you are doing UI type development. It is hard to write unit tests for UIs (web or GUI), so if most of your code is UI code, don't bother.

However, if you are writing a library that will be used by a lot of coders, unit tests are probably indispensable. Otherwise, you would never be able to make even simple architecture or design changes (refactoring).

Re:Is the development of automated tests a waste of time for... by tx on Wednesday June 13, 2007 @07:23PM (#27934)
No difference? That's pretty impressive. I wish I was able to look at your process. Either your engineers are extremely smart and anal about their practicies or your domain is very simplistic (ta-da lists).

At my previous start up we had unit tests run on the entire system automatically after every check-in (with CruiseControl) and whenever someone broke a test suite, everybody got an email with name of the offender and diffs of his code against the trunk.

We also had a "beer rule" about violatros gettings drinks for everyone, to make the process a bit more exciting.

Re:Is the development of automated tests a waste of time for... by richcollins on Wednesday June 13, 2007 @08:17PM (#27940)
Facebook doesn't have an automated test suite. I wouldn't call that a simplistic app.
Re:Is the development of automated tests a waste of time for... by immad on Thursday June 14, 2007 @10:18AM (#28080)
really?! I would be shocked if they dont have at least automated testing on their most critical systems. Whats the source of that info?
Re:Is the development of automated tests a waste of time for... by richcollins on Thursday June 14, 2007 @01:45PM (#28144)
we asked Mark Zuckerberg at Startup School
Re:Is the development of automated tests a waste of time for... by jsjenkins168 on Wednesday June 13, 2007 @05:15PM (#27895)
I'd say try to plan for how much you will need to scale your code, and also how many others will be working on your code.

As your code gets larger, and as you start to have others working on it (who could break it), unit tests become more important. If you dont foresee either of these happening, then the time investment for tests may not be worth it..