GitHub Copilot Archives - Automated Visual Testing | Applitools https://applitools.com/blog/tag/github-copilot/ Applitools delivers the next generation of test automation powered by AI assisted computer vision technology known as Visual AI. Tue, 03 Oct 2023 12:58:40 +0000 en-US hourly 1 AI-Powered Test Automation: How GitHub Copilot and Applitools Can Help https://applitools.com/blog/ai-powered-test-automation-how-github-copilot-and-applitools-can-help/ Tue, 22 Aug 2023 21:23:00 +0000 https://applitools.com/?p=51789 Test automation is crucial for any software engineering team to ensure high-quality releases and a smooth software development lifecycle. However, test automation efforts can often be tedious, time-consuming, and require...

The post AI-Powered Test Automation: How GitHub Copilot and Applitools Can Help appeared first on Automated Visual Testing | Applitools.

]]>
Can AI Autogenerate and Run Automated Tests?

Test automation is crucial for any software engineering team to ensure high-quality releases and a smooth software development lifecycle. However, test automation efforts can often be tedious, time-consuming, and require specialized skills. New AI tools are emerging that can help accelerate test automation, handle flaky tests, increase test coverage, and improve productivity.

In a recent webinar, Rizel Scarlett and Anand Bagmar discussed how to leverage AI-powered tools like GitHub Copilot and Applitools to boost your test automation strategy.

GitHub Copilot can generate automated tests.

By providing code suggestions based on comments and prompts, Copilot can help quickly write test cases and accelerate test automation development. For example, a comment like “validate phone number” can generate a full regular expression in seconds. Copilot also excels at writing unit tests, which many teams struggle to incorporate efficiently.

Applitools Execution Cloud provides self-healing test capabilities.

The Execution Cloud allows you to run tests in the cloud or on your local machine. With self-healing functionality, tests can continue running successfully even when there are changes to web elements or locators. This helps reduce flaky tests and maintenance time. Although skeptical about self-healing at first, the experts found Applitools to handle updates properly without clicking incorrect elements.

Together, tools like Copilot and Applitools can transform your test automation.

Copilot generates the initial test cases and Applitools provides a self-healing cloud environment to run them. This combination leads to improved productivity, reduced flaky tests, and increased coverage.

Applitools Eyes and Execution Cloud offer innovative AI solutions for automated visual testing. By leveraging new technologies like these, teams can achieve test automation at scale and ship high-quality software with confidence. To see these AI tools in action and learn how they can benefit your team, watch the full webinar recording.

The post AI-Powered Test Automation: How GitHub Copilot and Applitools Can Help appeared first on Automated Visual Testing | Applitools.

]]>
Using GitHub Copilot to Automate Tests https://applitools.com/blog/using-github-copilot-to-automate-tests/ Mon, 09 Aug 2021 19:29:34 +0000 https://applitools.com/?p=30233 Code completion is nothing new. Tools like IntelliSense have allowed developers to become more productive by attempting to automatically complete the name of a function or statement they’re in the...

The post Using GitHub Copilot to Automate Tests appeared first on Automated Visual Testing | Applitools.

]]>
GitHub Copilot logo in front of a circuit board

Code completion is nothing new. Tools like IntelliSense have allowed developers to become more productive by attempting to automatically complete the name of a function or statement they’re in the middle of writing, but the tools available only have a certain level of actual “intelligence” available.

With GitHub’s limited release of Copilot, they’re taking advantage of the powers of AI to boost developer productivity by not only trying to complete a function’s name, but by trying to suggest the entire function itself!

What is GitHub Copilot?

GitHub Copilot is a new tool from GitHub that provides realtime code suggestions when working inside of VS Code as an extension.

Code suggestion from GitHub Copilot
https://gist.github.com/colbyfayock/eb523d3359de66c7899c0b14330fc5b3#file-page-query

It’s powered by OpenAI, trained on billions of lines of public code, courtesy of projects hosted on GitHub itself, giving it the ability to have a wide variety of authors and languages to base those suggestions off of.

How does it work?

Copilot will typically give suggestions as you type in any scenario, but the two compelling examples that GitHub provides is being able to create a function based off of a comment or based off of the name of the function.

For instance, if I were to write:

// returns a sorted array of objects based on date

Copilot will get started with a new function, then once accepted, continue to write that function.

Copilot suggesting a new function
https://gist.github.com/colbyfayock/eb523d3359de66c7899c0b14330fc5b3#file-function-by-comment

Alternatively, I can supply the function name like:

function sortArrayByKey

Where Copilot could then write that entire function for me!

Copliot suggesting code for a function
https://gist.github.com/colbyfayock/eb523d3359de66c7899c0b14330fc5b3#file-function-by-name

If I don’t like the first answer it gives, I also have the option to look through alternatives, including pulling up all the answers Copilot thing could be helpful in this context.

GitHub Copilot synthesizing multiple results
https://gist.github.com/colbyfayock/eb523d3359de66c7899c0b14330fc5b3#file-synthesized-function-results-by-name

What other kinds of things can it do?

There aren’t really any hard limitations beyond the basic gist of the tool being a way to suggest code. That just means you’ll be able to get a suggestion for finishing a function, but not necessarily for scaffolding a project with new files and directories.

While it can suggest really anything like an entire React component, it seems to really excel at utility functions that have a clear goal such as custom functions to sort an array like above or filtering data. Building components can be pretty specific and not include dependencies, where those functions often only require a specific input and output.

Copilot can even read context from the active file. If you’re trying to sort or filter data based on what exists in that file, it will try to use that context in its suggestion.

Context-aware suggestions from Copilot
https://gist.github.com/colbyfayock/eb523d3359de66c7899c0b14330fc5b3#file-filter-data

Can it write tests?

Writing functions is one thing, but can Copliot produce real, meaningful tests? Well, it depends.

Copilot test suggestions for a utility function
https://gist.github.com/colbyfayock/eb523d3359de66c7899c0b14330fc5b3#file-unit-test

Context is an important factor with tests. If you’re writing a unit test with Jest to harden business logic or a Cypress test to walk through your UI, that information is typically scattered in other files or not even available until it renders in a browser. Copilot can write a test based on similar situations, but it wouldn’t “just work”.

That said, when using testing frameworks like Applitools, you can get visual testing coverage with code that doesn’t need to be super specific to your application, only requiring it to load in the browser, where Applitools steps in and does the heavy lifting.

https://twitter.com/colbyfayock/status/1410066304585850886

Part of Copilot’s wide net of training data includes a variety of Applitools examples, meaning we can easily write our new Eyes checks right in our existing testing frameworks.

Is Copilot the future of development?

The release of Copilot and tools like it bring a new era in what the software we’re using can do for us in day-to-day development. By leveraging AI and machine learning, we’re able to train computers to do the hard lifting and mundane tasks while we focus on solving the real problems, not how to fight with our text editor.

For a lot of developers, getting this information is a typical Google search with a look at a Stack Overflow answer. Even if only using it for common functions, we’re saving time and mental resources not having to look those things up ourselves.

But Copilot is still just another tool in our belt. It shows us what’s possible, but like all other tools, it’s up to the developer to ultimately take that knowledge and use it to its potential.

The post Using GitHub Copilot to Automate Tests appeared first on Automated Visual Testing | Applitools.

]]>