I am performing a unit test which basically tests the time performance of a call to the database, and retrieving data. Now I have made test as a UnitTest, but I am fairly sure it is not a unit test, since in short it just tracks the time from the function call, until it returns data. What type of test would this be, when not unit test?
CodePudding user response:
It is not a performance test if it only does the call once to record the latency. Real performance test do such a call multiple times and report statitics like the mean latency and/or various percentiles.
It is also not a unit test by the common definition since it touches a database.
Integration tests excersise certain use cases with some dependencies that you would usually mock in unit tests, like the database. But integration test check for functional behavior, not timing.
Therefore I would call your test a "one-off timing test"