We have defined a new reverse-engineering problem of unmasking SQL queries hidden within database applications, with diverse use-cases ranging from resurrecting legacy code to query rewriting. We have designed UNMASQUE, an active-learning extraction algorithm that can expose a complex class of hidden warehouse queries. A special feature is that the extraction is completely non-invasive wrt the application, examining only the results obtained from repeated executions on databases derived with data mutation and data generation techniques. A detailed evaluation over benchmark applications hosting hidden SQL queries, or their imperative versions, demonstrates that UNMASQUE correctly and efficiently extracts these queries.
Shedding Light on Opaque Application Queries Kapil Khurana, Jayant Haritsa Proc. of ACM SIGMOD Intl. Conf. on Management of Data, Xi’an, China, June 2021
UNMASQUE: A Hidden SQL Query Extractor Kapil Khurana, Jayant Haritsa Proc. of 46th Intl. Conf. on Very Large Data Bases (VLDB), Tokyo, Japan, September 2020 published as PVLDB Journal, 13(12), August 2020, pgs. 2809-2812