The new ANSI JOIN feature in Couchbase version 5.5 allows for more flexibility and complexity in joining data, but also introduces challenges in testing its functionality. To address this challenge, Couchbase has developed a framework called Random Query Generator (RQG) that leverages another framework called Randgen to generate SQL query templates based on user-defined parameters. These templates are then converted to N1QL formatted queries and executed against the Couchbase server and an equivalent MySQL server to ensure functional similarity. RQG is capable of generating highly complex queries, including multiple chained predicates and joins, which makes it suitable for testing ANSI JOINs. Through the use of RQG, Couchbase has found several bugs in the ANSI JOIN functionality, including issues with index selection and query hint usage. The framework's ability to generate a wide range of queries allows developers to thoroughly test the feature and ensure its correctness.