Skip to content

Prompt for testing phiosophy

Testing

  • Testing philosophy: write the absolute minimum number of tests that give maximum confidence.
  • Prefer property-based testing over example-based unit tests.
  • Use table-driven tests with t.Run for multiple test cases
  • Test struct fields: name, input params, expected output
  • Follow naming pattern: TestFunctionName

For Go:

  • Use https://github.com/leanovate/gopter (property testing) for domain logic
  • Model critical domain behavior with TLA+ specs first (generate .tla file), then implement properties that match the TLA+ invariants

For TypeScript: