Skip to content
Discussion options

You must be logged in to vote

Great question. We had the same issues and got much better results by treating generated tests as a two-phase pipeline: “deterministic scaffold” first, then “targeted hardening”.

What worked for us:

  1. Freeze inputs to reduce variance
  • Pin model/version and keep generation config under version control.
  • Use a stable prompt template with fixed section order:
    • component intent
    • externally visible behaviors
    • state matrix
    • mocking constraints
    • assertion style rules
  • Keep component context minimal but explicit (props, dependencies, side effects).
  • Regenerate only after meaningful component changes (not every tiny edit).
  1. Generate from a behavior matrix, not free-form
    Before generation, define a sma…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SaadWaheed10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants