I found Phind, and it blew my mind!
Motivation
In my very first post I harped on about how over-hyped AI systems have been for several months. I even scoffed at the idea that a failing search engine (Bing) decided to jam it into their product.
They may even end up cannabilizing themselves by doing so…
A huge part of how these generative AIs work, is that they take their data from all over the internet, with little means for the user to control or filter that data. Generative AIs, for the most part, don’t even cite their damn sources!
ChatGPT itself has been prone to making things up, and is a newbie according to CodeForces ranking.
If only there was something better!
Introducing Phind!
I found Phind via a successful senior software engineer, turned tech leader, named Swizec Teller. I subscribed to him back in 2019, when I was first learning about React + MobX, around the time that I had convinced my employer to switch to the archaic jQuery stuff we were doing, to React (and then MobX for state management).
I have been getting, and reading his blogs since then.
A blog post he dropped the other day, was about this “AI Woodstock” he went to in San Francisco, when he learned about all of these AI systems out there…including ones that were on random laptops on random tables…
One of those, was Phind. It’s basically ChatGPT, but way better, and way more focused! It is like Google, but AI powered, and built for developers! You can ask it some programming questions, and it will answer not only with generated text that, imo, is way better than what vanilla ChatGPT (GPT 3.5 at the time of this writing) can crank out, …
…but will provide sources to things like StackOverflow questions and official documentation, and it’s all accurate!
You can even, unlike ChatGPT, link to the prompt results!
You don’t even need to create an account either!
Let’s try it out…
My first experience with it, was asking it a basic Katalon Studio question that vanilla ChatGPT failed hard at…
"How to get a WebElement from a TestObject in Katalon Studio"
If you ask vanilla ChatGPT (not paid) this question, it hallucinate a response:
import org.openqa.selenium.WebElement
import com.kms.katalon.core.testobject.TestObjectConverter
// Convert the TestObject to a WebElement
WebElement webElement = TestObjectConverter.toWebElement(testObject)
// Use WebElement methods on the webElement object
webElement.click()
webElement.sendKeys("Hello, world!")
There is no TestObjectConverter
🙄
I ask Phind this question, and here’s its response
This answers the question, while providing you with additional information on TestObjects…
Yes it does hallucinate two WebUI
methods that don’t exist, WebUI.findWebElement()
and WebUI.findWebElements()
, …
Yes, it does try to answer the opposite question, how to get TestObject
from WebElement
, by writing some code when there already exists WebUI.convertWebElementToTestObject()
. It took code from this guy on Katalon forum . On that same question it is revealed that the built-in method exists… 😛
It does recover from the blunder however:
It is worth noting that this approach requires using Selenium-specific code, which may not be the best practice for Katalon Studio. Also, this approach is for converting a WebElement to a Test Object, not the other way around. To convert a Test Object to a WebElement, you can use the WebUICommonHelper.findWebElement() method. stackoverflow.com
This recovery is the correct answer to this question!
Let’s ask it some more questions…
In my last post, we asked vanilla ChatGPT to write some code for Katalon Studio to create a Google Calendar event.
I asked it to write util Keyword for this as a Java programmer.
It didn’t pick up on that I am working in Groovy, and that I write Groovy code in a Java style (not pure Java, but Java with some Groovy features (such as this
to refer to a static method)).
It said to use the Google Calendar API, but didn’t tell me how to set that up. It just wrote code, that I optimized with basic design principles.
Let’s ask Phind!
It outlines several steps to set up things, before it gives you any code! It links to the quickstart guide, which I refered to at the end of my article, as well as giving you an action plan for writing the actual code!
It gives you a Groovy snippet to boot! Not that I would plug that directly into my code base, as again, I write my code like a Java developer! But then again, I did ask it to write in Groovy, so this one is on me…
Let’s test its troubleshooting skills!
Unfortunately, when I was running a test suite on my computer, that pulls from some profiles spreadsheet, that it keeps open until teardown, when it gets closed…
… my computer crashed! 😱
To my horror, when I started it up again, every single test case was failing, either to run at all, or to tearDown()
!! 😱
Mortified, I start looking through the code base, following the exception stack trace. Nothing looks out of place.
I then ask Phind, if it can…find…what is causing the error. It tells me the error may be happening because the file exists but it isn’t in valid Excel file format!
I look back at my code, and my code is following its suggestions already…
I then open up the profiles spreadsheet myself, and sure enough…it got corrupted (by the computer that was using it crashing while it was open)! 😱
I pull it down from master branch and all was well again!
Final Verdict
This AI solution is game-changing! No longer do I have to strain myself hunting down or parsing official documentation, that may or may not be crystal clear…
no longer do I have to post, and before that search through and parse answers on, some programming forum, and wait for an answer to come my way, if it does at all…
I can just ask Phind, and it can put it all in front of me, saving me minutes, hours, or even days of pain as a developer!
From now on, I’ma use Phind, and I encourage everyone who’s reading this post to do the same!