<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Diffblue on Medium]]></title>
        <description><![CDATA[Stories by Diffblue on Medium]]></description>
        <link>https://medium.com/@diffbluehq?source=rss-799c69117a12------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WUAon5qZKI4nNv0AH2UmlQ.png</url>
            <title>Stories by Diffblue on Medium</title>
            <link>https://medium.com/@diffbluehq?source=rss-799c69117a12------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 15:45:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diffbluehq/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Overcoming Hallucinations: Combining LLMs with Code Execution — Diffblue]]></title>
            <link>https://diffbluehq.medium.com/overcoming-hallucinations-combining-llms-with-code-execution-diffblue-91859d0f6b00?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/91859d0f6b00</guid>
            <category><![CDATA[ai-software-testing]]></category>
            <category><![CDATA[unit-testing-tools]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[continuous-testing]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Wed, 23 Apr 2025 15:14:27 GMT</pubDate>
            <atom:updated>2025-04-23T15:14:27.166Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overcoming Hallucinations: Combining LLMs with Code Execution — Diffblue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YwapZ1Qbae3iBLnb.jpg" /></figure><p>In our first article, we discussed the critical role of accuracy in AI-driven software engineering. Conventional large language models (LLMs) can generate code that looks correct but often lacks true reliability, making it unsuitable for mission-critical enterprise applications. The need for higher accuracy has led many researchers to question whether pure neural network approaches can ever attain the consistent correctness that enterprise environments require. This second installment explores the challenges and potential solutions for achieving higher accuracy in AI-driven software engineering.</p><h3>The Limits of LLM-Only Approaches</h3><p>Today’s LLM-based coding assistants (like GitHub Copilot, Amazon Q Developer, or Devin) demonstrate both the power and the limits of pure neural approaches. They excel at <strong>pattern recognition</strong> — for instance, scanning a codebase and writing a new function in a similar style, or integrating known API calls correctly. They can rapidly produce boilerplate code or suggest solutions that would take a human considerable time to recall or write from scratch. This strength comes from their training: by ingesting millions of code examples, LLMs become very good at guessing what “looks right” in a given context.</p><p>However, that very same mechanism is also why they can’t always be trusted to get the details right. Some of their limitations include:</p><ol><li><strong>Hallucinations:</strong> Because LLMs rely on statistical patterns, they sometimes fabricate code, create non-existent library calls, or reference API endpoints that simply do not exist.</li><li><strong>No Inherent Correctness Verification:</strong> An LLM’s internal architecture cannot <em>execute</em> or test its own output. It provides best guesses based on textual patterns, not actual runtime outcomes.</li><li><strong>Lack of Semantic Grounding:</strong> Even though LLMs appear to “understand” code, their comprehension is probabilistic, not grounded in the formal rules and behaviors of programming languages.</li></ol><p>An LLM has no innate sense of the intent behind the code beyond what it infers probabilistically. It doesn’t truly “know” the rules of the runtime environment or the exact semantics of every API; it approximates them. As a result, every output from an LLM-based coder needs human scrutiny and testing. If an AI tool saves you typing time but still demands that you meticulously debug its work, the net productivity gains shrink dramatically. The major obstacle in front of scalability is the need for human involvement.</p><h3>Hybrid AI Approaches for Higher Accuracy</h3><p>Key strategies to overcome the limitations of LLMs include hybrid approaches that combine generative AI with other techniques to ensure code correctness. These include:</p><ol><li><strong>Reinforcement Learning (RL)</strong>Reinforcement learning is a machine-learning paradigm where an agent learns by receiving feedback (rewards or penalties) on its actions. In software engineering, an AI model can generate a snippet of code, execute it (or test it), and then receive a score based on the results-did the code compile, pass all test cases, or produce the correct output? This loop provides real-world correctness signals into the model’s learning process. Over multiple iterations, the AI adjusts its parameters to maximize its reward, effectively internalizing best coding practices and minimizing hallucinations.</li><li><strong>Integrating Code Execution (CE): </strong>Code execution is the ultimate arbiter in the development cycle. By running the generated code in a sandbox (or code executor), the AI can see, unambiguously, whether a snippet fails or succeeds at a task. This allows for automated debugging: the system can discard or revise failing candidates and move toward a correct version. Practically, this might involve generating multiple solution candidates, executing each against unit tests, and selecting (or refining) the best-performing outputs. Because many enterprise codebases have test suites already, integration with an AI that runs tests autonomously is straightforward in principle (though still complex in practice).</li><li><strong>Why the Hybrid Approach Matters</strong>Relying purely on neural networks to perform high-accuracy code analysis creates a “Munchausen Trilemma”-they need to be accurate in the first place just to verify their own correctness. It may not even be desirable to use neural networks for this as they are computationally highly inefficient. For instance, training an LLM to do arithmetic is less practical than having it generate a small program to compute the result directly. Consequently, combining optimized analysis techniques (e.g., static or symbolic analysis) with neural networks is a more sustainable way to achieve the necessary level of accuracy in code analysis.Combined RL and CE transform code generation into an iterative, self-correcting process. Instead of passively relying on an LLM’s “one-shot” guess, the AI actively <em>tests</em> each hypothesis and <em>learns</em> from mistakes. This drastically reduces hallucinations and lifts accuracy closer to the 95% mark. As we will see in the next section, real-world evidence from solutions like <strong>Diffblue Cover</strong> proves how effective hybrid approaches can be.</li></ol><h3>The importance of Code Execution for building coding agents</h3><p>Diffblue Cover currently has &gt;95% accuracy (in our <a href="https://www.diffblue.com/diffblue-cover-vs-github-copilot-evaluating-ai-for-java-unit-testing-at-scale/">Copilot study</a>, it was even &gt;99%) in the unit test generation task, thanks to its use of a Code Execution-based approach married with Reinforcement Learning (RL).</p><p>RL is automated learning from feedback received on the output. Its purpose is to inject ground truth into the learning process. Thus, reinforcement learning results in highly accurate systems when the feedback reflects correctness. We achieve this through Code Execution, which perfectly reflects what the code is doing.</p><p>Here’s how it works in simplified terms:</p><ol><li><strong>Initial Code Generation:</strong> A baseline initial test candidate is created for each method after analysing the byte code of your project. Reinforcement learning selects the best inputs to identify all testable pathways and to select the best inputs to write mocks and assertions</li><li><strong>Execution and Feedback:</strong> The proposed tests are then executed against the actual code. If tests fail or do not compile, Cover receives a clear signal that its proposal is incorrect or incomplete.</li><li><strong>Reinforcement Learning Loop:</strong> Based on the failures, Cover refines its approach, gradually reaching a test that reliably passes. Over hundreds of computationally efficient iterations, the AI “learns” how to construct high-quality, logically consistent unit tests.</li></ol><p>Executing the code of real projects is hard because the entire project and its dependencies need to be available, which in turn requires understanding the project’s build system, etc.</p><p>This is a complex, language-specific engineering problem that Diffblue solved for Java.</p><p>Our internal benchmarks have shown that once integrated into a continuous integration (CI) pipeline, Cover can handle test generation for large-scale Java projects with minimal human oversight. This is a stark contrast to purely neural approaches that might generate plausible test syntax but fail when run, or omit crucial edge cases.</p><h3>Practical Challenges</h3><p>Despite its potential, implementing Code Execution+Reinforcement Learning at scale is not easy. Below are some challenges we have encountered and effectively answered at Diffblue.</p><ul><li><strong>Engineering Complexity:</strong> Building robust code executors is labor-intensive. It requires deep expertise in compilers, build systems, and runtime environments, which many AI startups lack.</li><li><strong>Computational Overhead:</strong> Running code repeatedly for RL feedback is time-consuming, particularly in large projects with an extensive suite of tests and dependencies. A high-performance infrastructure is necessary to handle the load efficiently.</li><li><strong>Edge Cases and Toolchain Diversity:</strong> Code execution must consider different frameworks, dependencies, and project structures.</li><li><strong>Maintenance and Continuous Learning:</strong> Reinforcement learning systems don’t automatically remain accurate when projects evolve. Therefore, continuous training and updates are necessary, as are stable budgets and specialized staff.</li></ul><p>For enterprises that recognize the value of reliable AI, bridging LLMs with RL and CE is the only viable path to the levels of accuracy that can deliver breakthrough productivity gains. This approach directly tackles the trust issue by allowing AI to correct its own hallucinations instead of relying on human intervention. In the <a href="https://www.diffblue.com/resources/towards-autonomous-ai-coding-agents-the-future-of-software-development/">next article</a>, we’ll explore how Diffblue uses reinforcement learning and code execution to virtually eliminate hallucinations in unit test generation.</p><p><em>Originally published at </em><a href="https://www.diffblue.com/resources/overcoming-hallucinations-combining-llms-with-code-execution/"><em>https://www.diffblue.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91859d0f6b00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Trust Problem in AI-Driven Software Development & What To Do About It — Diffblue]]></title>
            <link>https://diffbluehq.medium.com/the-trust-problem-in-ai-driven-software-development-what-to-do-about-it-diffblue-de0e76611d70?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/de0e76611d70</guid>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Wed, 23 Apr 2025 15:12:35 GMT</pubDate>
            <atom:updated>2025-04-23T15:12:35.706Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Trust Problem in AI-Driven Software Development &amp; What To Do About It — Diffblue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pOHPGd3ip4W2Bf6V.jpg" /></figure><p>Enterprises are rapidly adopting AI-powered tools to accelerate software development. Over <strong>50,000 organizations,</strong> including major tech companies and financial institutions, have adopted GitHub Copilot as of 2024. Surveys show that about <strong>70–76% of developers</strong> are either using or planning to use AI in their development process.</p><p>Despite their widespread use, coding assistants often generate code that appears plausible but is not always factually correct or ready for production. Inaccuracies in AI-generated code can trigger a cascade of time-consuming reviews, debugging sessions, and manual rework removing productivity gains that AI promises.</p><p>In many enterprise environments, code errors impact deployment pipelines, inflate operational costs, and erode trust in the entire AI initiative. Going against the very purpose of automation, engineers end up second-guessing every generated line of code.</p><p>Consequently, there is a growing consensus that near-flawless (95%+ or higher) accuracy in AI coding tools is essential for real productivity gains. In this article, we examine why existing solutions remain insufficient and make the case for higher accuracy not only being beneficial but also imperative.</p><h3>Shortcomings of Current LLM Solutions</h3><p>AI coding assistants like GitHub Copilot have become the preferred choice for many developers looking for quick coding shortcuts. These tools can suggest code completions in real time, generate and debug code, answer technical questions, and provide contextual recommendations within IDEs. That said, the accuracy of these tools is a preoccupying question for the same developers. For instance, in Stackoverflow’s 2024 Developer Survey, 31% of the professional developers shared their distrust towards the accuracy of AI tools, whereas 68% of respondents showed a lack of trust in the output or answer as the number one challenge with AI at work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0fi5uvl8Lye9v0bMyM1iw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bcO4W6iFR8kSBa6TUOIIjw.png" /></figure><p>The gap between plausible and correct output is frequently called “hallucination”. This term refers to the situation where an AI model, as essentially pattern-recognition systems, can produce confident but incorrect or misleading information or outputs that appear plausible but are not grounded in the reality of the provided context. When these hallucinations make it to the production code, they introduce defects that are difficult to track down. As a result, any time saved up front by auto-generating code is often lost on the back end in rework and testing. While LLMs are the first step into automated programming, they can’t consistently deliver code at the quality level needed for mission-critical software today.</p><p>We will use the following definitions of the terms correct and accurate:</p><p><strong>We call a piece of software code correct if it does what the human intended</strong>. Humans need to be convinced that the software is correct through evidence; this includes:</p><ul><li>code is well-structured/architected and documented,</li><li>code compiles,</li><li>code is tested.</li></ul><p><strong>A coding agent is accurate if it produces correct output</strong>. A coding agent hallucinates if it produces incorrect output. The output produced by an accurate coding agent does not require manual rework by a human.</p><p>Depending on the software engineering task, convincing a human of the code’s correctness can vary between relatively easy (e.g. writing regression tests, refactoring — if something breaks, it is definitely wrong) and very hard (e.g. implementing features (aka validation, “building the right product”).</p><p>Practically, tests provide the strongest correctness argument and are thus the basis of most software engineering tasks. Hence, an accurate coding agent must be accurate at writing tests to convince humans.</p><p>Accuracy is the fundamental driver of productivity and trust for development teams. When AI-generated code works reliably out of the box, teams experience immediate benefits. They save time on boilerplate tasks, reduce debugging overhead, and can focus more on strategic or creative initiatives. In fact, one study reported that developers using code generation tools in production could complete tasks up to <strong>55% faster</strong> -but only when they did not have to second-guess and extensively rewrite the suggestions.</p><p>By contrast, even a modest error rate can quickly remove any productivity advantage. Engineers who spot an error in AI-generated code are forced to verify every subsequent suggestion. This constant context switching, evaluating uncertain suggestions, reverting changes, and searching for accurate snippets, negates the efficiency gains that lead enterprises to adopt AI in the first place. Subsequently, adoption levels suffer when developers lose confidence in the accuracy of the AI assistants. No matter how impressive the potential feature set is, organizations would find themselves at square one if the solution remains unused.</p><p>As such, high accuracy improves day-to-day effectiveness and is the prerequisite for whether AI-driven software development delivers on its promise.</p><h3>Accuracy as a Competitive Advantage</h3><p>Software teams must consider accuracy is one of the most essential criteria for evaluating AI tools. Low accuracy undermines productivity gains and causes more problems than it solves. Yet existing LLM-driven tools <a href="https://github.blog/news-insights/research/research-quantifying-github-copilots-impact-in-the-enterprise-with-accenture/">still hover at a 50–65% success threshold</a> which is far below what is necessary to transform enterprise development at scale. Overcoming this challenge calls for a fundamentally different approach.</p><p>In our next article, <strong>“</strong><a href="https://www.diffblue.com/resources/overcoming-hallucinations-combining-llms-with-code-execution/">Overcoming Hallucinations: Combining LLMs with Code Execution</a>, <strong>“</strong> we will explore how advanced techniques can push accuracy levels to 95% and beyond.</p><p>Specifically, we will look at how deterministic methods like code execution-combined with the adaptive capabilities of reinforcement learning-allow AI systems to <em>verify</em> their own output and learn from mistakes.</p><p><em>Originally published at </em><a href="https://www.diffblue.com/resources/the-trust-problem-in-ai-driven-software-development-what-to-do-about-it/"><em>https://www.diffblue.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de0e76611d70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the Basics: Code Coverage and Test Coverage explained — Diffblue]]></title>
            <link>https://diffbluehq.medium.com/beyond-the-basics-code-coverage-and-test-coverage-explained-diffblue-6b2b6120d479?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b2b6120d479</guid>
            <category><![CDATA[ai-testing]]></category>
            <category><![CDATA[aiops]]></category>
            <category><![CDATA[coverage]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[unit-testing]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Thu, 13 Mar 2025 18:13:52 GMT</pubDate>
            <atom:updated>2025-03-13T18:13:52.394Z</atom:updated>
            <content:encoded><![CDATA[<h3>Beyond the Basics: Code Coverage and Test Coverage explained — Diffblue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CsFhc3T5QsTSRMq7.png" /></figure><p>Code and test coverage metrics play a crucial role in assessing the quality of your automated tests. Whether you’re working on a legacy application or developing a new feature, measuring the coverage of your tests gives insight into how thoroughly your code is being tested.</p><p>Code and test coverage metrics are often misunderstood or conflated, but understanding the difference between them and how to leverage them will ensure that your application is robust and less prone to bugs.</p><p>In this guide, we’ll explore code coverage and test coverage, their importance, key differences, best practices for achieving high levels of coverage, and how solutions like Diffblue Cover can automate this process to ensure high-quality results.</p><h3>What Is Code Coverage?</h3><p>Code coverage is a quantitative metric used to measure the percentage of our source code executed by automated tests. As a white-box testing approach, it focuses on the internal structure of the code, making it especially useful in unit testing. Code coverage helps developers identify untested parts of their codebase.</p><p>A higher code coverage percentage generally boosts confidence that your code is thoroughly tested. However, high coverage alone doesn’t guarantee quality; the quality and relevance of the tests themselves are equally important. By pinpointing untested areas, code coverage guides developers in creating additional test cases, helps identify dead code, and ultimately supports a more robust and well-maintained codebase.</p><h3>Types of Code Coverage</h3><p>There are several types of code coverage, each measuring different aspects of your code’s execution. The most common are:</p><ul><li><strong>Line coverage</strong>: Measures the percentage of lines executed by the test cases. For example, if your test suite executes 80 out of 100 lines, you have 80% line coverage.</li><li><strong>Branch</strong> <strong>coverage</strong>: Measures the percentage of decision-making branches (i.e., if, else, switch statements) that are executed. It ensures that all logical paths are tested.</li></ul><p><strong>Method coverage</strong>: Measures the percentage of methods that are invoked during testing. It helps ensure that tests are at least triggering every method in your code.</p><h3>How to Measure Code Coverage in Java</h3><p>In Java, you can use tools like JaCoCo or Cobertura to measure code coverage. These tools integrate with build tools like Maven or Gradle, and provide detailed reports on which parts of your code were executed during the test run.</p><p>JaCoCo is the de facto standard tool, as Cobertura hasn’t received any updates since 2015. That’s why we focus on a simple example of how to measure coverage using JaCoCo in a Maven project:</p><p><strong>Step 1</strong>: Add the JaCoCo plugin to your pom.xml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0LEe9u-hDv5TArZeKWTPjQ.png" /></figure><p><strong>Step 2: </strong>run your tests with</p><pre>mvn test</pre><p><strong>Step 3</strong>: Open the generated HTML in target/site/jacoco/index.html report showing which lines and branches of your code were covered by the tests:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/0*x6Puj8IgZfHGf_MU.png" /></figure><p>Furthermore, JaCoCo generates a jacoco.exec file in the target folder that can be used in various CI pipelines to integrate the code coverage information with a pipeline overview.</p><h3>What is Test Coverage?</h3><p>Test coverage is a qualitative measure that assesses how thoroughly the software’s functionality and requirements are tested. Put another way, test coverage measures how well your tests cover different scenarios or requirements.</p><p>It’s a broader term that goes beyond the simple execution of code. Test coverage examines whether your tests check for all possible conditions, edge cases, and functionalities, ensuring that your application behaves as expected under various circumstances.</p><h3>Types of Test Coverage</h3><p>Several types of test coverage are important to consider, including:</p><ul><li><strong>Functional coverage</strong>: Ensures that all functions of the application are covered by tests, meaning the tests validate that the system meets its functional requirements.</li><li><strong>Scenario-based coverage:</strong> Tests the system’s behavior under different use-case scenarios. It helps identify if all business-critical workflows are thoroughly tested.</li><li><strong>Edge-case coverage:</strong> Ensures that unusual or boundary conditions (e.g., empty inputs, negative numbers) are tested. These cases often uncover unexpected bugs.</li></ul><h3>How to Measure Test Coverage</h3><p>Unlike code coverage, test coverage is not something that a tool can measure directly. It requires defining a set of criteria or scenarios that your system should handle and then ensuring that these are tested.</p><p>One effective way to increase test coverage is to use a requirements-based testing approach to map your tests to specific requirements or user stories.</p><h3>Code Coverage vs. Test Coverage</h3><p>While both metrics aim to quantify testing quality, they measure different aspects of your tests. Understanding the key differences will help you focus your testing efforts effectively.</p><h3>Key Differences</h3><ul><li>Code coverage: Focuses on how much of your codebase is executed by your test suite. It answers the question: “Did my tests run this part of the code?”</li><li>Test coverage: Focuses on how much of the system’s functionality and scenarios are covered by tests. It answers the question: “Did my tests cover all business logic and scenarios?”</li></ul><p>Test coverage is more of a qualitative measure that evaluates the comprehensiveness of your testing strategy. Code coverage is a quantitative metric that can be calculated deterministically based on your tests.</p><h3>Common Misconceptions</h3><p><strong>1/ High Code Coverage Doesn’t Guarantee Thorough Testing</strong></p><p>To put it in Goohart’s law, “When a measure becomes a target, it ceases to be a good measure.”</p><p>One of the biggest misconceptions is that high code coverage equals effective and thorough testing. Code coverage simply measures the percentage of your code executed by tests — it doesn’t necessarily mean that the tests are checking for the correct behavior or ensuring the quality of your code. You can have 90% or even 100% code coverage, but if your tests aren’t validating expected outcomes, edge cases, and error conditions, you could still end up with a buggy application.</p><p>There are teams whose main motivation to write tests is to increase code coverage, as the business overemphasizes and tracks this metric. As <a href="https://www.linkedin.com/pulse/pitfalls-code-coverage-david-burns-khlfc/">engineering leader Ed Burns emphasizes</a>, this gives a false sense of security and incentivizes developers to raise the bar without focusing on test quality.</p><p><strong>2/ 100% Code Coverage Isn’t Always Necessary or Cost-Effective</strong></p><p>Many teams aim for 100% code coverage, thinking it’s the gold standard of software quality. However, striving for 100% coverage isn’t always necessary, and in some cases, it can be impractical or even counterproductive.</p><p>In most real-world projects, hitting 100% code coverage involves testing areas of the code that may not need direct testing, such as getter and setter methods, trivial utility functions, or generated code. Testing such trivial or low-impact code might inflate your coverage numbers but does little to improve the overall quality or reliability of your software.</p><p><strong>3/ Test Coverage Can Be High Even with Lower Code Coverage</strong></p><p>It’s a common misconception that test coverage and code coverage must rise together — that high test coverage is only achievable if you also have high code coverage. However, this isn’t necessarily the case. You can have thorough test coverage even if your code coverage is lower, and vice versa.</p><p>Test coverage focuses on the breadth of testing from a requirements or functionality perspective. You might be covering a wide range of functional scenarios and edge cases without necessarily executing every single line of code. This typically happens when you write tests that prioritize critical workflows, user interactions, or edge cases while intentionally skipping over trivial code paths that don’t require detailed testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gUxHp2jqKDMgjLGY.png" /></figure><h3>Choosing between Code Coverage and Test Coverage</h3><p>Teams should generally focus on both metrics to ensure an effective test strategy.</p><p><strong>Code coverage is essential when you’re trying to ensure that all areas of your code have been executed during tests</strong>. It’s beneficial in legacy codebases where you want to introduce automated tests without refactoring too much. It’s an important metric to keep track of but not a reliable indicator for test quality and likelihood of bugs.</p><p><strong>Teams should focus on test coverage and code coverage when validating critical business logic, high-risk areas, and complex systems, where ensuring correct functionality is more important than merely executing code. </strong>Test coverage is essential during product releases to confirm that all scenarios and user workflows behave as expected. It’s especially crucial for safety-critical applications or industries with regulatory requirements, where thorough testing of all conditions is mandated.</p><p>Different project goals and the nature of the software often determine the emphasis on each type of coverage. For instance:</p><ul><li><strong>Project goals</strong>: Use code coverage to ensure that all parts of the code are tested, and test coverage to verify that functional requirements are met.</li><li><strong>Software nature</strong>: Apply code coverage in complex systems with intricate logic, and prioritize test coverage in regulatory or safety-critical domains.</li><li><strong>Development process</strong>: Code coverage aligns well with Test-Driven Development (TDD) practices, whereas test coverage complements Behavior-Driven Development (BDD) by focusing on behavior and user requirements.</li><li><strong>Stakeholder priorities</strong>: Emphasize test coverage for functional correctness and code coverage to manage and reduce technical debt.</li></ul><p>Together, code and test coverage give a complete picture of the system’s robustness, balancing both code execution and requirement validation.</p><h3>Best Practices for Achieving High Code Coverage</h3><p>Here are a few strategies to ensure you cover as much of your code as possible.</p><ul><li><strong>Write effective unit tests:</strong> Unit tests are the building blocks of your test suite. Ensure that every function and method is tested individually with various inputs and edge cases. When working with untested legacy code, teams may align on required tests for newly submitted code.</li><li><strong>Identify untested code</strong>: Use coverage reports from tools like JaCoCo to identify sections of code that aren’t covered. Prioritize writing tests for these areas.</li><li><strong>Practice TDD</strong>: When implementing a new feature, start with the tests. This will help you focus more on the existence of meaningful tests.</li></ul><h3>Best Practices for Achieving Effective Test Coverage</h3><p>While increasing code coverage is important, achieving effective test coverage requires a strategic approach. Here’s how you can enhance your test coverage:</p><ul><li><strong>Prioritize critical code paths:</strong> Focus on the most essential parts of your application, such as business-critical workflows, error-handling routines, and complex algorithms.</li><li><strong>Employ mutation testing</strong>: Mutation testing involves modifying your code in small ways and ensuring that your tests catch these changes. It helps to identify the quality of your tests, making sure they are reliable.</li><li><strong>Analyze incidents or outages</strong>: As part of an incident post-mortem, teams can continuously identify gaps in their test suite.</li></ul><h3>Leveraging Diffblue Cover for Code and Test Coverage</h3><p><a href="https://www.diffblue.com/diffblue-cover/">Diffblue Cover</a> is an AI agent solution that can significantly enhance both code and test coverage by automating the creation of Java unit tests.</p><p>Diffblue Cover analyzes your codebase and uses reinforcement learning to automatically generate unit tests for your Java methods, which helps increase code coverage without manual intervention.</p><p>By identifying untested parts of the code, it writes meaningful tests that execute previously untested lines, methods, and branches. This helps boost code coverage, particularly in areas where writing tests might be tedious or overlooked.</p><p>Diffblue Cover is available to use in IntelliJ IDE plugin and with advanced CLI tool capabilities for testing at scale.</p><p>Let’s see this in action by generating tests for the following method from the OwnerController of the <a href="https://github.com/spring-projects/spring-petclinic">Spring PetClinic</a> project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ofQQlEsMxznqKMkJ.png" /></figure><p>With the click of a button inside our IDE, Diffblue Cover automatically detects all execution paths and generates the following two tests for us:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LWqVH1jeZlIutIuu.png" /></figure><p>These two tests include the necessary setup methods as well as the relevant assertions for each test. No manual interaction was required to generate them.</p><p>Diffblue Cover is particularly useful in identifying and covering edge cases and more complex areas of the code, which might otherwise go untested. This results in better code coverage and more robust and thorough test coverage, as these complex scenarios often contain the most critical bugs.</p><p>On top of Diffblue Cover’s unit test generation, <a href="https://docs.diffblue.com/features/cover-reports">Diffblue Cover Reports</a> is a powerful tool for visualizing test coverage across a Java codebase, offering detailed metrics and insights to enhance code quality and testing efforts.</p><p>Diffblue Cover Reports is designed to:</p><ol><li>Visualize the state of unit testing in Java projects</li><li>Pinpoint actionable insights to improve code quality and efficiency</li><li>Monitor and manage test coverage</li><li>Identify risks across the organization’s codebase</li></ol><p>With browser-based UI reports, teams can easily monitor coverage risks and identify testability gaps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/0*R9ywH8TzZoaC-ShC.png" /></figure><p>By leveraging data generated through the Cover CLI or Cover Pipeline, Diffblue Cover Reports delivers unique, actionable insights beyond standard coverage statistics, guiding teams toward a more resilient and well-tested codebase.</p><h3>Bottom line</h3><p>Both code and test coverage are essential metrics for measuring the quality of your tests. While code coverage focuses on ensuring all parts of the code are executed, test coverage ensures that all functional requirements and scenarios are tested.</p><p>While you can not over-emphasize the importance of test coverage, taking code coverage as a central quality KPI will leave you with blind spots in your test suite.</p><p>Prioritize effective unit tests, employ best practices like mutation testing, and leverage automation tools to maintain high coverage and continuously improve your test suite.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b2b6120d479" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Assistants and AI Agents: What’s the SDLC Difference?]]></title>
            <link>https://diffbluehq.medium.com/ai-assistants-and-ai-agents-whats-the-sdlc-difference-a72b07a49f3b?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/a72b07a49f3b</guid>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-software-testing]]></category>
            <category><![CDATA[ai-assisted-coding]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 14:45:57 GMT</pubDate>
            <atom:updated>2025-01-06T14:45:57.034Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1h-PijtOtECZkMad.jpeg" /></figure><p>Developers are increasingly leveraging artificial intelligence to enhance their productivity and streamline their workflows. Two prominent categories of AI-powered developer tools in this space are AI assistants and AI agents. While both aim to support and augment developers, they have very different capabilities and purposes. Let’s dive in.</p><h3>AI Assistants in Software Development</h3><p>AI assistants are designed to work alongside Java developers, providing real-time support and suggestions as they code. These tools integrate seamlessly into popular Integrated Development Environments (IDEs) and offer features that enhance the coding experience.</p><p>Key characteristics of AI assistants in Java development include:</p><ol><li>Code completion: AI assistants can predict and suggest code snippets, method calls, and variable names based on the context of the code being written.</li><li>Syntax highlighting and error detection: They can identify potential syntax errors and highlight them in real-time, helping developers catch mistakes early.</li><li>Documentation lookup: AI assistants can quickly fetch and display relevant documentation for Java classes, methods, and libraries.</li><li>Refactoring suggestions: They can propose ways to improve code structure and readability, adhering to Java best practices.</li><li>Context-aware recommendations: For Java developers, an AI assistant might suggest using streams and lambdas for more concise and efficient data processing.</li></ol><p>Popular AI assistants for Java development include GitHub Copilot, Tabnine, and Amazon CodeWhisperer.</p><h3>AI Agents in Software Development</h3><p>AI agents, on the other hand, are more autonomous systems designed to perform complex tasks, unsupervised with minimal human intervention. In Java development, AI agents can handle higher-level operations and decision-making processes.</p><p>Key features of AI agents in Java development include:</p><ol><li>Autonomous decision-making: AI agents can make decisions based on predefined rules and learned patterns, often without direct human input.</li><li>Complex task automation: They can handle intricate workflows, such as automated testing, deployment, or performance optimization of Java applications.</li><li>Environment interaction: AI agents can interact with various development tools, version control systems, and other parts of the Java ecosystem.</li><li>Learning and adaptation: Advanced AI agents can learn from past interactions and improve their performance over time.</li><li>Goal-oriented behavior: AI agents are typically designed to achieve specific objectives within the Java development process, such as optimizing code performance or ensuring security compliance.</li></ol><h3>The Key Differences Between AI Assistants &amp; Agents</h3><p>The main distinctions between AI assistants and AI agents in Java development are:</p><ol><li>Level of autonomy: AI assistants work alongside developers, offering suggestions and support, while AI agents can operate more independently, making decisions and performing tasks autonomously.</li><li>Scope of operation: AI assistants focus on code-level support and immediate developer needs, whereas AI agents can handle broader, more complex tasks across the development lifecycle.</li><li>Interaction model: Developers actively engage with AI assistants during coding, while AI agents often work in the background, requiring less direct interaction.</li><li>Learning capabilities: While both can learn and improve, AI agents typically have more advanced learning mechanisms, allowing them to adapt to complex scenarios in Java development.</li><li>Task complexity: AI assistants excel at providing immediate, context-specific help, while AI agents are better suited for handling multi-step, complex processes in Java projects.</li></ol><h3>AI Assistants vs AI Agents: capability comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*3W55CyO7e2ZsEKTJPcMPDg.png" /><figcaption>AI Assistants vs AI Agents capability comparison table</figcaption></figure><h3>Final Thoughts</h3><p>AI assistants like GitHub Copilot, Amazon CodeWhisperer, and JetBrains AI act as helpful sidekicks, streamlining routine tasks such as code completion, bug detection, and documentation generation. They respond to developer commands and provide support for specific tasks, improving productivity in day-to-day development activities.</p><p>AI agents, however, offer a more transformative impact by operating autonomously and making independent decisions. They function as largely autonomous team members, handling complex tasks and adapting to changing project requirements without constant human oversight. AI agents can perform multi-step processes, analyze vast amounts of data, and make real-time decisions to optimize various aspects of the SDLC. As a result, the productivity benefits of AI agents far outweigh that of AI assistants.</p><p>This evolution in AI for code solutions is reshaping roles within the SDLC. Developers are increasingly focusing on high-level design, creative problem-solving, and strategic decision-making, while agentic AI will increasingly handle complex implementation and optimization tasks at scale. AI agents, such as those used in continuous testing, can reliably complete tasks unsupervised and in a deterministic manner, positively impacting both individual developers and entire teams. This shift towards more autonomous AI systems in software development promises to push efficiency, accuracy, and innovation throughout the SDLC even further.</p><p>Author: <a href="https://medium.com/u/7320f4f3d9ae">firestartr</a></p><p><em>Originally published at </em><a href="https://www.diffblue.com/resources/ai-assistants-and-ai-agents-whats-the-difference/"><em>https://www.diffblue.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a72b07a49f3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accelerating unit test generation: Assistants vs. autonomous AI — Diffblue]]></title>
            <link>https://diffbluehq.medium.com/accelerating-unit-test-generation-assistants-vs-autonomous-ai-diffblue-95c1503ccd48?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/95c1503ccd48</guid>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[unit-testing]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Wed, 29 May 2024 14:55:15 GMT</pubDate>
            <atom:updated>2024-05-29T14:55:15.210Z</atom:updated>
            <content:encoded><![CDATA[<h3>Accelerating unit test generation: Assistants vs. autonomous AI — Diffblue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2-hlG926m9CPu71c.png" /></figure><p>In today’s software development landscape, artificial intelligence (AI) has emerged as a valuable, efficiency-boosting tool — especially for testing and test automation. The demand for faster and more reliable software has driven the integration of AI-powered tools into testing processes. These tools leverage machine learning (ML) algorithms to help teams manage the impact of code changes, detect bugs, optimize test cases, and enhance overall software quality.</p><p>Most software testing AI tools currently on the market operate under a code suggestion approach. That means the tool will look at a single or small section of code and suggest a test that the developer manually reviews, modifies if necessary, and then implements.</p><p>While this is a significant improvement over manually creating tests from scratch, it’s limited to testing small sections of code and still requires a developer to review and often modify test code to get the best results. The AI acts as an assistant to developers, allowing them to write tests quickly. However, to see real change in software testing, you need AI that operates on a different plane altogether: autonomously.</p><p>Autonomous AI testing tools don’t just help teams streamline existing workflow — they change your organization’s entire testing approach. Autonomous AI tools like <a href="https://www.diffblue.com/products/">Diffblue Cover</a> significantly ease developer workloads by analyzing your codebase’s history and automatically generating accurate unit tests based on it to detect regressions. As a result, your organization experiences a more efficient development cycle and accelerated time-to-market.</p><h3>Bridging the gap: From AI suggestions to fully autonomous AI</h3><p>The difference between suggestive AI and the autonomous approach for testing may not seem obvious at first glance, but the gap is immense. While the standard suggestive approach aims to help developers write unit tests quickly and easily, the autonomous approach removes the burden of test planning, writing, and maintenance from developers almost entirely.</p><p>Unit testing takes a significant percentage of a developer’s time — valuable hours they could spend building features or improving performance. And while suggestive AI can reduce writing time, it’s unable to assist with test maintenance or planning. An autonomous approach removes the effort, overhead, and mental strain of creating and following a testing plan.</p><p>The autonomous approach frees up developers’ time and ensures a level of consistency and uniformity across an entire codebase that’s simply unachievable with other approaches. Because autonomous AI testing tools are trained on and comprehend the intended behavior of a specific codebase, they can create a consistent, human-readable, and understandable approach across an entire project.</p><p>The difference between a suggestive AI testing approach and an autonomous AI testing approach is like the difference between using cruise control and utilizing a fully autonomous self-driving car. It’s akin to transitioning from manual steering adjustments while driving to entrusting the vehicle to seamlessly navigate itself to the intended destination.</p><h3>Understanding traditional AI in code development</h3><p>In the context of unit testing, most AI for development products assists in generating or completing code for tests. Its primary role is boosting developer efficiency by making predictions and suggestions that facilitate faster application development. These tools are generally large language models (LLMS) trained on large code volumes, which the AI uses to suggest code snippets.</p><p>One of the main use cases of suggestive AI tools is code completion. The AI predicts and proposes code snippets based on context, syntax, and the developer’s past coding patterns. This feature offers quick and informed suggestions to complete lines or blocks of code, with the developer choosing whether or not to implement the suggestion.</p><p>The need for developers to oversee suggestive AI tools and implement all changes underscores a notable limitation: their inability to scale. AI tools are limited to helping a single developer create a single test — which a subject matter expert (SME) then needs to review and implement. This leads to a minimal time save, as developers still need to be present and active during test creation.</p><p>Additionally, these suggestive tools struggle with understanding nuanced coding styles, often echoing quirks instead of adapting appropriately. Large, evolving codebases also pose a challenge, as the suggestive AI may lag in keeping pace with dynamic changes.</p><h3>The advantages of autonomous AI in software development</h3><p>Development teams can overcome the limitations of suggestive tools by switching to fully autonomous AI solutions.</p><p>Unlike suggestive AI tools, which require human guidance and oversight, fully autonomous AI testing tools can independently handle creating unit tests for an entire codebase. They excel in adapting to changes and tackling complex tasks like testing with minimal (or no) human intervention.</p><p>Moreover, teams can implement autonomous tools into their continuous integration/continuous delivery (CI/CD) pipeline to create, modify, and validate unit tests at the time of change across the entire codebase. This frees individual developers to limit their testing to crucial paths, knowing that the AI will check how their code integrates into the project.</p><p>Full autonomous AI in test code development offers numerous benefits, including:</p><ul><li><strong>A more efficient development lifecycle</strong> — By automating tasks, the development process accelerates, ensuring swift and precise completion of coding assignments.</li><li><strong>Improved code quality and security</strong> — Autonomous AI tools improve code quality and security by supporting context-aware testing and coding, widening test coverage. Additionally, automated tasks lead to fewer human-made errors.</li><li><strong>Greater adaptability and codebase maintainability</strong> — Full automation enhances a software system’s responsiveness to changes, enabling seamless adaptation to evolving project requirements. Automated processes swiftly identify and implement modifications, fostering a dynamic and agile development environment.</li></ul><h3>Diffblue Cover: A paradigm of autonomous AI in action</h3><p>Diffblue Cover is a groundbreaking AI-powered solution at the forefront of full automation in software development. It simplifies unit testing by leveraging AI to autonomously write, update, and execute Java and Kotlin unit tests.</p><p>Diffblue Cover takes a unique approach compared to traditional LLM-backed, suggestive AI tools. These LLM-driven AI tools fall into a “jack of all trades, master of none” situation, where they’re useful more broadly, but aren’t specialized enough on code that can rival that of a trained developer. Diffblue Cover, in contrast, is built using <a href="https://www.diffblue.com/blog/ai/testing/reinforcement-learning-in-diffblue-cover/">reinforcement learning</a>, not LLMs. As a result, Diffblue Cover is a Java and Kotlin expert capable of writing high-quality unit tests without supervision.</p><p>With this specialized training, Diffblue Cover can autonomously write and maintain tests uniquely designed for your company’s codebase. Cover uses advanced ML algorithms to comprehend and analyze code and generate clean, easy-to-read, practical unit tests for any project. When generating and executing tests, it examines the codebase’s intricacies and history, meaning all tests are context-aware and consider legacy code. This enables Diffblue Cover to identify potential vulnerabilities and produce high-quality, high-coverage test cases.</p><p>Because Diffblue Cover analyzes both the current and historical codebase, it automatically updates tests as the software changes. This releases the burden of manually updating unit tests and ensuring full test coverage has been maintained across your entire codebase. Non-developers may not appreciate the incredible impact this brings, but it goes far beyond a time save. It gives developers the freedom to create.</p><h3>The agility of full automation</h3><p>As a fully autonomous automated AI tool, Diffblue Cover is designed to save development teams time and effort. But this efficiency isn’t just a one-test, one-time affair: Diffblue Cover supports long-term efficiency by adapting and responding to changes in the codebase, saving time and effort on future work.</p><p>Diffblue Cover operates in two primary modes to enhance the development workflow. First, it integrates seamlessly with the IntelliJ integrated development environment (IDE), allowing for real-time generation of unit tests as code is written. This immediate feedback loop ensures that tests are created concurrently with the development process, promoting a test-driven development approach. And since the tests are generated automatically, developers don’t need to spend valuable time generating prompts or correcting inaccuracies.</p><p>Second, Diffblue Cover functions as a powerful command-line tool that can review and generate unit tests for large codebases. This capability is particularly useful for legacy code or when integrating new features, as it ensures comprehensive test coverage without manual intervention.</p><p>Moreover, you can attach Diffblue Cover to your CI/CD pipeline, automating test maintenance and execution. Whenever code is changed, Diffblue Cover automatically updates and runs the relevant tests, alerting developers only if it detects an issue. This integration ensures that all tests are written, executed, and updated consistently, enhancing readability and maintaining uniform testing standards across the entire codebase.</p><p>Automatically updating and executing tests in this way saves developers significant time. Manual review and update of tests after each code change can be labor-intensive. Diffblue Cover accelerates this process, eliminating the need for developers to spend valuable time on these mundane, repetitive tasks.</p><p>This time-saving aspect allows developers to redirect their efforts toward more strategic and creative aspects of development. Moreover, by automating the error-prone update process, Diffblue Cover effectively mitigates the risk of undetected regressions or other issues — helping software become more robust and reliable. And because Diffblue Cover adapts its testing processes to reflect changes in the codebase, development teams can be confident its unit tests align with current code requirements.</p><p>Diffblue Cover’s ability to adapt to code changes enhances the codebase’s long-term reliability and maintainability. Developers can confidently implement alterations, knowing that the automated testing infrastructure will promptly and accurately adjust to the modifications. This reduces the likelihood of introducing bugs that will impact performance down the line, streamlining the development cycle.</p><h3>Differentiating Diffblue Cover from other AI tools</h3><p>In an industry brimming with AI-powered development tools, Diffblue Cover distinguishes itself through its unparalleled autonomy. Unlike suggestive AI tools that merely assist developers in crafting unit tests more swiftly, Diffblue Cover revolutionizes the process by eliminating the need for developers to write unit tests altogether. Once activated with a simple click, it operates independently, continuously updating tests to reflect changes in the codebase without requiring constant oversight. This independence ensures developers can rely on the algorithm to generate comprehensive and reliable unit tests tailored to their specific codebase.</p><p>Diffblue Cover’s ability to autonomously adapt to evolving codebases sets it apart from traditional AI tools, which often lag behind the fast-paced development cycle due to the need for manual adjustments. Its advanced ML algorithms generate Java and Kotlin unit tests and refine them autonomously in response to code modifications, ensuring the tests remain up-to-date and relevant.</p><p>Furthermore, Diffblue Cover transcends the capabilities of mere test generation. It actively monitors the impact of code changes, helping teams identify, track, and remediate any resulting issues. In contrast to suggestive tools that merely expedite test creation, Diffblue Cover provides a comprehensive testing infrastructure that autonomously maintains tests as the codebase evolves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H4KiOByDHVjhbdo0SINDMA.png" /></figure><h3>Summary</h3><p>When it comes to unit testing, while suggestive AI tools offer assistance by generating test snippets and guiding developers, fully autonomous AI solutions like Diffblue Cover revolutionize the process. Unlike these suggestive tools, Diffblue Cover autonomously generates complete unit test suites and maintains them in sync with changes in the codebase, eliminating the need for manual test writing.</p><p>This transition from suggestive AI to fully autonomous represents a significant evolution in unit testing. By adopting solutions like Diffblue Cover, developers can achieve unmatched efficiency, freeing themselves from the repetitive task of writing and updating tests and ensuring consistent test quality. In an era where rapid and reliable testing is crucial, the move to comprehensive, autonomous testing solutions isn’t just advantageous — it’s essential for modern software development.</p><p>To future-proof your company’s codebases and embrace modern software development, <a href="https://www.diffblue.com/schedule-a-demo">discover the benefits</a> of integrating Diffblue Cover into your software processes today.</p><p><em>Originally published at </em><a href="https://www.diffblue.com/resources/accelerating-unit-test-generation-assistants-vs-autonomous-ai/"><em>https://www.diffblue.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95c1503ccd48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI for developers: The on-premise advantage]]></title>
            <link>https://diffbluehq.medium.com/ai-for-developers-the-on-premise-advantage-77934d7b6b9d?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/77934d7b6b9d</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-for-developers]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Thu, 16 May 2024 13:51:42 GMT</pubDate>
            <atom:updated>2024-05-16T13:51:42.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FGA5Jf0s_Pzwtvx4.png" /></figure><p>Data security has become a paramount concern in modern software development — especially with the accelerated integration of artificial intelligence (AI) tools. But the risk of data breaches and unauthorized access to sensitive data, such as proprietary algorithms, remains very real. Therefore, robust security measures are imperative.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQmsbaIpPM6IX-3h3XF8-g.png" /></figure><p>One increasingly popular method of making AI more secure is using an on-premise setup. On-premise AI involves deploying AI solutions directly within your organization’s infrastructure rather than using cloud-based services. In contrast to the latter, where external servers store and process data, on-premise solutions offer a higher level of control and customization.</p><p>While cloud computing provides scalability and flexibility, on-premise solutions address the growing demand for heightened data security. This article explores what makes on-premise solutions like Diffblue Cover (aka Cover) ideal for organizations prioritizing confidentiality and compliance in their AI initiatives.</p><h3>AI you can trust</h3><p>In cloud-based alternatives, the risk of data breaches looms large due to external attacks on shared cloud infrastructure. In contrast, on-premise AI solutions safeguard confidential information by minimizing the amount of data shared with third-party platforms.</p><p>Tools like Diffblue Cover’s code analysis and testing use on-premise deployment to ensure critical data stays within your company’s controlled environment, substantially mitigating the risk of external breaches. The localized nature of on-premise solutions enables enhanced control and monitoring, empowering your organization to manage its security protocols proactively.</p><p>These solutions also provide a robust way to protect your sensitive data, meeting the evolving challenges of data privacy and security in today’s digital landscape.</p><h3>The risks of cloud-based AI</h3><p>While cloud-based AI solutions provide many benefits, like scalability and cost effectiveness, they also introduce significant data security concerns.</p><p>One foremost worry is the potential for cyber attacks, which can have severe consequences for businesses. Cloud security vulnerabilities, particularly misconfigurations and insider threats, pose substantial risks. Attackers can exploit these weaknesses, leading to unauthorized access, data breaches, or leaks.</p><p>Cloud environments are complex, and even a minor security setting misconfiguration can expose sensitive data. And because cloud computing uses a shared responsibility model, the cloud provider and the user must both be mindful of security. So, it’s crucial that your organization carefully configures and monitors all cloud settings.</p><p>Intellectual property (IP) exposure is another critical concern associated with cloud-based AI solutions. IP breaches can be catastrophic, resulting in significant competitive disadvantages and potential financial losses. IP exposure can occur when sensitive information, like IP or other proprietary data, is inadequately protected. This vulnerability can stem from misconfigurations in cloud settings, weak access controls, or insufficient encryption measures. Hackers seek out these weaknesses, which can lead to unauthorized access and full-on IP exposure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VyxMMgysagYxg0uYIKisQw.png" /></figure><p>Additionally, with the proliferation of AI tools and large language models (LLMs), organizations need to carefully watch for IP and data being willingly shared. One study found that <a href="https://cybernews.com/security/workers-regularly-post-sensitive-data-into-chatgpt/">15 percent of employees have entered company data into ChatGPT</a>. Protecting innovations that give your company its competitive edge isn’t just about securing data — it’s about preserving the very essence of what sets your business apart.</p><p>Given these risks, some businesses remain cautious about using cloud-based tools for sensitive or proprietary projects. Moreover, the complexity of managing security in the cloud, coupled with the constantly evolving threat landscape, makes it essential for companies to implement robust security measures. This has led some organizations to <a href="https://www.businessinsider.in/tech/news/amazon-apple-and-12-other-major-companies-that-have-restricted-employees-from-using-chatgpt/slidelist/101676536.cms">prohibit the use of cloud AI tools</a> altogether.</p><h3>The on-premise advantage with Cover</h3><p>On-premise AI solutions like Cover promote data security by retaining all processes and data within your company’s internal network. Cover eliminates the need to rely on external servers or third-party platforms, reducing the exposure to potential security vulnerabilities associated with cloud-based solutions. This, in turn, minimizes the risk of external breaches and unauthorized access by providing a secure code analysis and testing environment.</p><p>Moreover, on-premise AI solutions provide specific benefits when it comes to code analysis and testing. Let’s explore a few.</p><h3>Environmental control</h3><p>Internalizing processes and data within your company’s infrastructure establishes a controlled environment. This significantly reduces the risk of external breaches and unauthorized access, as your organization maintains direct oversight of its sensitive code and data.</p><h3>Customized security</h3><p>An on-premise solution like Cover enables your organization to implement customized security measures tailored to your specific requirements. This approach can include implementing role-based access controls (RBAC), integrating Cover with your existing security infrastructure, and customizing authentication mechanisms and secure deployment options.</p><p>This flexibility enables teams to integrate robust authentication protocols, access controls, and encryption methods that fully align with your security policies.</p><h3>Up-to-date security measures</h3><p>Cover’s on-premise model enables up-to-date security measures for your teams through continuous updates and patch management. A steady stream of security patches and updates helps you address emerging threats and vulnerabilities promptly. This approach ensures that Cover stays resilient against evolving security challenges.</p><p>Additionally, Cover shares security alerts and advisories to keep teams informed about emerging risks and best practices for using Cover.</p><h3>AI you control: Cover’s unique approach</h3><p>The concept of “AI you control” is at the core of Cover’s approach to AI-powered, Java-based unit test generation. Users can manage every aspect of the AI, including data handling and processing.</p><p>By adopting an on-premise infrastructure, Cover provides a level of security and control that’s unparalleled. The solution ensures sensitive data, including proprietary code and project information, remain within your organization’s secure environment. Additionally, you can customize and configure the AI algorithms according to your specific testing needs, supporting a tailored and optimized testing process.</p><p>Cover’s “AI you control” approach extends beyond customization — it addresses security concerns directly. With an on-premise setup, you can mitigate external cyber threats more effectively. This is particularly crucial in industries with a heightened commitment to data privacy regulations, for example, the General Data Protection Regulation (GDPR) and the Health Insurance Portability and Accountability Act (HIPAA).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rUaCeAw_0fQGvecsU-OBCA.png" /></figure><h3>No developer input required for maximum security</h3><p>Cover’s approach to minimizing security risks sets it apart from other AI-driven code analysis tools. One key strength is its ability to function autonomously, requiring no direct input from developers. This capability streamlines the development process and helps mitigate potential security issues by eliminating the potential for human-caused delays, configuration errors, or vulnerabilities.</p><p>In contrast to other AI solutions that may necessitate extensive data sharing or cloud-based processing, Cover uses an in-house approach to automation. Cloud solutions often require hefty offsite data transfers or broad access rights for AI processing. This situation opens up avenues for potential data breaches and sensitive information exposure. Cover eliminates this risk altogether.</p><p>Other than addressing the threat of data theft, Cover also mitigates the risks associated with model training. Cover ensures that developers retain control over their codebase without external involvement, reducing the likelihood of unintentional data leaks or compromises.</p><h3>Tailored to your codebase: Machine learning with privacy</h3><p>One way Cover maintains security is by using machine learning (ML) models that are trained on your organization’s existing codebase — not external sources. As a result, unit tests generated by the AI won’t be generic: They’re specific to your company’s codebase, including relevant legacy code.</p><p>By tailoring ML models to the intricacies of your organization’s unique code, Cover achieves a level of accuracy, optimization, and security that generic models can’t match. As a bonus, since the AI is trained using the company codebase, your development teams don’t need to test the generated unit tests, saving significant time.</p><p>Unlike other AI-backed code testing and analysis tools on the market, Cover ensures that you avoid sending any data whatsoever to external servers. This means that user information is protected and that your organization’s proprietary code snippets and algorithms remain confidential.</p><p>Neither Diffblue nor anyone else can use your data to advance their own technology. As a result, your company’s intellectual property and sensitive business logic are protected (and your competitive edge remains intact).</p><h3>Scale without security risk</h3><p>As a savvy buyer, you’re faced with the challenge of optimizing costs while maintaining operational security and efficiency. Though they may require a higher up-front financial investment than cloud alternatives, on-premise AI solutions offer long-term benefits that resonate with your priorities.</p><p>As outlined above, on-premise solutions reduce risk and enhance data security, making them more secure than their cloud counterparts. And while cloud infrastructure may provide cost savings in the short term, the security and flexibility offered by on-premise solutions are unparalleled. They’re a sustainable, strategic investment that will ultimately keep long-term security-related costs low.</p><p>As your company scales, maintaining the integrity of software development processes is essential. Diffblue’s commitment to security and privacy ensures that your organization can confidently integrate its tools into on-premise environments. This further fortifies the foundation for scalable and secure software development practices.</p><h3>Summary</h3><p>On-premise AI solutions, like Cover’s code analysis and testing tool, enhance your company’s data security and control. Keeping sensitive data internal, on-premise AI tools mitigate concerns about data breaches and privacy.</p><p>Additionally, on-premise solutions offer improved control over the AI environment, facilitating customization and seamless integration with existing systems. Cover is one such solution that strengthens security while enhancing efficiency and reliability in your software development process.</p><p>By opting for an on-premise AI solution, you can empower your teams with a secure, adaptable, and robust foundation.</p><p><em>Originally published at </em><a href="https://www.diffblue.com/resources/ai-for-developers-the-on-premise-advantage/"><em>https://www.diffblue.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77934d7b6b9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java application mocking best practices]]></title>
            <link>https://diffbluehq.medium.com/java-application-mocking-best-practices-711870cc650f?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/711870cc650f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[unit-testing]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 11:36:35 GMT</pubDate>
            <atom:updated>2024-04-18T11:36:35.091Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xx7uykUEveZ6imZu.jpg" /></figure><h3>How to effectively incorporate mocking into your unit tests</h3><p>Mocking is an important part of unit testing components that have integrations or rely on external dependencies. But what exactly is it? In tests, mocking uses mock objects with fake business logic to replicate the function of a real object, so as isolate and focus on the code being tested without being affected by the behavior, or state, of external dependencies.</p><p>Mocks can produce better tests by reducing a factor that could cause the test to fail (e.g. needing to access an external resource like a database, which could be offline for reasons unrelated to your test) and helping you isolate the classes being tested. They can also save time and stop you from being charged for accessing these external resources.</p><h3>Too much of a good thing?</h3><p>Mocks are important to know how to use well, which means you have to really understand your code and its intended behavior; ideally, mocks are used only when necessary. However, new test writers sometimes go overboard, which runs the risk of slowing down tests and making them needlessly complicated. Using too many mocks can even affect whether you’re actually testing the right thing — are you testing that something is implemented in a specific way, rather than testing that the desired outcome?</p><p>Here are some best practices for mocking to help you use this method as effectively as possible.</p><h3>When isn’t mocking appropriate?</h3><p>Mocks work best when the code being tested isn’t tightly coupled; decoupled code tends to result from Test Driven Development (TDD), which no doubt partially explains why mocking is encouraged in the TDD community. For tightly coupled code (as is often present in legacy code), it might be the case that two or more classes form one unit, which can still be tested with a unit test. If not, think about whether the paired class has a lot of its own logic and whether it matters to test it separately. If not, don’t write a mock for it.</p><p>Similarly, don’t mock value objects; there’s simply no reason to because they don’t have their own logic. Also <a href="http://deliberate-software.com/dont-mock-concrete-classes/">avoid mocking concrete classes</a>, because these trap you in a certain implementation of the class you’re mocking.</p><p>In some cases, different types of “test doubles” similar to mocks are more appropriate instead. For a more detailed discussion about the differences between and applications for mocks, stubs, fakes, dummies, and other test doubles, check out Martin Fowler’s <a href="https://martinfowler.com/articles/mocksArentStubs.html">classic article</a> on the topic.</p><h3>Which testing framework is right for you?</h3><p>Java unit testing frameworks comprise a huge collection of packages that supply pre-written code. They typically incorporate libraries, compilers, tools and APIs and give developers a consistent, clever and extensible way to build software. The one you choose will depend on a number of factors including the application and technology being tested, your testing requirements and your teams’ skills, with the most popular one being <a href="https://junit.org/junit5/">JUnit</a>.</p><h3>Which mocking framework is right for you?</h3><p>You can write mocks manually, but a few open source mocking frameworks make it a lot faster and easier to maintain your mocks if you write tests frequently ( <a href="https://www.diffblue.com/resources/how-is-test-driven-development-like-french-cooking/">which you should</a>!).</p><p>Many mocking frameworks for Java code work in combination with <a href="https://junit.org/junit5/">JUnit</a> and other popular unit testing frameworks, and are great depending on your specific needs. Two of the most widely used are <a href="https://site.mockito.org/">Mockito</a> and <a href="https://powermock.github.io/">PowerMock</a>. Mockito is useful for all but the most complicated cases, for which you can use PowerMock instead. Fortunately these frameworks are compatible with each other, so you can start in Mockito for most mocks and switch to PowerMock for the more complex cases.</p><h3>In summary, to incorporate the best mocking practices:</h3><ul><li>Get your <a href="https://www.diffblue.com/resources/7-tips-for-unit-testing/">unit testing techniques</a> in shape</li><li>Choose a testing framework</li><li>Choose a mocking framework</li></ul><h3>But remember, less is more!</h3><p>This powerful method only needs a light touch, and can help you write effective unit tests and clean, agile code. With the right tools and the careful application of these techniques, you’ll be mocking in style.</p><p><a href="https://www.diffblue.com/diffblue-cover/"><em>Diffblue Cover</em></a><em> autonomously writes human readable, ready to use Java unit tests so you don’t have to.</em></p><p><em>Originally published at </em><a href="https://www.diffblue.com/resources/mocking-best-practices/"><em>https://www.diffblue.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=711870cc650f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automatically generate unit tests for Kotlin projects]]></title>
            <link>https://diffbluehq.medium.com/automatically-generate-unit-tests-for-kotlin-projects-9adae62e74f2?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/9adae62e74f2</guid>
            <category><![CDATA[unittest]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Thu, 07 Mar 2024 09:00:15 GMT</pubDate>
            <atom:updated>2024-03-12T14:00:57.931Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*oHrGSwrG91jeXTbHojKOsA.png" /></figure><p>Diffblue Cover represents a breakthrough in automated testing, providing developers with a powerful tool to write unit tests quickly and efficiently. Initially designed for Java, its capabilities can extend to Kotlin projects, offering a seamless integration for a wide range of applications.</p><p>This post is designed to guide developers and engineering team leaders through the innovative approach of using Diffblue Cover to automatically write unit tests for Kotlin codebases.</p><p>Before diving into the specifics, it’s essential to understand that this article assumes a basic familiarity with Kotlin and unit testing principles. Throughout the article, we’ll use the <a href="https://github.com/spring-petclinic/spring-petclinic-kotlin">Spring PetClinic Kotlin codebase </a>to demonstrate practical applications of Diffblue Cover in a real-world project.</p><h3>Getting Started with Diffblue Cover in Your Kotlin Project</h3><p>For demonstration purposes, we’re using the <a href="https://github.com/spring-petclinic/spring-petclinic-kotlin">Spring PetClinic Kotlin codebase</a> — a familiar example for many Spring Boot Developers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X6c5-S1JO1IFTjPV" /></figure><p>Integrating Diffblue Cover into your Kotlin project is straightforward.</p><p>Diffblue Cover can be added to your project through its plugin for IntelliJ IDEA or via the CLI (Command Line Interface), offering flexibility in how you prefer to work.</p><p>For this article, we’re going to use the CLI version. To get started, enroll for a free trial and download and install Cover CLI as per <a href="https://docs.diffblue.com/get-started/get-started/free-trial">the documentation</a>.</p><p>Once the Cover CLI is set up, ensure you can build the Spring PetClinic project with ./gradlew build and the preflight check of the CLI is successful.</p><pre>$ dcover create --preflight</pre><h3>Writing Your First Test with Diffblue Cover</h3><p>To enrich the article with a practical example, let’s walk through the process of using Diffblue Cover to write unit tests for a Kotlin class within the Spring PetClinic Kotlin codebase.</p><p>We’ll focus on a simplified version of a controller class, org.springframework.samples.petclinic.owner.PetController, responsible for managing pet information:</p><pre>@Controller<br>@RequestMapping(&quot;/owners/{ownerId}&quot;)<br>class PetController(val pets: PetRepository, val owners: OwnerRepository) {<br><br><br>   private val VIEWS_PETS_CREATE_OR_UPDATE_FORM = &quot;pets/createOrUpdatePetForm&quot;<br><br><br>   @PostMapping(&quot;/pets/new&quot;)<br>   fun processCreationForm(owner: Owner, @Valid pet: Pet, result: BindingResult, model: Model): String {<br>       if (StringUtils.hasLength(pet.name) &amp;&amp; pet.isNew &amp;&amp; owner.getPet(pet.name!!, true) != null) {<br>           result.rejectValue(&quot;name&quot;, &quot;duplicate&quot;, &quot;already exists&quot;)<br>       }<br>       owner.addPet(pet)<br>       return if (result.hasErrors()) {<br>           model[&quot;pet&quot;] = pet<br>           VIEWS_PETS_CREATE_OR_UPDATE_FORM<br>       } else {<br>           this.pets.save(pet)<br>           &quot;redirect:/owners/{ownerId}&quot;<br>       }<br>   }<br>}</pre><p>Let’s look at how we can use Cover to create unit tests for this HTTP POST controller endpoint. Therefore, we’ll use the CLI and point to the fully-qualified class name of the PetController:</p><pre>$ dcover create org.springframework.samples.petclinic.owner.PetController</pre><p>Running this command will trigger Diffblue Cover to create a set of tests for our entire controller class. As a result, we’ll find a new test class PetControllerDiffblueTest within src/test/java:</p><pre>@ContextConfiguration(classes = {PetController.class})<br>@ExtendWith(SpringExtension.class)<br>class PetControllerDiffblueTest {<br><br><br>   @MockBean<br>   private OwnerRepository ownerRepository;<br><br><br>   @Autowired<br>   private PetController petController;<br><br><br>   @MockBean<br>   private PetRepository petRepository;<br><br><br>   @Test<br>   void testProcessCreationForm() throws Exception {<br>       // Arrange<br>       when(petRepository.findPetTypes()).thenReturn(new ArrayList&lt;&gt;());<br><br><br>       Owner owner = new Owner();<br>       owner.setAddress(&quot;42 Main St&quot;);<br>       owner.setCity(&quot;Oxford&quot;);<br>       owner.setFirstName(&quot;Jane&quot;);<br>       owner.setId(1);<br>       owner.setLastName(&quot;Doe&quot;);<br>       owner.setPets(new HashSet&lt;&gt;());<br>       owner.setTelephone(&quot;6625550144&quot;);<br>       when(ownerRepository.findById(anyInt())).thenReturn(owner);<br>       MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.post(&quot;/owners/{ownerId}/pets/new&quot;, 1);<br><br><br>       // Act and Assert<br>       MockMvcBuilders.standaloneSetup(petController)<br>           .build()<br>           .perform(requestBuilder)<br>           .andExpect(MockMvcResultMatchers.status().isOk())<br>           .andExpect(MockMvcResultMatchers.model().size(3))<br>           .andExpect(MockMvcResultMatchers.model().attributeExists(&quot;owner&quot;, &quot;pet&quot;, &quot;types&quot;))<br>           .andExpect(MockMvcResultMatchers.view().name(&quot;pets/createOrUpdatePetForm&quot;))<br>           .andExpect(MockMvcResultMatchers.forwardedUrl(&quot;pets/createOrUpdatePetForm&quot;));<br>   }<br><br><br>   // more tests for this controller endpoint<br>}</pre><p>This auto-created test class contains test methods for all controller endpoints of the PetController.Cover automatically writes a set of unit tests for each controller endpoint to cover various scenarios.</p><p>We can immediately run the tests as Diffblue ensures the auto-created test compiles and executes successfully.</p><p>Seeing the test result for the first time, you might wonder why the result is a Java test class. As of now, Diffblue Cover only supports Java test classes as an output format. However, there’s a simple way to automatically convert this test to Kotlin, if needed.</p><h3>Bonus Tip: Converting Java Unit Tests to Kotlin with IntelliJ IDEA</h3><p>Converting Java unit tests into Kotlin using IntelliJ’s conversion feature facilitates a smoother transition for companies migrating from Java to Kotlin. This capability not only streamlines the adaptation process by automating the conversion of existing test suites, but also ensures that legacy tests remain functional and relevant in the new Kotlin codebase.</p><p>Such a feature is particularly valuable for maintaining test coverage and quality assurance during the migration, allowing teams to leverage Kotlin’s concise syntax and modern features without losing the robustness of their Java-based tests.</p><p>To convert Java unit tests into Kotlin in IntelliJ IDEA, follow this: Open the Java test file in IntelliJ, then from the main menu, select Code &gt; Convert Java File to Kotlin File.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/0*8etXYvKaCNjpae8Y" /></figure><p>Running this action for our auto-created Java test class PetControllerDiffblueTest, we&#39;ll get the following result:</p><pre> /**<br>* Method under test:<br>* [PetController.processCreationForm]<br>*/<br>@Test<br>@Throws(Exception::class)<br>fun testProcessCreationForm3() {<br>   // Arrange<br>   Mockito.`when`(petRepository!!.findPetTypes()).thenReturn(ArrayList())<br><br><br>   val owner = Owner()<br>   owner.address = &quot;42 Main St&quot;<br>   owner.city = &quot;Oxford&quot;<br>   owner.firstName = &quot;Jane&quot;<br>   owner.id = 1<br>   owner.lastName = &quot;Doe&quot;<br>   owner.pets = HashSet()<br>   owner.telephone = &quot;6625550144&quot;<br>   Mockito.`when`(ownerRepository!!.findById(ArgumentMatchers.anyInt())).thenReturn(owner)<br>   val requestBuilder = MockMvcRequestBuilders.post(&quot;/owners/{ownerId}/pets/new&quot;, 1)<br>   requestBuilder.contentType(&quot;text/plain&quot;)<br><br><br>   // Act and Assert<br>   MockMvcBuilders.standaloneSetup(petController)<br>           .build()<br>           .perform(requestBuilder)<br>           .andExpect(MockMvcResultMatchers.status().isOk())<br>           .andExpect(MockMvcResultMatchers.model().size(3))<br>           .andExpect(MockMvcResultMatchers.model().attributeExists(&quot;owner&quot;, &quot;pet&quot;, &quot;types&quot;))<br>           .andExpect(MockMvcResultMatchers.view().name(&quot;pets/createOrUpdatePetForm&quot;))<br>           .andExpect(MockMvcResultMatchers.forwardedUrl(&quot;pets/createOrUpdatePetForm&quot;))<br>}</pre><p>This automatic conversion helps us quickly get the Diffblue Cover unit test as a Kotlin test class.</p><h3>Integrating Diffblue Cover Into Your Daily Workflow</h3><p>Integrating Diffblue Cover into your daily workflow can revolutionize how your team approaches testing. Here are some ways to make the most out of this tool:</p><ul><li><strong>Continuous Integration (CI)</strong>: Implement Diffblue Cover in your CI pipeline, such as GitLab CI, to automatically write and run tests on every commit. This ensures immediate feedback on the impact of changes, facilitating a test-driven development (TDD) approach.</li><li><strong>Development Cycle</strong>: Use Diffblue Cover during development to instantly write tests for new features or bug fixes, enabling a shift-left testing culture where issues are identified and resolved early in the development process.</li></ul><h3>Reasons to use Diffblue Cover for unit test writing</h3><p>Incorporating Diffblue Cover into your development and testing workflows offers numerous advantages:</p><ul><li><strong>Time Savings</strong>: Automate the creation of unit tests, freeing developers to focus on feature development and code quality improvements.</li><li><strong>Quality Assurance</strong>: Enhance the robustness of your codebase with comprehensive tests, reducing the risk of regressions and bugs.</li><li><strong>Versatility</strong>: Though we’ve focused on Kotlin, remember that Java is the main programming Diffblue Cover supports, making it a versatile tool for projects using both languages.</li></ul><h3>Summary: Using Diffblue Cover for Kotlin Codebases</h3><p><a href="https://www.diffblue.com/products/">Diffblue Cover</a> presents a transformative approach to automated testing for Kotlin developers. By leveraging its capabilities to write unit tests automatically, teams can ensure higher code quality, reduce manual testing efforts, and streamline their development cycles.</p><p>The Spring PetClinic Kotlin codebase serves as an excellent example of how Diffblue Cover can be applied to real-world projects, demonstrating its effectiveness in enhancing software reliability and developer productivity.</p><p>Why not try Diffblue Cover for yourself? You can get started with a <a href="https://www.diffblue.com/try-cover">free trial</a> .</p><p><em>Originally published at </em><a href="https://www.diffblue.com/blog/testing/tutorials/automatically-generate-unit-tests-for-kotlin-projects/"><em>https://www.diffblue.com</em></a><em> on March 7, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9adae62e74f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI for Unit Testing: Revolutionizing Developer Productivity]]></title>
            <link>https://diffbluehq.medium.com/ai-for-unit-testing-revolutionizing-developer-productivity-84e89df16f48?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/84e89df16f48</guid>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[unit-testing-tools]]></category>
            <category><![CDATA[unit-testing]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Wed, 31 Jan 2024 09:00:19 GMT</pubDate>
            <atom:updated>2024-03-07T16:57:15.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/609/0*WQbjAlxcQTKS416c.png" /></figure><p>In this article, we’ll dive into the way artificial intelligence (AI) is revolutionizing software development and testing practices. Think of IDE plugins as digital coding assistants, accelerating programming tasks and providing instantaneous support. With the immense volume of data these models draw from, it’s like having a coding companion with comprehensive knowledge of all online and open-source software. Beyond coding, AI’s power significantly shines in the realm of automated software testing. Tedious manual testing processes are slow, time-consuming, and often disliked by many developers. AI can transform the way unit tests are written, creating them more quickly and effectively without manual interference.</p><h3>The State of AI In Automated Testing</h3><p>GitLab recently released a survey ( <a href="https://about.gitlab.com/developer-survey/">2023 Global DevSecOps Report</a>) giving insight into the adoption and potential of artificial intelligence (AI) across the software development lifecycle. The survey collected responses from individual contributors and leaders in development, IT operations, and security across various industries and business sizes worldwide.</p><p>The market reveals that there is a significant need and interest in using AI for unit testing and software development. According to the survey data, automated test generation is one of the top three use cases for AI in software development, with 41% of respondents currently using it. This indicates a strong demand for AI-powered solutions that can enhance the efficiency and effectiveness of unit testing processes.</p><p>Overall, 83% of the respondents said it is essential to implement AI in their software development process to avoid falling behind, while only 23% are using AI today. This confirms that there is a growing recognition of the potential benefits that AI can bring to the software development lifecycle, including unit testing.</p><h3>Introduction to AI in Unit Testing</h3><p>AI is transforming the landscape of software testing by significantly boosting its capabilities in test writing, test coverage, and execution speed at scale. By integrating machine learning algorithms, AI not only automates mundane and repetitive tasks but also enhances the reach and depth of test scenarios. It quickly pinpoints issues and offers data-driven insights, thereby extending what developers can achieve manually. This advancement enables a more thorough and efficient testing process across large and complex codebases, making comprehensive testing faster and more effective.</p><p>In unit testing, AI’s impact is particularly noticeable. AI algorithms can automatically generate test cases based on the application’s requirements and user stories, tailoring them to the specific needs of unit testing. This includes the generation of test data that aligns closely with real-world scenarios, ensuring that each unit is thoroughly and effectively tested. The automation of these initial stages of test case creation and data preparation significantly reduces manual effort and enhances the coverage and reliability of tests.</p><p>Moreover, AI-driven tools can analyze the results of unit tests to identify patterns and trends. They can predict potential areas where defects are likely to occur, enabling proactive bug detection and resolution. This predictive capability is crucial in unit testing, where early detection of issues can save significant time and resources in the development cycle.</p><p>Integrating AI into unit testing also means enhanced accuracy in tests. AI can refine and optimize testing strategies based on historical data, learning from past test executions to improve future tests. This self-learning aspect of AI makes unit testing more robust over time.</p><p>In addition, AI-driven testing in the unit testing phase is increasingly collaborative. AI-powered tools are designed to work alongside human testers, providing them with insights and recommendations rather than replacing them. This collaboration leads to a more comprehensive and nuanced testing process, making pair programming and Test-Driven Development (TDD) processes powered by AI as a virtual coding partner possible.</p><p>The future of AI in automation, particularly in unit testing, holds great promise. AI is expected to evolve to offer even more advanced capabilities, such as recommending specific tests, predicting the business impacts of potential defects, and assisting developers in real time during the development process. This will further optimize the testing process, enabling teams to actually increase the amount of testing, test coverage, and overall code quality while decreasing the amount of manual time it takes to achieve it.</p><h3>Why Developers Hate Unit Testing</h3><p>Let’s take a moment for a reality check on the current state of unit testing without AI assistance. Picture this: in a room full of developers at a conference, how many do you think would eagerly raise their hands if asked, “Who enjoys writing unit tests?” The response is predictably low. It’s a common sentiment that developers find the joy of feature implementation overshadows the task of testing those very features.</p><p>Yet, the importance of unit testing in software development cannot be overstressed. Despite some developers being reluctant to invest time in writing tests, well-crafted unit tests are invaluable. They not only save countless hours that might otherwise be lost to debugging due to regressions slipping into production but also enhance overall team efficiency.</p><p>Moreover, unit testing, despite its importance, is rarely emphasized in formal computer science education. Most professional programs do not address it in any depth, leaving developers ill-equipped to grapple with this crucial aspect when they step into the professional world. Regardless of our unanimous understanding of the importance of automated testing for code integrity and long-term maintenance, there is undoubtedly room for improvement in how unit tests are conceived and written.</p><p>In essence, writing unit tests is frequently seen as a tedious chore. It lacks the same level of enthusiasm and focus that is typically reserved for feature development, indicating a need for a shift in how unit testing is perceived and executed in the software development process.</p><h3>Benefits of AI for Unit Testing</h3><p>The current landscape of unit testing, often seen as a time-consuming task filled with repetitive boilerplate code, is ready for the introduction of AI. Integrating AI into this process can bring a multitude of benefits:</p><ul><li><strong>Streamlining Test Creation</strong>: AI can significantly streamline unit testing. It aids in quickly setting up test skeletons and even writing complete unit tests. This reduces the initial setup time and effort required from developers.</li><li><strong>Enhancing Test Quality and Coverage</strong>: AI tools are adept at analyzing existing tests for their effectiveness and suggesting improvements. They can identify untested corner cases, thereby improving the overall test coverage of a project. This leads to more robust and reliable code.</li><li><strong>Boosting Developer Productivity</strong>: With AI handling the creation and analysis of unit tests, developers can focus more on core development tasks. This not only speeds up the development cycle but also enhances developer productivity.</li><li><strong>Automated Code Quality Improvement</strong>: AI-generated high-quality unit tests ensure better coverage and maintainability, which directly translates to improved code quality. Early detection of defects and easier code refactoring become additional perks.</li><li><strong>Expanding Test Coverage</strong>: AI-based tools excel at analyzing codebases to generate test cases, including those covering edge cases often missed by manual testing. This comprehensive coverage increases confidence in the code and the likelihood of uncovering potential issues.</li><li><strong>Happier Developers</strong>: Developers experience increased job satisfaction when AI generates their unit tests, as it frees up valuable time for them to focus on more creative and complex aspects of programming, enhancing their sense of accomplishment.</li><li><strong>Accelerating Development Cycles</strong>: Automating the unit testing process with AI tools drastically cuts down the time developers spend on writing, maintaining, and running tests. This allows for a quicker turnaround in development, essential to streamlining TestOps, enabling rapid deployment of new features and improvements.</li><li><strong>Reducing Developer Fatigue</strong>: Manual creation and maintenance of unit tests can be tedious and demotivating. AI-driven tools alleviate this burden, leading to a more efficient workflow and keeping developers engaged and focused on their primary development tasks.</li><li><strong>Simplifying Test Maintenance</strong>: AI tools don’t just create new test cases; they also update existing test suites in response to changes in the codebase. This continuous updating saves developers from the tedious task of keeping tests relevant and current.</li></ul><h3>Top AI Developer Tools for Unit Testing</h3><p>Having identified AI as a suitable companion for writing unit tests, let’s explore some of the available AI tools for unit testing.</p><p><a href="https://www.diffblue.com/"><strong>Diffblue Cover</strong></a>: A fully-automated, AI-powered solution that can autonomously write new Java and Kotlin code, improve existing code, accelerate CI pipelines, and provide deep insights into the risk of unintended change/ regression. Diffblue Cover is available as a CLI tool and as a plugin for IntelliJ IDEA.</p><p><a href="https://github.com/ponicode"><strong>Ponicode</strong></a>: Designed specifically for developers operating with Visual Studio Code, Ponicode supports JavaScript, TypeScript, and Python. Its strength lies in easing the test-writing process. However, it may offer inadequate coverage for complex scenarios and is limited to specific languages and IDEs.</p><p><a href="https://testsigma.com/"><strong>Testsigma</strong></a>: A versatile platform aimed at QA analysts and automation engineers. Testsigma enables automated test creation for web, mobile, and desktop applications, supporting continuous testing and integration workflows. While it may require training and additional manual intervention for advanced scenarios, its broad applicability and intuitive interface make it a noteworthy tool.</p><p><a href="https://www.tabnine.com/"><strong>Tabnine</strong></a>: Boasting multi-language support, Tabnine furnishes unit test generation capabilities for Python, Java, and JavaScript. Designed to boost developer productivity, it focuses on automated test creation, being compatible with various IDEs. However, its generated tests might need tuning, and it is somewhat dependent on existing code quality.</p><p>Other tools include:</p><ul><li><a href="https://rangerdevv.gumroad.com/l/CaseIt?ref=taaft"><strong>CaseIt</strong></a>, a specialized tool for case-testing scenarios.</li><li><a href="https://airtest.netease.com/"><strong>Airtest</strong></a>, aimed at mobile game testing.</li><li><a href="https://bito.ai/"><strong>Bito</strong></a>, used for Behavior-Driven Development (BDD).</li><li>, focusing on web application tests and uses natural language processing to simplify test creation and execution.</li><li><a href="https://checksum.ai/"><strong>Checksum.ai</strong></a>, that employs AI for test creation and maintenance.</li><li><a href="https://carbonate.dev/"><strong>Carbonate</strong></a>, a code coverage analysis tool that identifies areas lacking proper unit testing.</li></ul><h3>Summary: Shaping the Future of Software Testing with AI</h3><p>AI and machine learning is redefining numerous sectors, and software application development is no exception. With its ability to draw on vast repositories of existing code, AI has become a game-changer in this field. While general Large Language Models (LLMs) are effective, specialized AI systems, trained specifically for unit testing, offer far more targeted and efficient solutions.</p><p>The market is already populated with a variety of AI-powered unit testing tools. These tools seamlessly integrate into existing IDEs, simplifying and accelerating the testing process. The key distinctions between these tools are their assistive or suggestion-based nature, which still requires developer input, and fully autonomous solutions like <a href="https://www.diffblue.com/products/">Diffblue Cover,</a> which reduces the amount of developer time spent on unit test writing by an average of 95%.</p><p>The primary advantage of these advanced AI-driven testing tools lies in their ability to simplify and accelerate the testing process. This aligns perfectly with the core objectives of DevOps and, specifically, TestOps and enables agile development teams to deliver faster without breaking things. By automating the often tedious and time-consuming aspects of testing, AI frees up developers to concentrate on more strategic, high-value tasks that demand their creativity and expert judgment.</p><p>Moreover, the shift towards autonomous AI for unit testing is shown to have a profound impact on developer morale. By eliminating the drudgery of manual unit testing, developers find more joy and satisfaction in their work. This heightened state of happiness is not just good for the individual developer; it’s a key driver of overall productivity in the development team. Happier developers translate into more effective, engaged, and innovative teams, leading to superior software products.</p><p>In essence, the integration of AI in unit testing is not just a technical upgrade; it’s a fundamental shift towards a more dynamic, creative, and satisfying software development process.</p><p>Discover how to integrate AI-driven unit testing into your workflow with <a href="https://www.diffblue.com/try-cover/">Diffblue Cover</a>. <a href="https://www.diffblue.com/try-cover/">Start your 14-day free trial now</a> and experience the power of AI for unit testing.</p><p>This guest blog article was written by Philip Riecks. You can find more of his content at <a href="https://rieckpil.de/">https://rieckpil.de/</a></p><p><em>Originally published at </em><a href="https://www.diffblue.com/blog/ai/software%20development/ai-for-unit-testing-revolutionizing-developer-productivity/"><em>https://www.diffblue.com</em></a><em> on January 31, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84e89df16f48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Diffblue Cover Pipeline & GitLab — Autonmous AI unit test generation at scale]]></title>
            <link>https://diffbluehq.medium.com/diffblue-cover-pipeline-gitlab-autonmous-ai-unit-test-generation-at-scale-6fd23cdb6fe8?source=rss-799c69117a12------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fd23cdb6fe8</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[ai-development-tools]]></category>
            <dc:creator><![CDATA[Diffblue]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 06:00:55 GMT</pubDate>
            <atom:updated>2024-03-07T17:13:14.942Z</atom:updated>
            <content:encoded><![CDATA[<h3>Diffblue Cover Pipeline &amp; GitLab — Autonmous AI unit test generation at scale</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*IMqqTnwyLk9HgvMB7NBhRg.png" /><figcaption>Diffblue Cover Pipeline delivers the first AI-powered unit testing solution for Java development teams using GitLab</figcaption></figure><p>Diffblue Cover Pipeline delivers the first AI-powered unit testing solution for Java development teams using GitLab Premium or Ultimate to manage their continuous integration pipelines.</p><p>Cover Pipeline integrates the power of Diffblue Cover directly into your GitLab pipeline to autonomously write Java unit tests for your projects on merge requests. Lofty claims, let’s dive right into the difference that Cover Pipeline makes to individual developers and development teams using GitLab.</p><p>Diffblue Cover creates comprehensive, human-like Java unit tests — saving developer time, increasing test coverage, and reducing regression risks. It takes care of the following, automatically:</p><ul><li>Analyzes a codebase and creates a baseline unit test suite</li><li>Writes new unit tests for new code</li><li>Updates existing unit tests in your code</li><li>Removes existing unit tests in your code when they’re no longer required</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AOhfx6LzrolTK3iV" /></figure><p><strong>How Diffblue Cover works in a GitLab pipeline project (diagram)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pNjXKNmbfLkiGYyE" /></figure><p>Diffblue Cover is not an AI assistant, it is fully autonomous and completely takes care of writing, updating and continuously improving test coverage. As a result of the deep understanding of how your code works, following the initial analysis, Diffblue Cover knows what tests need to be added and updated for every single code change. It implements the necessary unit testing updates automatically, ensuring that coverage does not drop as development teams move faster. The AI-written unit tests are ready to use — they compile, run, and accurately validate the current behavior of your code.</p><p><strong>How Diffblue AI-powered unit testing enables CI</strong></p><p>To understand exactly why this is valuable, we need to first recap some problems that can hinder continuous integration and delivery. The goals of continuous integration are to:</p><ul><li>Encourage test behaviors that help reduce the number of errors and bugs</li><li>Find and address bugs quicker</li><li>Reduce the time it takes to validate and release new software updates</li><li>Improve overall software quality</li></ul><p>Failures in application testing and poor test coverage cause bottlenecks in the development pipeline and increase overall development cycle time. Given that unit tests are the first line of defence against bugs and regressions, it’s critical to unit test deeply, continuously and successfully as part of a CI pipeline, alongside integration testing, in order to realise the true potential benefit of CI.</p><p>Diffblue Cover uses a method of AI machine learning called reinforcement learning, to solve the problem of poor unit test coverage and test failures by autonomously creating and updating unit test suites for Java application development. It enables developers and development teams to catch regressions and unplanned behavior changes more comprehensively than any manual process.</p><p>Take a look at our video overview of Cover Pipeline for GitLab.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2F7UBOTJzjF1E&amp;display_name=YouTube&amp;url=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3D7UBOTJzjF1E&amp;image=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttp%2Fi.ytimg.com%2Fvi%2F7UBOTJzjF1E%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/58cd6be1175fe58a471c471a17970dcb/href">https://medium.com/media/58cd6be1175fe58a471c471a17970dcb/href</a></iframe><p>Diffblue Cover Pipeline Developer <a href="https://docs.diffblue.com/features/cover-pipeline/cover-pipeline-for-gitlab">Docs site</a>.</p><p>We welcome your <strong>feedback</strong> on our GitLab support and if you have ideas for improvements, new features or insights to share about your experience, <strong>we’d love to hear them</strong>.</p><p><em>Originally published at </em><a href="https://www.diffblue.com/blog/software%20development/announcing-diffblues-cover-pipeline-for-gitlab/"><em>https://www.diffblue.com</em></a><em> on January 23, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fd23cdb6fe8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>