What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

Does Stack Overflow have automated tests? If yes, what kind of (unit, integration, etc)? How are they organized and used?

share|improve this question
    
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 Hewgill Dec 23 '09 at 19:02
7  
The 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 Stocker Dec 23 '09 at 19:26

3 Answers 3

up vote 7 down vote accepted

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 ;)

share|improve this answer
6  
You sir win the "understatement of the year" award for the last part. –  AnonJr Dec 23 '09 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! –  blank Dec 23 '09 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.

share|improve this answer

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

share|improve this answer
5  
WTF 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. –  Ladybug Killer Dec 28 '09 at 11:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .