Test code may even live longer than the code it tests. It’s worth investing in good test design that will be cheaper to maintain and more likely to pay back with valuable feedback to both yourself and future developers. It’s about structure of a Test Case, sharing setup, how to verify correct behaviour. Some of this is specific to the programming language and framework you are using. Some of it is general good design principles.
I have a page with suggested series on Test Design for various programming languages. Below is the full list:
- Asserting on Collections of Objects
- Benefits of Arrange - Act - Assert
- Test Desiderata
- Unit Tests Should Find Bugs
- Test Names
- Arrange - Act - Assert
- Parameterized Tests in Doctest
- Test Fixture Introduction
- Four Pillars of a Good Test (Khorikov)
- Parameterized Tests
- Characteristics of Unit tests
- Start with the Assertion
- Test a Bug
- Three parts of a test
- Unit Test FIRST properties
- Custom Assertions
- Test Fixture design
- Test Fixtures - Readability vs Duplication
- Styles of Unit Tests
- Test data builders
- Gherkin intro
- Complexity / Collaborator quadrant analysis