codeflash-internal/experiments/sqlalchemy/sqlalchemy_plan_user_message.md
2025-12-30 15:22:39 -05:00

1.2 KiB

You want to write tests to test the following function: {function_code}.

Imagine you have the data to use given as the following:

data_to_use = fetch_data(session)

where fetch_data(session) returns the data to use as inputs to the function.

You should come up with a few different combinations of this data to use as inputs to the function in order to test it. These combinations should cover a wide range of inputs to constitute a good test suite. A good unit test suite should aim to:

  • Test the function's behavior for a wide range of possible inputs
  • Test edge cases that the author may not have foreseen
  • Take advantage of the features of {unit_test_package} to make the tests easy to write and maintain
  • Be easy to read and understand, with clean code and descriptive names
  • Be deterministic, so that the tests always pass or fail in the same way
  • Have tests sorted by difficulty, from easiest to hardest

To help unit test the function above, list diverse scenarios that the function should be able to handle (and under each scenario, include a few examples as sub-bullets). Based on our function input, you should use different combinations of the data given to come up with these different scenarios.