Enhancing Application Quality Assurance Using GitLab Duo Workflow

Jump to

Ensuring the quality of software applications through test-driven design, comprehensive code coverage, and early issue detection is vital for maintaining customer trust and protecting a company’s reputation. However, these quality assurance processes often require significant time and effort from development teams.

Introducing GitLab Duo Workflow for Accelerated Development

GitLab Duo Workflow is an agentic AI solution built on the most comprehensive DevSecOps platform. It is designed to streamline and accelerate development tasks, such as adding unit tests to Java applications, by understanding the entire software development lifecycle (SDLC). Currently available in private beta, this AI-powered tool helps developers automate routine coding tasks, improving both speed and code quality.

Getting Started with GitLab Duo Workflow in Visual Studio Code

To begin using GitLab Duo Workflow, developers first clone their Java project to their local machine and open it in Visual Studio Code (VS Code). It is important to work within a feature branch rather than the main branch to maintain proper version control, especially when working on merge requests.

Optionally, developers can navigate to the Java class file they want to test, allowing them to verify later that the generated unit tests cover all class members effectively.

Before proceeding, ensure the GitLab Duo Workflow extension is enabled in VS Code.

Launching GitLab Duo Workflow and Creating Unit Tests

Developers can launch GitLab Duo Workflow by opening the VS Code command palette and selecting the “GitLab: Show Duo Workflow” option. This action opens a dedicated tab where users can input prompts to guide the AI.

For example, to generate unit tests for a Java class named Product.java, the following prompt is entered:

text

Create unit tests for class defined in the Product.java file and store the unit tests in its own file titled ProductTest.java

After clicking the Start button, GitLab Duo Workflow performs an analysis of the project and formulates a plan to achieve the requested task. This plan is displayed for review, and upon approval, the AI begins executing the changes.

Reviewing and Approving the AI-Generated Plan

The AI’s analysis and plan appear in separate windows within VS Code. Developers should carefully review the proposed plan to ensure it aligns with their expectations. Once satisfied, clicking the Approve Plan button initiates the automated modifications.

Automated Test File Creation and Error Resolution

Upon completion, a new directory is created within the project structure containing the generated test file ProductTest.java. This file includes unit tests for the Product.java class, covering constructors, object creation verification, and property state validation.

If import errors appear in the new test file, such as unresolved JUnit imports, GitLab Duo Workflow can be tasked with fixing these issues. This is done by starting a new workflow and providing a prompt like:

text

The file ProductTest.java has an error “The import org.junit cannot be resolved”. Please fix it

The AI then analyzes the project’s pom.xml file, removes outdated dependencies, adds the correct JUnit dependency with the appropriate version, and resolves all import errors in the test file.

Benefits of Using GitLab Duo Workflow for Quality Assurance

  • Time Efficiency: Automates repetitive tasks like test creation and dependency management, freeing developers to focus on higher-value work.
  • Improved Code Quality: Ensures comprehensive test coverage and up-to-date dependencies.
  • Seamless IDE Integration: Works directly within VS Code, maintaining developer workflow continuity.
  • AI-Driven Accuracy: Uses project context to generate relevant and effective tests.
  • Continuous Improvement: Supports iterative workflows to fix issues and enhance code quality dynamically.

Conclusion

GitLab Duo Workflow represents a significant advancement in AI-assisted software development, particularly in enhancing application quality assurance. By automating unit test generation and dependency management within the familiar environment of Visual Studio Code, it empowers development teams to deliver higher-quality software faster and with less manual effort. Developers interested in leveraging this innovative tool can join the private beta waitlist to explore its full capabilities.

Read more such articles from our Newsletter here.

Leave a Comment

Your email address will not be published. Required fields are marked *

You may also like

Automated AI test generation process improving software quality

Transforming Application Quality with AI-Powered Test Generation

Delivering high-quality applications is essential for any organization aiming to meet customer expectations and protect its reputation. However, achieving this level of quality often presents significant challenges. Manual testing processes

AI-powered software testing dashboard analyzing Salesforce workflows

Testing AI with AI: Strategies for Salesforce and Tricentis Testim

Artificial intelligence has become a fundamental expectation in modern software platforms. Today, integrating AI is no longer a differentiator—it’s a necessity. As organizations race to embed intelligent features, the challenge

Categories
Interested in working with Newsletters ?

These roles are hiring now.

Loading jobs...
Scroll to Top