Blog Archive

Sunday, 2 September 2018

Search Precision and Sort by Test

Searching bars are very common in most web applications. In order to test the search function, a few perspectives are available for consideration. For one example, we can calculate the search precision. In the context of information retrieval, precision is the fraction of retrieved entries that are relevant to the query.
Search Precision = Relevant Search Results / Total Search Results
As for the definition of relevance, it is totally up to the tester. It can be defined as the presence of search keyword in the result or even similar results if you are testing a fuzzy search. Here, I would like to provide an example of search precision calculation based on the keyword.

    //accumulate the number of search results 
    i = i + driver.FindElements(By.XPath(/*you need to specify*/)).Count; 
    //accumulate the number of search results that contains the keyword 
    j = j + driver.FindElements(By.XPath(/*you need to specify*/)).Count; 

    //calculate the search precision rate 
    r =  j / i;

No comments:

Post a Comment

Software Testing Tools

There are various software testing tools available for QAs to increase efficiency, visibility, accuracy, and ability of their work. The tool...