top of page
Concrete

Unveiling the Power of AI: My Exciting Quest into Multi-Agent Systems for Software QA with CrewAI Tools!

  • Writer: Georgios Kogketsof
    Georgios Kogketsof
  • Jan 13
  • 7 min read

While exploring the software QA landscape, it became evident that the collaboration between human testers and AI technologies offers a transformative opportunity. By adopting this partnership, organizations can address the limitations of traditional testing methods, leading to improved testing processes that boost the quality and reliability of complex applications.


Machine learning algorithms are absolutely incredible, capable of analyzing vast datasets at lightning speed! For instance, a study showed that companies harnessing the power of AI for testing experienced a 30% reduction in time spent on test case creation. This eye-opening statistic made me realize just how much AI could empower testers to craft comprehensive and strategic test cases. Inspired to dive deeper, I turned to my good friend Dr. Dimitris Sotiriou who guided me into the fascinating world of multi-agent systems. There, I witnessed firsthand how a team of agents can dramatically revolutionize the testing process!


In this post, I will share the insights to the captivating realm of multi-agent systems using a multi agent platform of CrewAI for crafting a test plan and test cases for the popular card game, Ultimate Texas Hold'em. By developing two distinct agents—one dedicated to drafting the test plan and the other using pairwise testing to generate effective test cases—I have laid a foundation for greater automation in software testing.


Entering the World of Multi-Agent Systems


A multi-agent system includes several intelligent agents that interact to achieve shared goals. This concept captivated me because it introduces new opportunities for agents to collaborate, ultimately boosting test coverage and efficiency.


With CrewAI tools, I quickly grasped that each agent could operate independently yet contribute to a common objective. I decided to create two specific agents that would focus on test planning and execution for Ultimate Texas Hold'em.


Building My First Agent: The Test Plan Creator


The first agent I developed was designed to generate a comprehensive test plan for Ultimate Texas Hold'em. This game is complex, with numerous rules and variables—perfect for rigorous testing.


Using CrewAI’s intuitive interface, I configured the agent to analyze the game rules, player actions, and different game scenarios. For instance, the agent incorporated over 5 detailed rules, encompassing player actions such as betting and folding. It produced a structured test plan that outlined what components and features should be tested, ensuring no critical aspect was overlooked.


The first agent, the researcher, is tasked with creating a comprehensive test plan.

researcher:
  role: >
    Senior Software QA Engineer
  goal: >
    Create a test plan to test the functionality of an ultimate texas holdem game.
  backstory: >
    You're a senior software QA engineer who wants to test if the Ultimate Texas
    Hold'em software is working properly. The goal of the tests 
    is to identify if the balance of the player is updated correctly. You implement 
    functional testing, and you use black box testing.
research_task:
  description: >
    Create all possible cases to test the game of Ultimate Texas Hold'em
  expected_output: >
    A list of test cases covering scenarios for 
    Royal Flush with payout 500 to 1,
    Straight Flush with payout 50 to 1,
    Four of a Kind with payout 10 to 1,
    Full House with payout 3 to 1,
    Flush with payout 3 to 2,
    Straight with payout 1 to 1,
    All other with payout Push
    
    The test cases should cover the following cases
    Dealer does not qualify and player wins
    Dealer does not qualify and player looses
    Dealer does not qualify and player tie
    Dealer does qualify and player wins
    Dealer does qualify and player looses
    Dealer does qualify and player tie
    Player folds
    The Dealer needs a pair to qualify
  agent: researcher
Close-up view of a colorful deck of poker cards
A vibrant deck of poker cards laid out on a table waiting for a game.

Implementing Pairwise Testing with the Second Agent


The second agent's purpose was to apply pairwise testing techniques to enhance the number of test cases generated from the comprehensive test plan created by the first agent.


Pairwise testing is a combinatorial method that examines the interactions between variable pairs. Research shows that this method can cut down on the number of test cases by 40%-90% while still covering most scenarios effectively. By programming this agent to analyze the variables from the test plan, it intelligently generated an optimal set of test cases, significantly reducing the execution time required.


The development of this dual-agent structure was a thrilling process. It demonstrated how AI can simplify intricate tasks and increase efficiency in software testing.


The second agent is the reporting_analyst is tasked with creating a comprehensive test case.

reporting_analyst:
  role: >
    Senior Software QA Analyst
  goal: >
    Create detailed test case based on the test design of the Ultimate Texas Hold'em
  backstory: >
    You're a meticulous analyst with a keen eye for detail.You use pair wise testing technique 
    to minimize test execution time and to minimise the risk of not discovering a defect.
reporting_task:
  description: >
    Review the test plan you got and create test cases in the format of a gameplay scenario.
    Make sure the report is detailed and contains any and all relevant information.
  expected_output: >
    Use pair wise test methodology to minimize test execution. The report should include
    the cards dealt to create the game scenario and the bet amount on Ante,Blind and Play at the 
    betting phases. Also we want scenarios for the following cases:
    Each player makes the two mandatory opening bets – an “ante” bet and a “blinds” bet
        Two cards are then dealt face down to the players and the dealer
        Once players have checked their cards they can choose to add on a “Play” 
        bet at a value of 3x or 4x the ante bet
        Players can also check and wait for the next betting round
        Dealer then deals 3 community cards face up on the table.
        If the player checked in the first betting round they can now make a Play bet worth 2x ante or can check again
        Once you’ve made the Play bet you can’t bet again
        After players have again bet or checked the dealer deals two more shared community cards in the middle of the table
        If player has yet to make a Play bet (checked twice) they must now either fold (lose both their ante and blinds bets) or bet 1x ante
  agent: reporting_analyst

In our crewAI environment, the LLM to utilize is the OpenAI model, gpt-4. Executing the crew creates its magic to output a series of test cases. The following is indicative of the generated results:


# Agent: Senior Software QA Engineer

## Final Answer: 

Test Plan to Test the Functionality of an Ultimate Texas Hold'em Game:


Test Case 1: 

Scenario: Royal Flush, payout 500:1

Action: Simulate a situation where the player lands a Royal Flush

Expected Outcome: Player's balance should increase by 500 times the initial bet


# Agent: Senior Software QA Analyst

## Final Answer: 

Test Case Scenario - Gameplay simulation:


Test Case 1:

Initiate a new game, set the ante and blind bets to $1 each. Two cards: Ace and king of hearts are dealt to the player and random two cards to the dealer. Player decides to place a play bet of $4, and the dealer deals 3 community cards (10, Queen, and Jack of hearts). The player achieves a Royal Flush, and the payout should be 500 to 1; hence a profit of $500 is expected.



# Agent: Senior Software QA Engineer

## Final Answer: 

Test Plan to Test the Functionality of an Ultimate Texas Hold'em Game:


Test Case 6: 

Scenario: Straight, payout 1:1

Action: Simulate a situation where the player draws a Straight 

Expected Outcome: Player's balance should equal the initial bet


# Agent: Senior Software QA Analyst

## Final Answer: 

Test Case Scenario - Gameplay simulation:


Test Case 6:

Another new game, $1 each are placed on the ante and blind bets. Two cards: 3 and 4 of hearts are dealt to the player. Player checks. Dealer reveals 3 community cards: 5,6 and 7 of spades. Player checks. Dealer reveals 2 more community cards: Queen and 2 of hearts. Player makes a play bet of $1 and gets a Straight. Outcome = $1 profit is expected.


To find out more about the multi agent platform visit crewai, and learn how to use it in https://www.deeplearning.ai


The Benefits of AI-Driven Testing


Integrating AI-driven multi-agent systems into the QA process brings several advantages. First, it drastically reduces the time spent on creating test plans and cases. Instead of manually sifting through numerous game scenarios, the agents worked efficiently, producing high-quality outputs in a fraction of the time.


Second, the precision offered by the agents ensures wider test coverage. Human testers are incredibly talented but may overlook specific combinations due to complexity. In my tests on Ultimate Texas Hold'em, employing AI agents helped cover 95% of all possible player actions and scenarios, significantly lowering the risk of missing critical components.


Additionally, automation lays the groundwork for future enhancements. With the foundation laid using CrewAI tools, my next goal is to introduce additional agents to enhance automation scripting. This expansion will enable continuous testing and real-time application monitoring.


Looking Ahead: Future Enhancements with Additional Agents


The journey does not stop with the two agents I have created. I envision incorporating more agents to enhance the crew to handle tasks like:

  • automation testing

  • performance testing

  • test results report analysis


By establishing a diverse crew of agents, the synergy among them is likely to create a robust framework that enhances QA processes while offering valuable insights into user experience and application performance.


Wrapping Up My AI Journey


My exploration of incorporating AI into software QA through multi-agent systems has been truly exhilarating. Early results from using CrewAI tools highlight the efficiency and accuracy a well-structured team of agents can bring to the testing process.


As I continue my adventure in this fast-evolving field, I encourage fellow enthusiasts, testers, and engineers to join me in uncovering the endless opportunities AI presents for the future of software QA!

 
 
 

Comments


bottom of page