There is no such thing as a test for compatibility in a friendship. There are measures for amity (that is, how much we feel someone is our friend), but no tests that predict whether two people would become good friends.
There are tests that aim to test for compatibility in romantic relationships. These are based on theories about what makes romantic relationships work, and some of them are employed on certain online dating platforms. Some of these platforms (e.g. Parship.de and Edarling.de), conduct studies to test their "scientific dating" principles and publish them. What is interesting in this context is that while there are clear indications for what makes a majority of romantic relationships work, but psychologists have as yet been unable to predict what makes people fall in love. So we know what would make them happy in the long term, but we don't know how to get them together. People fall in love for reasons that are very individual and cannot be systematized, yet.
In friendships, there are of course similar predictors as in romantic relationships, but since friendships are often much looser, friends spend very much less time with each other, and therefore don't need the same level of compatibility (because much incompatibility is compensated by less expectations and more time without each other), it is often enough for friends to share the same hobby, the same job, or live in the same neighborhood.
If you think of friendship as very intimate relationships with much sharing of emotions and thoughts, that is, of close "best" friends, then tests for romantic relationships would very likely cover aspects of these friendships as well.