Home / Companies / Graphite / Blog / Post Details
Content Deep Dive

Going from 0 to 1: How to write better unit tests when there are none

Blog post from Graphite

Post Details
Company
Date Published
Author
David Bradford
Word Count
2,977
Language
English
Hacker News Points
-
Summary

At Graphite, initially, there was a lack of testing culture, influenced by engineers with experience at Meta, where testing was not prioritized. Over two years, the company shifted its culture to incorporate testing more extensively, but faced issues with poorly architected tests, which can become a liability as production code evolves. The importance of well-architected tests is emphasized, as they ensure maintainability and adaptability. To improve testing practices, several strategies were implemented, such as separating logic from side effects, using domain-specific languages to reduce boilerplate, parameterizing tests for clarity, and designing tests with potential failures in mind. These efforts have not only enhanced test quality but also improved the overall speed and execution of test suites, fostering a better testing culture at Graphite.