Once CodiumAI generates a comprehensive test suite for your code, you can seamlessly execute the tests to determine their pass or fail status. The process of running the tests is conveniently facilitated within the CodiumAI panel, ensuring a smooth and efficient experience.
Note: Currently available only on VS Code editor.
Method 1: Use the "Run All Tests" button.
Clicking the "Run All Tests" button will execute the entire test suite in one go, meaning all the tests generated by the CodiumAI will be executed on a single click.
Example: Execute all the tests generated by CodiumAI for a function that adds two numbers and outputs the sum.
Method 2: Use the "Run" button.
You can use this method if you want to run the tests individually or execute some selected tests.
Example: Execute two selected tests from all the tests generated by CodiumAI for a function that takes two numbers and returns their sum.
After executing the tests using either of those two methods, you can see the outcome of each test case (whether the test passed or failed).
If your test passes, the status will display within a green colored box left to the "Run" button.
If your test failed, you can see the status in a red colored box. To access the error log, click on the drop-down icon located within it.
When a test fails
Several possible reasons exist if a test fails to meet the expected criteria. First, it could be due to the test code needing to accurately reflect the desired behavior or criteria. Alternatively, a failure may indicate the presence of a bug in your code that requires attention.
To address and rectify a failing test, CodiumAI provides several solutions.
Fix Code Issues
CodiumAI's TestGPT model goes beyond test execution and identification of test failures. It also can analyze your code for potential bugs or issues.
If TestGPT identifies a possible issue within your code, a "Possible Code Issue" button will be displayed, providing you with valuable insights. You can access a detailed explanation of the identified bug by clicking this button and receive guidance on effectively resolving it.Also, you can click the “Fix code” button to let CodiumAI fix the bug for you. After you click “Fix code” you can review the code diff, and merge the changes directly to your code.
By actively engaging with CodiumAI's test execution and analysis capabilities, you can verify the accuracy and reliability of your tests, ultimately bolstering the overall quality and robustness of your code.
The seamless integration of test execution, bug identification, and iterative improvement within the CodiumAI panel offers a comprehensive solution to ensure that your code meets the desired specifications and delivers reliable results.
Check out other features
Gain insights into the range of innovative features that CodiumAI brings to your development toolkit, all designed to ensure superior code integrity and efficiency.