Does Stack Overflow have automated tests? If yes, what kind of (unit, integration, etc)? How are they organized and used?
-
While it's true that this question is about Stack Overflow, it's more of a programming-related question using a specific project as an example. You could replace "Stack Overflow" with "phpBB" and the question would still be valid. However, it's not really a suitable question for meta.– Greg HewgillDec 23, 2009 at 19:02
-
7The problem is that it is Stack Overflow related. It would get closed on Stack Overflow because "It's about Stack Overflow". It belongs here.– George StockerDec 23, 2009 at 19:26
3 Answers
Jeff has previously stated that certain aspects of the site's code have unit tests, but not very many. He and Joel aren't unit testing's biggest advocates ;)
-
6You sir win the "understatement of the year" award for the last part.– AnonJrDec 23, 2009 at 19:24
-
When I heard Jeff say on a podcast that they had some unit tests - that made me chuckle. 'Some' are ok as long as they test the parts of the code you care about - i.e. the ones with most 'business value' - but from the podcasts I doubt the team hold much value in unit testing - or maintaining the unit tests they have ... although I could, as ever, be very wrong!– blankDec 23, 2009 at 20:11
-
1
Due to extensive use of IoC containers the code base for Stackoverflow is extremely testable, the bulk of the tests are written in Cobol and Brainf*ck, a smaller yet significant portion is tested using 42 magic 8 balls, which when shaken in harmony produce magnificent and hypnotizing sounds.
This goes without saying, but IMHO.
Individual reusable components are eminently testable. So much so that they are huge wins, and you'd be a fool not to have tons of unit testing wrapped around them.
Thinks like.. say... our c# markdown processor.
However, almost none of the code that most programmers produce on real world, typical projects is actually reusable in any meaningful way. And writing truly reusable code is about two orders of magnitude harder -- even with unit tests -- than writing typical one-off "just get it done" code. It takes many times the amount of effort to produce the same result if you want to build something that is legitimately reusable.
Related: The "Rule of Three"
http://maheshpai.info/?p=20
-
5WTF has unit testing to do with reusable components? Who says that only reusable components are unit-testable? I do not think that everything has to be unit-tested to death, but this argument is pure nonsense. Or maybe I'm missing something here. Dec 28, 2009 at 11:00