C
C#2w ago
mmjjrr

Creating API test suite

My team has an ASP.NET Core Web API. We are only two developers. The API is mature, and has hundreds of endpoints. We had to update our framework from .5 to .8, and now we have to test the API to make sure that migration doesn't break anything. We don't have any tests at the moment, so I am creating a test suite using Postman. Creating test scripts for every endpoint is taking forever, and I've only just started. I've resorted to just creating a smoke test of sorts that is just checking valid inputs and successful status code, until I have more time. Any advice on what to test for a very lean team. Thanks
2 Replies
mtreit
mtreit2w ago
Can you record, say, an hours worth of production requests and responses while running on .NET 5 and then use that to automatically create a set of tests? You would then know the expected output from real-world input and can use those results as an oracle to test the updated code to ensure you get the same results.
Sossenbinder
Sossenbinder2w ago
+1 for what mtreit mentioned, this might also be one of the cases where an llm could be super useful once it has been provided with e.g. the openapi spec for your endpoints. You could have a set of realistic requests generated or captured on the status quo, and afterwards run the same set against the new api in a snapshot testing manner, ensuring responses are equivalent

Did you find this page helpful?