While I worked at Google I spent a lot of time doing testing and code review. One of the things I learned from this is:

A test must document what it is testing.

This doesn’t have to be an explicit comment (it might be adequately explained by the name of the test, or the code in it), but either way, it should be obvious to maintainers what the goal of the test is — what property the code under test should have. “This test should continue to pass” is not a sufficient explanation of the goal. Why? Consider these scenarios:

  • A test failed. Does that mean…

    • …the test successfully detected the loss of a desired behavior? (This is the ideal case, that we hope to enable by writing and running tests.)

    • …the test incidentally depended on something that is changing but is not significant, such as ordering of something unordered-but-deterministic, or the exact sequence of some method calls? (Ideally, test assertions will be written precisely so that they accept everything that meets requirements, but this is not always feasible or correctly anticipated.)

    • …the test incidentally depended on something that is being intentionally changed, but it wasn’t intending to test that part of the system, which has its own tests?

  • A test no longer compiles because you deleted a function (or other declaration/item/symbol) it used. Does that mean…

    • …the test demonstrates a reason why you should not delete that function?

    • …the test needs to be rewritten to test the thing it is about, without incidentally using that function?

    • …the function is necessary to perform this test, so it should continue to exist but be private?

If tests specify the property they are looking for, then maintainers can quickly decide how to respond to a test failure — whether to count it a bug in the code under test, or to change or delete the test.

If they do not, then maintainers will waste time keeping the code conformant to obsolete requirements, or digging through revision history to determine the original intent.

end and beginning

Saturday, May 6th, 2023 14:23

One month ago, April 7, 2023, I left my job at Google.

At the time, I was working on Earth Engine — “a planetary-scale platform for Earth science data & analysis”, or if you're looking at it through my lens, a cloud computing service which interprets parallel, pure-functional programs interleaved with image processing and database queries. (It’s a really interesting system, and if you'd like to check it out yourself, it's free for non-commercial use. Play with big data and make interesting pictures!)

One of the elements of the plan I made for the future after this choice was that, this year, I would get to take some time to pursue my personal projects and interests unencumbered by “having a day job” or intellectual property contracts — and I have been doing that.

Now, as you can see from the fact that my blog is as silent the last month as it has been for the last two years, that didn't instantly bring back all the energy for blogging I had in 2012. But, step one is to break the awkward silence. Step two is to post about stuff I've been doing. Maybe someday I'll get to step “update my website”.

Status update

Sunday, July 8th, 2012 07:15

Arrived in California a few days ago; setting up assorted arrangements. I start work in a week.

It seems I entirely forgot to blog this previously: Google hired me full-time after my last internship; I start in July. I'm currently working on all the arrangements for getting myself there, which includes:

I want your recommendations for housing in Mountain View, CA or the close vicinity.

I am interested in recommendations either for permanent housing or a temporary place-to-stay (so that I can do research in person). I intend to initially pack two-suitcases light and have All My Stuff shipped later, so just about anything will do temporarily, but for permanent housing I am thinking of something along the lines of a one-bedroom apartment, though I would consider some sort of sharing.

Update: I have found a room for my immediate needs. I am still interested in recommendations for permanent housing.

I particularly desire, not general advice on how or where to search unless it is especially specific, but personal recommendations of locations you or a friend have had a good experience with.

Regarding location, these attributes would be of interest: comfortably accessible by public transport and/or bike routes (that is, I plan to attempt to get away with not owning a car); close to Google's campus (Amphitheatre Parkway); and lastly, close to such amenities as a good grocery store. But above all else, I want your recommendations of quality and value.

Anyone (that I know at least somewhat) looking for a Google+ invitation? (I don't know whether they're scarce these days.)

I'm on Google+, but I am not planning to post anything important-and-public exclusively there. I might experiment with crossposting.

In terms of what I want out of the place where I post the stuff I post here, LJ is still the better option, in supporting HTML posts, decent archive browsing, and finding context starting from permalinks.

I'm still thinking of switching to a different platform, possibly of my own creation, to get additional features: style sheets for blog posts, embedding JavaScript-containing content in posts (tastefully, I assure you), even better archive browsing, no ads, and a visual design more closely connected with my non-blog site.

In California

Thursday, May 19th, 2011 09:12

Oh, and I should mention: I have arrived in Mountain View, California and have started my internship at Google with the Caja team.

The problem of arranging a set of unbreakable text blocks in columns in an arbitrary order such that the columns are of approximately equal height is equivalent to the NP-complete “multiprocessor scheduling” problem, and the “LPT algorithm” described in the linked article performed excellently for my instance of the problem (4 columns, 6 blocks), which is actually my packing list for traveling to California tomorrow.

(I have a program which generates my packing list for me, based on type, duration, season, and transportation. It encodes all the accumulated knowledge about what to pack and where to pack it; after a trip I review my changes written on the printed list and incorporate them into the program.)

Google again

Saturday, February 12th, 2011 09:28

It’s now confirmed that I'm going to be doing the same thing this summer as last summer: working at Google on Caja.

All comments, congratulations, housing recommendations, and activity suggestions are welcome.

Got a nice fluid layout on your web site? Annoyed at how mobile browsers like to assume pages need nine hundred virtual horizontal pixels to display properly? Add this to your <head>, as I've just done across my site:

<meta name="viewport" content="width=device-width">

This tells iPhone and Android browsers, at least, to present the page with a virtual window width equal to the device's actual screen width. It was invented and specified by Apple.

(I am not taking up the question of whether these browsers are making the right default choice. I will say, however, that in my technical opinion this is the wrong choice of location for this parameter: whether a layout will work at narrow widths depends largely on the stylesheet, not on the HTML; this parameter therefore ought to be stored in the stylesheet (that is, be a CSS extension); insofar as it does depend on the HTML, you can then put it in a <style> element.)

If you're looking to use media types to provide different styles: These browsers also don't respect the “handheld” media type; but they do support draft CSS3 Media Queries, which allow you to condition on the actual screen width — if you want, even in ems! I've used this on the main switchb.org page to make the Big Text less likely to spill off the screen (could use some further testing; all I've used so far is my desktop and a Nexus One), and also in the Caja Corkboard demo (which I wrote this summer (among other things) and ought to blog about).

I have finished my internship at Google (which I do want to post about eventually).

I am now about to start classes at Clarkson University. Everything's going smoothly, except the network to my room is broken and I'm connecting over my shiny new phone (hooray for Android 2.2's “Portable Wi-Fi hotspot”) and so I'm temporarily off several of my Internet activities due to bandwidth/latency/intermittency.

(On the upside of technical issues, I managed to get Apple Mail and my phone to talk to Clarkson's Exchange server, so no more having to remember to check my college email more than once a day. What wasn't obvious: When setting up the account in Mail, put the Outlook Web Access server name in both the “Incoming Mail Server” and “Outlook Web Access Server” fields. I haven't figured out how to send mail from their server; perhaps I need to upgrade to Mac OS X 10.6 for that.)

I designed the new logo for Tahoe-LAFS.

Arrival

Monday, May 31st, 2010 13:57

In California. Settling in. Getting some rest. Caught up on my email. Starting at Google tomorrow.

I am right this minute packing my luggage and reviewing plans. I will be getting on the train tonight at 8 PM Eastern, and traveling until 9 PM Pacific on Sunday, May 30.

I will probably not have Internet access for most or all of the trip.

Done. Next?

Tuesday, May 18th, 2010 10:27

Last exam done for the semester! Halfway done with college in general!

Now I just have to move to California for the summer job.

(Most of the arrangements are settled; I'll be arriving Sunday, May 30, and living in Cupertino, at least at first.)

After this summer I'll be transferring to Clarkson University to finish my bachelor's degree.

One of the things I’ve been procrastinatingah, not had the time to do, being busy with school and other projects, is announcing and working on a job search for this summer. I have posted my resume, but I didn’t even get around to mentioning that. The process really doesn’t excite me that much — it’s essentially research, comparison shopping, which I have never been very fond of.

But, last October, I was contacted out of the blue by a recruiter asking if I was interested in opportunities at — Google. After checking that it wasn’t a spoof I naturally said yes, and after a number of rounds of information exchange and interviews,

This summer, I will be (well, subject to my completing the process of accepting the offer) working as a Software Engineering Intern at Google, with the Caja team, in Mountain View, CA.

So — whoa and yay and other such cheerful words. And thanks to my friends at Google who referred me and nudged the process along.*


The most uncertain remaining step is finding housing in or near Mountain View (could be as far as San Francisco or San Jose; Google runs a shuttle bus and is convenient to public transportation). Google has provided some general advice-for-interns, but I’d like to hear input from my readers and friends who already live in in the area.

Some parameters:

  • I would consider living with other people, but I wouldn’t want to take a chance on a complete unknown. (So if you are someone or know someone with a room...)
  • Speaking of taking chances, make the chance of being mugged on the way home in the evening very small, please.
  • I am traveling from the east coast, probably by train, so I don’t want to have to transport a lot of stuff, or buy items that I’ll use for only three months — so a furnished space is better.
  • I do not own a car, but I know how to drive one.
  • I do not own a bicycle, but I used to know how to ride one.
  • This will be the first time I have lived outside of my home city for longer than a week’s visit/vacation.

*Y’know how job search advice is big on saying you should be “networking”? If you’ve thought you’re too much of the non-face-to-face-social non-polite-small-talk would-rather-talk-to-people-through-the-computer sort for that — take me as an example. This opportunity came to me because of other people who knew me entirely through my work on open source projects (E, and thus Caja-CapTP) — I didn’t do anything that I wouldn’t have done for other reasons anyway. I’m not saying you shouldn't do any of the other stuff you might be thinking of — I’m saying this stuff counts.