Software Engineering at Google Chapter #11 - Testing Overview (1 of 3)

  • Throwing sample data at your own program in order to verify it works is the simplest form of testing
  • The later in the development cycle that a bug is found, the more expensive it is to correct
  • Tests make it possible to "change software with confidence"
  • Having robust testing allows your company to not fear change, thus allowing your company to change quicker and with more confidence
  • Writing tests early on forces you to confront some design decisions early when it is easiest to change
  • A simple test is defined as:
    • A single behavior that you test (method or API call)
    • A specific input (the input to your API call)
    • An observable output or behavior
    • Tests are run in a controlled, well understood environment
  • Keep an eye out for and be prepared to deal with instability and slowness in your test suite
  • A bad test suite can be worse than none at all
  • Consider that a test suite will require ongoing maintenance
  • Testing not only ensures quality but safety (to human lives and livelyhoods)
  • Testing cannot be an afterthought
  • A Google internal project mandated that code be submitted with tests and after one year defects dropped by 50%
  • You can't depend on programmer ability alone, that is why you test
  • Everyone who modifies and will modify the code benefits from tests
  • The automated testing loop is write (tests), run (tests), react (to output from tests)
  • "Tests expressed as code" similar to infrastruture as code
  • Teams that put a priority on fixing a broken test within a few minutes of the failure derive more value out of their tests by keeping confidence and speed high



Thank you for your time and attention.
Apply what you've learned here.
Enjoy it all.