DEV Community

Discussion on: What's your testing strategy?

Collapse
 
ben profile image
Ben Halpern

Testing plays a pretty huge role in everything we do. Strategically we use testing for:

  • Testing for expected behavior in the context of merging/deploying new code. Tests give us the confidence to say yes to new things. Not sure what we'd do without a solid amount of tests.
  • Measuring quality via code coverage and other metrics. Code coverage is a dubious metric because it can lead to false confidence, but it is a way for us to sniff out ways to improve quality of our code. Code coverage is associated with quality even if there are gotchas.
  • Test driven development helps map out problems and ultimately get to certain solutions much quicker. Not sure where to start? Write a test.
  • Testing is a lot like documentation as well. It's probably the best way to see how something is supposed to work when docs are lacking or the code is unclear.

I'm no heavy-handed evangelist of any of this stuff, but I'd say our strategy is mostly to achieve the points listed here, with plenty of laziness or hurriedness mixed in along the way.