I am designing some test cases for my application. Assume that I have a method called
ProcessedDataObject createProcessedDataObject(RawDataHolder input)
The performance of createProcessedDataObject
is vital so I would like to include some benchmark performance testing against constant inputs (e.g. building input
from a local text file so it does not vary) and fail if it takes more than a certain number of nanos for every future modification of the method. IOW, I want the test to be designed to raise a red flag in case future changes add complexity to exceed the time benchmark.
My question is: does benchmark performance testing belong in the realm of JUnit or should I keep it outside?