{"id":14723,"date":"2026-11-28T22:23:41","date_gmt":"2026-11-28T16:53:41","guid":{"rendered":"https:\/\/aizolo.com\/blog\/?p=14723"},"modified":"2026-11-28T22:23:43","modified_gmt":"2026-11-28T16:53:43","slug":"generate-unit-tests-for-existing-code-using-ai","status":"publish","type":"post","link":"https:\/\/aizolo.com\/blog\/generate-unit-tests-for-existing-code-using-ai\/","title":{"rendered":"How to Generate Unit Tests for Existing Code Using AI"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Creating unit tests can be a labour intensive task. This is often the case for extensive code, and for both new and poorly documented functions. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Someone must comprehend a function, recognise what can be inputted and analyse boundary conditions before writing test scripts to confirm correctness of an output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Artificial intelligence is able to assess current functions and then recommend testing situations. It can also create test scripts which are compatible with testing frameworks including Pytest, Jest, Vitest and JUnit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To generate unit tests for existing code using AI, provide the relevant source code, explain its expected behavior, specify your testing framework, and ask AI to create tests for normal inputs, invalid values, and boundary conditions. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should then review and run the generated tests before adding them to your project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to use AI for unit test generation, with practical examples and reusable prompts for existing software projects.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-Generate-Unit-Tests-for-Existing-Code-Using-AI-1024x572.png\" alt=\"Current image: How to Generate Unit Tests for Existing Code Using AI\" title=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/572;\"><\/figure>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#why-generate-unit-tests-for-existing-code-using-ai\">Why Generate Unit Tests for Existing Code Using AI?<\/a><\/li><li><a href=\"#what-information-should-you-give-ai-before-generating-unit-tests\">What Information Should You Give AI Before Generating Unit Tests?<\/a><\/li><li><a href=\"#how-to-generate-unit-tests-for-existing-code-using-ai\">How to Generate Unit Tests for Existing Code Using AI<\/a><\/li><li><a href=\"#best-ai-prompts-for-generating-unit-tests\">Best AI Prompts for Generating Unit Tests<\/a><\/li><li><a href=\"#how-to-validate-ai-generated-unit-tests-before-using-them\">How to Validate AI-Generated Unit Tests Before Using Them<\/a><\/li><li><a href=\"#common-mistakes-to-avoid-when-generating-unit-tests-with-ai\">Common Mistakes to Avoid When Generating Unit Tests With AI<\/a><\/li><li><a href=\"#best-practices-for-ai-assisted-unit-test-generation\">Best Practices for AI-Assisted Unit Test Generation<\/a><\/li><li><a href=\"#frequently-asked-questions\">Frequently Asked Questions<\/a><\/li><li><a href=\"#conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 id=\"why-generate-unit-tests-for-existing-code-using-ai\" class=\"wp-block-heading\">Why Generate Unit Tests for Existing Code Using AI?<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"572\" data-src=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Why-Generate-Unit-Tests-for-Existing-Code-Using-AI-1024x572.png\" alt=\"Why Generate Unit Tests for Existing Code Using AI\" class=\"wp-image-14726 lazyload\" title=\"\" data-srcset=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Why-Generate-Unit-Tests-for-Existing-Code-Using-AI-1024x572.png 1024w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Why-Generate-Unit-Tests-for-Existing-Code-Using-AI-300x167.png 300w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Why-Generate-Unit-Tests-for-Existing-Code-Using-AI-768x429.png 768w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Why-Generate-Unit-Tests-for-Existing-Code-Using-AI-150x84.png 150w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Why-Generate-Unit-Tests-for-Existing-Code-Using-AI.png 1376w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/572;\" \/><figcaption class=\"wp-element-caption\">Why Generate Unit Tests for Existing Code Using AI<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Many applications will lack good unit testing for some of their functions. This can cause problems during development, enhancement and bug resolution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A function used in an on-line shop to calculate a discount could perform well for normal values.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, it may not work for cases where the discount percentage is zero, the value of the item for sale is negative or no value has been supplied.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each of these situations needs to be tested and so detailed examination must be undertaken.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">AI can help developers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Identify test scenarios:<\/strong> Suggest normal, invalid, and boundary inputs for existing functions.<\/li>\n\n\n\n<li><strong>Generate test code:<\/strong> Create test cases using the framework already used in the project.<\/li>\n\n\n\n<li><strong>Improve test coverage:<\/strong> Identify functions and branches that currently lack tests.<\/li>\n\n\n\n<li><strong>Find potential edge cases:<\/strong> Highlight unusual inputs that developers might overlook.<\/li>\n\n\n\n<li><strong>Reduce repetitive work:<\/strong> Generate initial test structures that developers can review and improve.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Although more tests can be created, it is important that they are testing for the correct functionality and not just running a function.<\/p>\n\n\n\n<h2 id=\"what-information-should-you-give-ai-before-generating-unit-tests\" class=\"wp-block-heading\">What Information Should You Give AI Before Generating Unit Tests?<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"572\" data-src=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/AI-unit-test-generation-1024x572.png\" alt=\"AI unit test generation\" class=\"wp-image-14727 lazyload\" title=\"\" data-srcset=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/AI-unit-test-generation-1024x572.png 1024w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/AI-unit-test-generation-300x167.png 300w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/AI-unit-test-generation-768x429.png 768w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/AI-unit-test-generation-150x84.png 150w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/AI-unit-test-generation.png 1376w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/572;\" \/><figcaption class=\"wp-element-caption\">AI unit test generation<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">AI tests are only as good as the information available. If a units behaviour, dependencies and the project&#8217;s norms are not known then the AI may generate inappropriate statements and unit test code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Information should be gathered before instructing the AI to produce unit tests.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Information<\/strong><\/td><td><strong>What to provide<\/strong><\/td><td><strong>Why it matters<\/strong><\/td><\/tr><tr><td>Source code<\/td><td>Function, method, or class<\/td><td>Identifies the code being tested<\/td><\/tr><tr><td>Expected behavior<\/td><td>Requirements and expected outputs<\/td><td>Establishes correct assertions<\/td><\/tr><tr><td>Programming language<\/td><td>Python, JavaScript, Java, etc.<\/td><td>Determines test syntax<\/td><\/tr><tr><td>Testing framework<\/td><td>Pytest, Jest, JUnit, etc.<\/td><td>Maintains project compatibility<\/td><\/tr><tr><td>Dependencies<\/td><td>External services, database calls, libraries<\/td><td>Helps identify mocking requirements<\/td><\/tr><tr><td>Existing tests<\/td><td>A representative test file<\/td><td>Maintains project conventions<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You should also explain any behavior that is not clear from the implementation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are working with an unfamiliar project, first understand the relevant files and dependencies. This is where <a href=\"https:\/\/aizolo.com\/blog\/ai-to-understand-an-unfamiliar-codebase\/\">using AI to understand an unfamiliar codebase<\/a> can help before you start generating tests.<\/p>\n\n\n\n<h2 id=\"how-to-generate-unit-tests-for-existing-code-using-ai\" class=\"wp-block-heading\">How to Generate Unit Tests for Existing Code Using AI<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"572\" data-src=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-Generate-Unit-Tests-for-Existing-Code-Using-AIlikj-1024x572.png\" alt=\"How to Generate Unit Tests for Existing Code Using AI\" class=\"wp-image-14728 lazyload\" title=\"\" data-srcset=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-Generate-Unit-Tests-for-Existing-Code-Using-AIlikj-1024x572.png 1024w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-Generate-Unit-Tests-for-Existing-Code-Using-AIlikj-300x167.png 300w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-Generate-Unit-Tests-for-Existing-Code-Using-AIlikj-768x429.png 768w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-Generate-Unit-Tests-for-Existing-Code-Using-AIlikj-150x84.png 150w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-Generate-Unit-Tests-for-Existing-Code-Using-AIlikj.png 1376w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/572;\" \/><figcaption class=\"wp-element-caption\">How to Generate Unit Tests for Existing Code Using AI<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A structured workflow helps developers generate tests without unnecessarily changing the original implementation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Select the Existing Function You Want to Test<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Concentrate on a single function or method and do not ask the AI to create tests for an entire application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, select a function which does something such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Validating user input.<\/li>\n\n\n\n<li>Calculating a product price.<\/li>\n\n\n\n<li>Formatting dates.<\/li>\n\n\n\n<li>Processing customer records.<\/li>\n\n\n\n<li>Checking account permissions.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For example, consider this Python function:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-border-color has-ast-global-color-2-border-color has-ast-global-color-7-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">def calculate_discount(price, discount):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;if price &lt; 0:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise ValueError(&#8220;Price cannot be negative&#8221;)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;if discount &lt; 0 or discount &gt; 100:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise ValueError(&#8220;Invalid discount&#8221;)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;return price &#8211; (price * discount \/ 100)<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">It can also calculate a reduced cost and will not allow a negative cost or percentage reduction.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As mentioned above, this is a good place to begin as it is reasonably straightforward to comprehend and test.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Explain the Expected Behavior to AI<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Prior to writing test scripts, ensure that the AI understands the function and its purpose.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not all business needs can be conveyed through a functional implementation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, the expected behavior might include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A 10% discount reduces the price by 10%.<\/li>\n\n\n\n<li>A zero discount returns the original price.<\/li>\n\n\n\n<li>A 100% discount returns zero.<\/li>\n\n\n\n<li>Negative prices must raise a ValueError.<\/li>\n\n\n\n<li>Discount percentages below zero or above 100 must raise a ValueError.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Ask the AI system to highlight any missing requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is significant as a test can be successful yet test the wrong business rule.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Ask AI to Identify Test Scenarios<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Prior to asking for test code, ask an AI to provide test situations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Potential situations for the discount feature are:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Scenario<\/strong><\/td><td><strong>Input<\/strong><\/td><td><strong>Expected result<\/strong><\/td><\/tr><tr><td>Normal discount<\/td><td>Price: 100, Discount: 10<\/td><td>90<\/td><\/tr><tr><td>Zero discount<\/td><td>Price: 100, Discount: 0<\/td><td>100<\/td><\/tr><tr><td>Full discount<\/td><td>Price: 100, Discount: 100<\/td><td>0<\/td><\/tr><tr><td>Negative price<\/td><td>Price: -100, Discount: 10<\/td><td>ValueError<\/td><\/tr><tr><td>Negative discount<\/td><td>Price: 100, Discount: -5<\/td><td>ValueError<\/td><\/tr><tr><td>Excessive discount<\/td><td>Price: 100, Discount: 110<\/td><td>ValueError<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Review these scenarios before generating the actual tests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This separates test planning from test implementation and makes incorrect assumptions easier to identify.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Specify the Existing Testing Framework<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Tell AI which framework your project already uses.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pytest:<\/strong> Commonly used for Python testing.<\/li>\n\n\n\n<li><strong>Jest:<\/strong> Used for testing JavaScript applications.<\/li>\n\n\n\n<li><strong>Vitest:<\/strong> A JavaScript and TypeScript testing framework.<\/li>\n\n\n\n<li><strong>JUnit:<\/strong> Used for Java applications.<\/li>\n\n\n\n<li><strong>xUnit:<\/strong> Used for .NET applications.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t create a new testing structure unless it is advised to by AI.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instruct AI to utilise the current structures, naming, test cases and assertion methods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Generate the Unit Test Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have analysed the test scenarios, request that AI creates tests based on the chosen framework.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below are tests for the Python function which provides a discount, created using Pytest:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-border-color has-ast-global-color-2-border-color has-ast-global-color-7-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">import pytest<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">def test_calculate_discount():<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;assert calculate_discount(100, 10) == 90<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">def test_zero_discount():<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;assert calculate_discount(100, 0) == 100<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">def test_full_discount():<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;assert calculate_discount(100, 100) == 0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">def test_negative_price():<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;with pytest.raises(ValueError):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;calculate_discount(-100, 10)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">def test_negative_discount():<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;with pytest.raises(ValueError):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;calculate_discount(100, -5)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">def test_discount_above_100():<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;with pytest.raises(ValueError):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;calculate_discount(100, 110)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Normal, edge and abnormal data can all be tested.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Rather than just testing that a function works, particular outputs and exceptional circumstances can also be tested.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Run the Generated Tests<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After reviewing the generated code, run it using your project&#8217;s existing test command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Pytest:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-border-color has-ast-global-color-2-border-color has-ast-global-color-7-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">pytest test_discount.py -v<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Jest:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">npm test &#8212; &#8211;run<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For JUnit projects, use the existing Maven or Gradle test command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Which tests passed?<\/li>\n\n\n\n<li>Which tests failed?<\/li>\n\n\n\n<li>Were any tests skipped?<\/li>\n\n\n\n<li>Did the tests execute the intended function?<\/li>\n\n\n\n<li>Were the expected values correct?<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">When a test is failing then analyse to determine if the issue is due to the test, the testers expectations or a code implementation issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid making arbitrary changes to the code just to make AI generated tests pass.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Review Coverage and Improve Missing Scenarios<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once the initial tests pass, inspect the code coverage report if your framework supports coverage measurement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-border-color has-ast-global-color-2-border-color has-ast-global-color-7-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">pytest &#8211;cov=discount &#8211;cov-report=term-missing<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Code coverage can be used to highlight un-run code and sub-routines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Even if high code coverage is achieved, there is no guarantee that the tests are valid. Investigate if the test assertions are assessing relevant functionality and whether they will successfully identify a wrong result.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Further develop the test set to validate extra requirements, edge cases, or faults.<\/p>\n\n\n\n<h2 id=\"best-ai-prompts-for-generating-unit-tests\" class=\"wp-block-heading\">Best AI Prompts for Generating Unit Tests<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"572\" data-src=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-test-existing-functions-using-AIcs-1024x572.png\" alt=\"How to test existing functions using AI\" class=\"wp-image-14729 lazyload\" title=\"\" data-srcset=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-test-existing-functions-using-AIcs-1024x572.png 1024w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-test-existing-functions-using-AIcs-300x167.png 300w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-test-existing-functions-using-AIcs-768x429.png 768w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-test-existing-functions-using-AIcs-150x84.png 150w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-test-existing-functions-using-AIcs.png 1376w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/572;\" \/><figcaption class=\"wp-element-caption\">How to test existing functions using AI<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Clear prompts help AI understand the existing implementation and follow your project&#8217;s testing conventions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are three reusable prompts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prompt 1: Generate Unit Tests for an Existing Function<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote has-border-color has-white-border-color has-ast-global-color-7-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Act as an experienced software testing engineer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Analyze the following existing function and generate<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">unit tests for its current behavior.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Programming language: [Language]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Testing framework: [Framework]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Source code:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[Paste the function]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Expected behavior:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[Explain the requirements]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generate tests covering:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Normal inputs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Invalid inputs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Boundary conditions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Empty or missing values where relevant.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5. Expected exceptions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Follow the existing framework conventions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not modify the original implementation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not invent undocumented requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use explicit expected values in assertions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Explain any assumptions before generating tests.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Prompt 2: Identify Missing Test Cases<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote has-border-color has-white-border-color has-ast-global-color-7-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Review the following existing unit tests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Source function:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[Paste source code]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Existing tests:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[Paste test code]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Identify:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Missing test scenarios.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Uncovered boundary conditions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Invalid input cases.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Missing exception checks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5. Incorrect or weak assertions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Suggest additional tests without changing<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">the existing implementation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not assume behavior that is not documented.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Prompt 3: Review AI-Generated Unit Tests<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote has-border-color has-white-border-color has-ast-global-color-7-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Act as a senior test engineer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Review the following AI-generated unit tests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Source code:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[Paste original function]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generated tests:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[Paste test code]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Evaluate:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Whether each assertion checks expected behavior.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Whether expected values are independent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Whether edge cases are covered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Whether mocks are appropriate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5. Whether tests depend on external services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">6. Whether any tests are redundant.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Identify incorrect assumptions and suggest improvements without weakening assertions.<\/p>\n<\/blockquote>\n\n\n\n<h2 id=\"how-to-validate-ai-generated-unit-tests-before-using-them\" class=\"wp-block-heading\">How to Validate AI-Generated Unit Tests Before Using Them<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"572\" data-src=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-1024x572.png\" alt=\"How to generate test cases from existing code\" class=\"wp-image-14730 lazyload\" title=\"\" data-srcset=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-1024x572.png 1024w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-300x167.png 300w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-768x429.png 768w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-150x84.png 150w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code.png 1376w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/572;\" \/><figcaption class=\"wp-element-caption\">How to generate test cases from existing code<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Generated tests are to be considered as preliminary and must be reviewed and run.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before tests can be approved, the following criteria should be met.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Check expected values<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure that the expected test outcome is based on either a requirement or a separately confirmed calculation. Do not calculate the expected result using the function under test.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Check boundary conditions<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Test key and boundary values. For instance, where a function is designed to take a percentage (between 0 and 100), test it using 0, 100, -1 and 101.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Check exception handling<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure that incorrect data generates the appropriate exceptions or error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Review mocks<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mocks should simulate external dependencies but not the functionality that is being tested by the unit test.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5. Run tests independently<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Tests should not be affected by sequence, state or external services, unless this is specifically desired.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6. Review the implementation separately<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If a generated test identifies a potential problem then the code should be analysed. The test should not be modified to allow the test to pass.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For functions involving external APIs, keep the testing scope separate from integration troubleshooting. If the problem is an API request or response failure, <a href=\"https:\/\/aizolo.com\/blog\/debug-api-integration-errors-using-ai\/\">debugging API integration errors using AI<\/a> is a more appropriate workflow.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">According to Google&#8217;s <a href=\"https:\/\/google.github.io\/googletest\/primer.html\" target=\"_blank\" rel=\"noreferrer noopener\">GoogleTest documentation<\/a>, effective tests should be independent, repeatable, well-organized, and provide useful failure information.<\/p>\n\n\n\n<h2 id=\"common-mistakes-to-avoid-when-generating-unit-tests-with-ai\" class=\"wp-block-heading\">Common Mistakes to Avoid When Generating Unit Tests With AI<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"572\" data-src=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Unit-testing-existing-coded-1024x572.png\" alt=\"Unit testing existing code\" class=\"wp-image-14731 lazyload\" title=\"\" data-srcset=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Unit-testing-existing-coded-1024x572.png 1024w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Unit-testing-existing-coded-300x167.png 300w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Unit-testing-existing-coded-768x429.png 768w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Unit-testing-existing-coded-150x84.png 150w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/Unit-testing-existing-coded.png 1376w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/572;\" \/><figcaption class=\"wp-element-caption\">Unit testing existing code<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Mistake<\/strong><\/td><td><strong>Why it causes problems<\/strong><\/td><td><strong>Better approach<\/strong><\/td><\/tr><tr><td>Providing incomplete code<\/td><td>AI may misunderstand dependencies<\/td><td>Include relevant context<\/td><\/tr><tr><td>Skipping expected behavior<\/td><td>Tests may encode incorrect assumptions<\/td><td>Explain requirements first<\/td><\/tr><tr><td>Testing only normal inputs<\/td><td>Important edge cases remain uncovered<\/td><td>Include invalid and boundary values<\/td><\/tr><tr><td>Ignoring existing conventions<\/td><td>Generated tests may not fit the project<\/td><td>Specify the current framework<\/td><\/tr><tr><td>Trusting generated assertions<\/td><td>Incorrect tests can pass<\/td><td>Review expected values<\/td><\/tr><tr><td>Accepting high coverage as proof<\/td><td>Executed lines do not guarantee correct behavior<\/td><td>Evaluate assertion quality<\/td><\/tr><tr><td>Changing implementation automatically<\/td><td>Can introduce unrelated changes<\/td><td>Keep test generation separate<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"best-practices-for-ai-assisted-unit-test-generation\" class=\"wp-block-heading\">Best Practices for AI-Assisted Unit Test Generation<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"572\" data-src=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-2-1024x572.png\" alt=\"How to generate test cases from existing code\" class=\"wp-image-14732 lazyload\" title=\"\" data-srcset=\"https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-2-1024x572.png 1024w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-2-300x167.png 300w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-2-768x429.png 768w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-2-150x84.png 150w, https:\/\/aizolo.com\/blog\/wp-content\/uploads\/2026\/11\/How-to-generate-test-cases-from-existing-code-2.png 1376w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/572;\" \/><figcaption class=\"wp-element-caption\">How to generate test cases from existing code<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To make the workflow reliable:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start with one function or module.<\/li>\n\n\n\n<li>Use documented behavior as the source of truth.<\/li>\n\n\n\n<li>Ask AI to propose scenarios before writing test code.<\/li>\n\n\n\n<li>Reuse the project&#8217;s existing framework and conventions.<\/li>\n\n\n\n<li>Keep test generation separate from implementation changes.<\/li>\n\n\n\n<li>Review every assertion and expected result.<\/li>\n\n\n\n<li>Run targeted tests before the complete related suite.<\/li>\n\n\n\n<li>Inspect test coverage to identify missing branches.<\/li>\n\n\n\n<li>Avoid sharing credentials, private keys, or sensitive production data with unapproved AI services.<\/li>\n\n\n\n<li>Keep generated tests under version control and review changes before merging.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Whilst it is not our aim to produce the biggest test suite, we want to produce a targeted one that allows us to be confident in our code.<\/p>\n\n\n\n<h2 id=\"frequently-asked-questions\" class=\"wp-block-heading\"><strong>Frequently Asked Questions<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Can AI generate unit tests for existing code?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. AI can analyse features and processes and even produce test scripts in a range of testing tools including Pytest, Jest, Vitest and JUnit. Developers should define the required functionality and assess the assertion statements that have been created by the AI.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Can ChatGPT write unit tests for Python code?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. You can describe a Python function and then ask for unit testing using either Pytest or Python\u2019s unittest. Please also specify typical, incorrect and edge cases along with the exceptions that are anticipated so that the tests are as informative as possible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Which AI tools can generate unit tests?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">GitHub Copilot and other AI can be used to write unit tests. This will vary according to the AI and development environment. Ensure you select an option which is compatible with both your language and test environment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Does AI-generated unit testing improve code coverage?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">AI is able to also generate test cases for new functions and sub-functions. Despite this, code coverage only highlights sections of code that have been run and does not confirm that the assertions are valid, nor that all critical functionality has been assessed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Should AI-generated unit tests be reviewed manually?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Developers should analyse the test outcomes, statements and mock data. AI can incorrectly interpret business rules and can also create tests which replicate a developers flawed code. It is vital that tests are executed and analysed prior to them being integrated.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Can AI generate unit tests for JavaScript and Java?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. AI can also be used to create test files for JavaScript using tools including Jest and Vitest or for Java using JUnit. Define the required language, tool and current project standards along with the anticipated functionality to create suitable tests.<\/p>\n\n\n\n<h2 id=\"conclusion\" class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unit tests can be automatically produced and this can assist in reducing time spent on test production.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It can also help people to think of additional situations to test.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Producing suitable source code and describing the anticipated functionality will allow AI to produce test situations.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Appropriate tests can then be generated and executed to confirm each test passes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Although AI can assist in producing unit tests, it is still up to people to ensure that the tests do in fact test the correct functionality.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A succinct and thoroughly assessed set of tests is more beneficial than an extensive but superficially complete set.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Author: Anshika Verma<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anshika Verma is a content researcher and writer focused on researching AI tools, models, and creator technologies. She writes practical guides that help readers understand AI applications and use them more effectively.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating unit tests can be a labour intensive task. This is often the case for extensive code, and for both [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":14724,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_wpepp_content_lock_enabled":"","_wpepp_content_lock_action":"","_wpepp_content_lock_header":"","_wpepp_content_lock_redirect":"","_wpepp_content_lock_expiry":"","_wpepp_content_lock_show_excerpt":"","_wpepp_content_lock_excerpt_text":"","_wpepp_conditional_display_enable":"","_wpepp_conditional_control_title":"","_wpepp_conditional_device_type":"","_wpepp_conditional_time_start":"","_wpepp_conditional_time_end":"","_wpepp_conditional_date_start":"","_wpepp_conditional_date_end":"","_wpepp_conditional_recurring_time_start":"","_wpepp_conditional_recurring_time_end":"","_wpepp_conditional_url_parameter_key":"","_wpepp_conditional_url_parameter_value":"","_wpepp_conditional_referrer_source":"","_wpepp_conditional_display_condition":"user_logged_out","_wpepp_conditional_action":"hide","_wpepp_conditional_control_featured_image":"yes","_wpepp_conditional_control_comments":"yes","_wpepp_conditional_notice_enable":"yes","_wpepp_content_lock_message":"","_wpepp_conditional_notice_text":"This content is not available.","_wpepp_content_lock_roles":[],"_wpepp_conditional_user_role":[],"_wpepp_conditional_day_of_week":[],"_wpepp_conditional_recurring_days":[],"_wpepp_conditional_post_type":[],"_wpepp_conditional_browser_type":[],"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14723","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/posts\/14723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/comments?post=14723"}],"version-history":[{"count":3,"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/posts\/14723\/revisions"}],"predecessor-version":[{"id":14734,"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/posts\/14723\/revisions\/14734"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/media\/14724"}],"wp:attachment":[{"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/media?parent=14723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/categories?post=14723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aizolo.com\/blog\/wp-json\/wp\/v2\/tags?post=14723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}