top | item 3541317

Pinterest = No Unit Tests

26 points| mukaiji | 14 years ago | reply

One of the Pinterest engineer admitted at a tech talk that they have no unit tests. Instead, they only test stuff by "clicking buttons in the browser." For a site of that size, I was a bit surprised. How common of a practice (not having tests) is it for large sites?

13 comments

order
[+] mike-cardwell|14 years ago|reply
My feeling and experience tells me that the vast vast majority of websites have no unit tests. I suspect a lot more than 99% of them.
[+] AznHisoka|14 years ago|reply
Yep. Also Pinterest really isn't that complex an application. Clicking on buttons and trying scenarios out is probably good enough (given the time they have available). The major hiccups like server slowdowns, or concurrency issues, or too much memory being used for a request are hard to unit test anyway, and those are the real potential issues they face.
[+] bradfordw|14 years ago|reply
You don't get big by writing a lot of tests (or checks). You get big by getting stuff done with competent people that pay attention to the changes they apply. YMMV
[+] ndunn2|14 years ago|reply
When you reach a certain size, no amount of due diligence on your part can ensure that your changes aren't going to break something in some other part of the code base without automated tests. Do you think Google or Amazon gets by without unit tests?
[+] bradhe|14 years ago|reply
I have a very heavy handed approach to testing because I fuck up the details a lot. Testing keeps me from doing so by actively forcing me to look at the details. I make up for time "lost" writing tests by A) writing code just plain faster than my peers and B) in the time I save on regressions later.

I think every person and team is different so no one model or ethos to testing will fit generically. Pinterest is doing well enough. If they don't need to automate, so be it. When they bring on some more engineers, the dynamic will change so maybe they'll need more automation then.

[+] sixQuarks|14 years ago|reply
Sorry for my ignorance, but can someone explain in simple terms what a unit test is?
[+] mukaiji|14 years ago|reply
A unit test is a way to automate the diagnosis of your website. For example, let's say your website allows people to create a user profile. You could (A), verify that you can successfully create a profile by opening your web browser, navigating to your site, creating a profile, and making sure you get a successful response. That's fine and relatively quick to do. However, as your code base grows in size, you don't want to have to redo this test manually every time you add a new feature that could potentially break your user-profile feature. Thus, and (B), comes in unit testing (or integration tests, or simply tests), that automates the process for you. Every time you add a new feature, you can run tests to verify that this new feature didn't break something else in your code base.