Google Testing Blog

googletesting.blogspot.com · Company blog · on HN since 2008

Google engineers write about software testing practice, including flaky tests, testable code, code coverage, and end-to-end tests.

What HN saysCommenters recommend it for practical testing techniques, especially Misko Hevery's posts on writing testable Java code, and point to Google's test-heavy engineering culture.
79HN people shared it
26linked it in comments
73stories submitted
555story points
5 years agolast shared
2008people per year2026

Most-shared posts

  1. 1
    Just Say No to More End-To-End Tests
    6 people · 17 points · first shared 2015 · 2 comments on HN
  2. 2
    Homepage
    5 people · first shared 2009
  3. 3
  4. 4
    Code coverage goal: 80% and no less
    3 people · 5 points · first shared 2010 · discussion on HN
  5. 5
    How to write untestable code
    2 people · 76 points · first shared 2009 · 29 comments on HN
  6. 6
  7. 7
    Writing Testable Code
    2 people · 21 points · first shared 2008 · 8 comments on HN
  8. 8
    Why Are There So Many C++ Testing Frameworks?
    2 people · 10 points · first shared 2012 · 4 comments on HN
  9. 9
    How Google Tests Software
    2 people · 6 points · first shared 2011 · discussion on HN
  10. 10
    RPF: Google's Record Playback Framework
    2 people · 3 points · first shared 2011 · discussion on HN
  11. 11
    Pretotyping: A Different Type of Testing
    2 people · 3 points · first shared 2011 · discussion on HN
  12. 12
    Google launches browser based testing envrioment
    2 people · 3 points · first shared 2011 · 1 comments on HN
  13. 13
    Static Methods are Death to Testability
    2 people · 2 points · first shared 2008 · discussion on HN
  14. 14
    How Google Tests Software - Part Two
    2 people · 2 points · first shared 2011 · discussion on HN
  15. 15
    This Code is CRAP
    2 people · 2 points · first shared 2011 · discussion on HN

What HN people wrote when they linked it

jrvarela56 · 2014-09-18
Follow http://googletesting.blogspot.com/ for weekly posts about specific testing techniques.
lazydon · 2013-03-07
Tangential: OP reminded me of Google Testing Blog [1]. Misko Hevery used to share lots of great insights there. Awesome yet practical stuff on coding in Java world, which anybody will greatly benefit from but not many are aware of. I hope more people read his stuff. I wish he stayed a bit longer before moving on to the AngularJS project - Java needed him more than the script. Another Google Testing Blog star was James Whittaker, who's now moved on to Microsoft. Google Testing Blog doesn’t seems the same exciting place any more. And to add to that the crazy new design of blogspot - some stuff keeps happening on the page that's beyond one's control. [1] http://googletesting.blogspot.com/
pyeek · 2013-02-12
I think there is an aspect to this article that won't be understood unless you're really part of the Python community. For a while now, one of Python's selling points to users from other languages has been "you don't need to write all that code" (most likely directed at Java), more specifically you can simply use a function rather than having to define a class just to define static methods etc. Over time, this has grown into the mantra of "You don't need a class just use a function/module". A lot of people seem to follow this viewpoint blindly, so much so that they consider it to be "Pythonic"; the way you "should" write python. I think Armin's post is somewhat in line with the following post from the google testing blog. http://googletesting.blogspot.com/2008/12/static-methods-are-death-to-…
bad_user · 2012-09-14
For me it's very common to defer error handling. For instance I'm logging most runtime errors and later I receive a nice report over email. I then click on the links provided and I get nice call-stack traces. I then go and fix those errors. And while it would have been better to treat those errors in the first place, we do know that's not possible and trying to force the developers only leads to code such as ... try { ... } catch(Exception ex) {} Checkout this piece on checked exception, also by a Google employee: http://googletesting.blogspot.ro/2009/09/checked-exceptions-i-love-you…
adambyrtek · 2010-10-21
Google is extremely test-oriented, every project is covered by a test suite and there is a powerful distributed continuous integration infrastructure in place that executes tests "in the cloud" and doesn't allow to commit code that doesn't pass. Not to forget about the public Google Testing Blog[1] and the famous Testing on the Toilet[2]. People in the Ruby community also use temporary puts/logging statements for exploratory debugging, but of course nobody in right mind commits such code to the repository. [1] http://googletesting.blogspot.com/ [2] http://googletesting.blogspot.com/2007/01/introducing-testing-on-toile…
jmathes · 2009-02-10
I work at IMVU as well, know the author personally, and can tell you that yes, he unit tests too. In fact, like all of us, writes all code test-first. For test strategy in general, you need a whole seminar. There's a good blog on testing over at http://googletesting.blogspot.com/ <- go there! As for code:test ratio, I'm not sure what metric you want, but using just php files, there are ~1k active test files and ~7k php files total. So if you take into account that 1k of that 7k is the test, and some is test-setup and obsolete files we no longer use, it's maybe about 5:1 code:test. However, a lot of the code is third party OS software packages. In-house code is about 1.5:1 test:code, in my experience. These, by the way, are very rough estimates.
anthonyrubin · 2009-02-04
The Google Testing Blog can be helpful: http://googletesting.blogspot.com/
dgacmu · 2015-12-11
I think we must be misunderstanding each other. Developers are human. (At least, I think we are.) We respond to the incentives and structure of the environment in which we're developing. A culture of "throw crap over the wall to QA" naturally creates an incentive for quickly writing up features, without balancing that with robustness, because finding the problems "is QA's fault". A culture of "the devs are responsible for the quality of their code" produces better code. The way to treat the devs well is to have the QA folks go off and create or bring in easy-to-use automated testing and CI frameworks, to make it easy for the devs to do the right thing. This is not a new observation - it's been happening over the last 10 years. see, for example, http://blogs.forrester.com/mike_gualtieri/11-02-17-want_better_quality… or http://product.hubspot.com/blog/the-classic-qa-team-is-obsolete and, while it's from 2007, http://googletesting.blogspot.com/2007/03/difference-between-qa-qc-and…
Smerity · 2011-01-23
I was spoiled as my internship January last year with Google was my first introduction to the world of corporate IT. Google as a culture really encourages engineers to follow best practices - "Testing on the Toilet"[1] was always a highlight. As you say, the emphasis on unit tests is amazing and something not found in a lot of professional companies. When you tell someone you haven't committed your code yet because you're writing unit tests they don't tell you to hurry - it's not considered something you can rush. Additionally some of the research that has come out of Google Research [2] is stunning and I suggest if people are interested they can keep tabs on new publications via their feed [3]. A lot of their tools and products really are pushing the boundaries of the field they're in, both in complexity and scale, so the "reports from the front line" offer a unique insight. [1] - http://googletesting.blogspot.com/2008/08/tott-100-and-counting.html [2] - http://research.google.com/pubs/papers.html [3] - http://research.google.com/pubs/atom.xml
crdoconnor · 2016-05-30
Plenty of people talk about it: http://googletesting.blogspot.co.uk/2015/04/just-say-no-to-more-end-to… The dirty little secret that nobody talks about is the cause of the ghosts: poorly engineered tests.
clay_to_n · 2016-03-28
Here's an article from Google on their move away from more end to end and integration tests, and towards more unit tests. I think it justifies it pretty well: http://googletesting.blogspot.com/2015/04/just-say-no-to-more-end-to-e…
pakled_engineer · 2015-09-14
I have zero native development experience on any mobile platform and write apps abstracted away in Scheme https://github.com/part-cw/lambdanative/wiki/Getting-Started After you write/run a lot of tests to make sure the app does what it's supposed to (there's paid services for this kind of testing too) http://googletesting.blogspot.ca/2013/08/how-google-team-tests-mobile-… This React abstraction can use Chrome Developer Tools for debugging though, that's pretty awesome.
eitally · 2014-12-12
I wonder if you'd be more or less impressed by the back of bathroom stall door postings by the QA team, "Testing on the Toilet." http://googletesting.blogspot.com/2007/01/introducing-testing-on-toile…
loumf · 2014-05-21
I liked the ideas behind CRAP (http://googletesting.blogspot.com/2011/02/this-code-is-crap.html) -- basically it combines Coverage with Complexity and highlights code that is both complex and has low test coverage. It's kind of hard to game -- reducing CRAP is easiest with a test or refactoring. On the last team I was on, we kept an eye on it, but didn't do anything systematic.
willvarfar · 2014-04-28
So DHH is in favour of integration tests and distrusts mocking. Google is in favour of integration tests and distrusts mocking. http://googletesting.blogspot.se/2013/05/testing-on-toilet-dont-overus… What's to be said for TDD and mocking?
jaredmcateer · 2013-03-19
More interestingly he actually went back to Microsoft. http://googletesting.blogspot.ca/2009/06/james-whittaker-joins-google.…
gandalfar · 2012-12-08
joelhooks · 2012-04-11
I've always enjoyed Testivus on test coverage metrics[1] [1] http://googletesting.blogspot.com/2010/07/code-coverage-goal-80-and-no…
hswolff · 2012-03-13
latch · 2011-09-26
Google has posted warning signs to look out for in code (1). One of them is very similar: Suspicious names: context, environment, principal, container, or manager (all of the things google mentions, are things I've seen much, much more in Java codebase than anywhere else) (1) http://googletesting.blogspot.com/2008/11/guide-to-writing-testable-co…
bochi · 2011-07-09
I built this Nose plugin inspired by Google's CI system: http://googletesting.blogspot.com/2011/06/testing-at-speed-and-scale-o… Hope it's useful.
bedobi · 2021-07-27
I'm irrationally passionate about testing. Shameless plug: (rendered version at https://gist.github.com/androidfred/501d276c7dc26a5db09e893bb7c9f3ee) # Test your tests ## Summary: test interfaces, not implementations Tests that pass when something is actually broken, and fail when things actually do work, are worse than useless- they are positively harmful. ## The requirement Let's say we've been tasked with returning `400` when `GET` `/users/<userId>` is called with a negative `userId`. ## The test The requirement can be turned into a test that hits the endpoint with a negative `userId` and checks that a `400` is returned: ```java @Test public void getUser_InvalidUserId_400() { expect().statusCode(400).when().get("/users/-1"); } ``` ## Implementation A ubiquitous style of implementation may look something like this: (ignore whether you like the style of implementation or not, it's just an example) ```java public class UserResource { @Inject private UserService userService; @GET @Path("/users/{userId}") public Response getUser(@PathParam("userId") final Long userId) { try { return Response.ok(userService.findById(userId)).build(); } catch (final UserException e) { return Response.status(e.getErrorCode()).build(); } } } ``` ```java public UserService { @Inject private UserDao userDao; public User findById(final Long userId) throws UserException { …
unhappyms · 2010-04-12
What I meant by unsustainable is that I feel the retaining talent problem is less related to money. My guess is smart people are leaving mostly because of the environment and not because of pay and benefits. When those smart people leave, theoretically the quality of the product suffers and overtime the competitor with better people wins. If MS profits go down over time, and investing in things like Azure and Bing and Entertainment (all which loose money), I don't see how they can continue to throw money at the talent problem. But man if I could get paid more AND work in a better environment (one where I had an impact) I would go for it in a heart beat. So in that sense money DOES matter. I agree with the rest of what you said though about it being difficult to measure. This is what I think of when the subject is talented people leaving MS: http://www.techflash.com/seattle/2008/12/Key_data_center_architect_lea… http://googletesting.blogspot.com/2009/06/james-whittaker-joins-google… I think Amazon and Google are better because of it.

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close