Bug Discovery: A Journey of Challenges, Discoveries, and Insights

Chitturi Durga Satya Sai Kiran
3 min readAug 19, 2023

Introduction: An Unexpected Journey

Have you ever embarked on a journey that started as a simple favor for a friend and ended up uncovering a hidden realm of possibilities?

Hello there, readers! I’m Chitturi Durga Satya Sai Kiran, and I can’t wait to share an intriguing Bug Discovery journey with you. This blog takes you through a remarkable project, exploring AI’s power and the art of problem-solving.

The Quest Begins: Unraveling the Problem

It all started when my friend Komali, a fellow student in her 7th semester, approached me with an intriguing challenge. Her main project demanded a function that could effortlessly convert any user-provided input text into SQL format.

Diverse Approaches: The Exploration Phase

We went on a journey to find the best way to turn text into SQL. We tried different methods like using Google API, but many required payment which was tough for us. But then, we found text2SQL, which gave us hope and a new direction.

Using a Headless Browser (Selenium):

We initially considered using a headless browser like Selenium to automate the interaction with the website and capture the generated SQL output. This approach involved scripting browser actions to simulate user behavior, filling out the form, submitting it, and extracting the resulting SQL output. While feasible, this approach was more complex and resource-intensive, and we explored alternative methods.

Using the requests Library with Basic POST Request:

We shifted our focus to making direct POST requests to the website’s API endpoint using the requests library in Python. We crafted a basic POST request with the input text as form data and observed the response to understand the structure of the API’s output.

Inspecting Network Requests in Browser Developer Tools:

We used the browser’s developer tools to inspect the network requests made by the website when generating SQL from user input. By observing the network requests and their parameters, we gained insights into the data being sent to the server.

Simulating a User-Agent with Chrome:

We realized that the website might be using user-agent information to distinguish between requests made by browsers and automated scripts. To simulate a legitimate user request, we added a user-agent header to our requests library call.

Direct URL Encoding and POST Request:

We explored the option of encoding the input text directly into the URL and making a GET request to the API endpoint. However, this approach didn’t yield the desired results as the API required POST requests with form data.

The Eureka Moment: Discovery and Revelation

Our aha moment arrived when we dived deep into text2SQL’s workings. We discovered that direct interaction with its API held the key. Armed with the requests library, I crafted headers and data to mimic users, providing a viable solution. The journey continued, diving into headers, user-agents, and POST requests. Each code piece was a puzzle part, leading to the magical moment of SQL output.

Overcoming Challenges: Reporting and Resolving

Our triumph over coding wasn’t the end. As the project neared completion, I discovered a bug — the ability to use text2SQL API directly. Reporting it led to prompt resolution, showcasing their dedication to quality service.

A Journey Beyond Code

Beyond lines of code lies a treasure trove of experiences. This blog isn’t just about coding; it’s a lesson in learning, creative problem-solving, and contributing to the AI community. Embrace challenges, seek innovative solutions, and remember that failures are stepping stones towards success. The codes that didn’t work were as important as the one that did.

Your Support Matters

Thank you for joining me on this adventure. If you enjoyed the journey, consider showing your support with 50 claps 😅 and sharing with fellow explorers.

Connect with me on LinkedIn to explore the project demo: SQL-Genius-Converter

Stay tuned for more stories of exploration and innovation. Happy reading

--

--

Chitturi Durga Satya Sai Kiran

🚀 SDE Intern @TheLittleDentist | AI Enthusiast | Crafting Digital Symphony | Let's Redefine Possibilities 🎨🤖