I have a rest service that I would like to be able to test without having to write hundreds of tests. To give an overview of my service please read the following: My service accepts multiple values of data, for example:
- City
- State
- Name
- Date
- Color
On a specific URL endpoint, i.e. http://serverName:port/category/specificEndpoint
. With this data, the internal api runs some logic and then dynamically adds values to a query(using a velocity template) that gathers the data from a database, and then returns that information to the caller of the service in a specific format.
To test the responses, I have been creating tests with combinations of these values. For example:
Search Criteria:
<City,State>
<City>
<Name, Date, Color>
<City, State, Name, Date, Color>
I then check the responses to see if they have the values of data I am looking for. As you can see, every time I add another search criteria, the tests become larger and larger. I wanted to know if a framework or method existed to handle this sort of situation.
There are a few corner cases that I can test separately, but does something exist to assist in testing this service, and that can easily manipulated for future search criteria additions? A framework would be capable of testing the following combinations(Power Set) given the five search criteria shown above:
{},{City},{State},{ Name},{ Date},{ Color},{City,State},{City, Name},{City, Date},{City, Color},{State, Name},{State, Date},{State, Color},{ Name, Date},{ Name, Color},{ Date, Color},{City,State, Name},{City,State, Date},{City,State, Color},{City, Name, Date},{City, Name, Color},{City, Date, Color},{State, Name, Date},{State, Name, Color},{State, Date, Color},{ Name, Date, Color},{City,State, Name, Date},{City,State, Name, Color},{City,State, Date, Color},{City, Name, Date, Color},{State, Name, Date, Color},{City,State, Name, Date, Color}
Aucun commentaire:
Enregistrer un commentaire