Discussion about this post

User's avatar
Irina Stanescu's avatar

Google codebase is probably among the cleanest I've ever worked in. Surely, it depends a lot of the teams and how "legacy" the code was, but for the most part it held true over the years.

The main reason is the readability check when submitting code, but testing for sure contributed to it. When you follow good testing practices, it kinda forces you to think of a code in a cleaner way too.

One note about "All tests should strive to be hermetic: a test should contain all of the information necessary to set up, execute, and tear down its environment." - I think this should be extended to allow test suites, because that's why they were designed. And I can attest from experience that Google did allow test suites.

Expand full comment
Dario Hamidi's avatar

Definitely sounds like an nice environment in which to code in!

I feel like the difficult part is actually defining public interfaces *within* your code base, so that you can write tests against those interfaces and the implementation is free to change.

Expand full comment
2 more comments...

No posts