Testing & Performance
Guidelines for testing, performance optimization, and quality assurance.
The more your tests resemble the way your software is used, the more confidence they can give you. Automated tests are by nature more abstract than your users, but using tools that enable you to simulate users as closely as possible will result in more confidence in shipping good experiences and help you avoid test babysitting that results from implementation details-based tests.
When you make an assertion (most often in tests, but also in validation/parsing), make the assertion specific enough that people who see the error understand what the intended behavior is and what about the current state falls short of that intended behavior.
Prefer explicit code over implicit configuration and magical abstractions. Boilerplate is not bad by nature (code is read more than it is written), but it's an indicator that a good abstraction could be on the horizon.
Most performance optimizations come at a complexity cost. When adding a performance optimization, you do real-world testing to evaluate the before/after to ensure your optimization is worth the effort (and not making things worse).
Share this principle