Why are test frameworks not practical here?
As we can see, the strategy explained previously sounds very much like usual tests. One might say, why can't we use unit tests instead of implementing another component/service for measuring accuracy? The answer is because our intention is not to test the application in order to find flaws. The point is, tests are a way to find flaws in what we EXPECT from a piece of code. Take a look at the following test, for example:
it('should test TF-IDF accuracy', () => { expect(/* query outcome */).toBe(/* valid */); });
Note
The keywords such as "it", "expect", and "toBe" are the real function names used in testing. If you are interested in learning more about testing try: Jasmin Cookbook (https://www.packtpub.com/web-development/jasmine-cookbook).
So this code snippet here says we want 'to test TF-IDF accuracy' and we 'expect that our Custom Search Engine results are valid'. And how possibly can we guarantee that! As you might have guessed, there...