I want to implement a test suite for a javascript component, which contains a large list of input-output parameters, and evaluates the javascript component on the basis of number of times it was actually able to figure out the correct output for a given input.
For example, assume that the javascript component is responsible for string matching (takes in two strings, and returns boolean saying they are similar), and currently is only able to figure out exact matches. If the list of parameters is:
(John Wright, John Wright) -> true
(John Wright, JohnWright) -> true
(Jon Wright, John Wright) -> true [similar enough]
(James Wright, Jon Wright) -> false
The system correctly returns for only first and last cases, so let's say it receives a score of 2/4. Eventual enhancements to the system can result in better matching capabilities (and maybe some false matches as well), resulting in a new score.
I am currently thinking of implementing this using some unit testing framework, which loops through the test cases and does not have asserts. It just writes the eventual score and result of each test case in some file for analysis. Any leads on the best approach to achieve this kind of testing is appreciated. Please also direct towards already existing frameworks if possible.
Aucun commentaire:
Enregistrer un commentaire