<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Developer Zone</title>
	<atom:link href="https://blogs.mathworks.com/developer/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogs.mathworks.com/developer</link>
	<description>Developing, testing, and integrating production grade software using MATLAB.</description>
	<lastBuildDate>Mon, 29 Sep 2025 19:43:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
	<item>
		<title>TL;DR: Too Long; Didn’t Run: Part 4 – Incremental Testing in CI</title>
		<link>https://blogs.mathworks.com/developer/2025/09/29/tldr-too-long-didnt-run-part-4-incremental-testing-in-ci/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2025/09/29/tldr-too-long-didnt-run-part-4-incremental-testing-in-ci/#comments</comments>
		
		<dc:creator><![CDATA[apuvvala]]></dc:creator>
		<pubDate>Mon, 29 Sep 2025 19:43:05 +0000</pubDate>
				<category><![CDATA[Build Tooling]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[MATLAB Test]]></category>
		<category><![CDATA[test impact analysis]]></category>
		<category><![CDATA[Testing]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=4244</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/2025-tia-ci-blog-part5.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><!--introduction-->
<p>In the <a href="https://blogs.mathworks.com/developer/2025/08/20/tldr-too-long-didnt-run-part-3-incremental-testing-with-the-matlab-build-tool/">previous post</a> we explored how to use the MATLAB build tool to run only impacted tests during local, iterative development cycles. In this post, we'll take that concept further and apply incremental testing in a continuous integration (CI) environment to speed up feedback and improve overall throughput.... <a class="read-more" href="https://blogs.mathworks.com/developer/2025/09/29/tldr-too-long-didnt-run-part-4-incremental-testing-in-ci/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class="content"><!--introduction-->
<p>In the <a href="https://blogs.mathworks.com/developer/2025/08/20/tldr-too-long-didnt-run-part-3-incremental-testing-with-the-matlab-build-tool/">previous post</a> we explored how to use the MATLAB build tool to run only impacted tests during local, iterative development cycles. In this post, we'll take that concept further and apply incremental testing in a continuous integration (CI) environment to speed up feedback and improve overall throughput.</p>
<!--/introduction-->
<h2>Contents</h2>
<div>
<ul>
<li>
<a href="#ebf16b03-f3ac-4771-999f-8258cf0bf75a">Example Project: <i>arithmetic</i></a>
</li>
<li>
<a href="#e83568d7-56cb-48a7-9112-b1c4c979a00e">Context</a>
</li>
<li>
<a href="#d80cebc8-1927-4b75-ba01-eb8a1e5a9630">The Build File</a>
</li>
<li>
<a href="#6ad55d00-b3ec-4bf2-9647-0f6c263054c5">CI Pipeline Configuration</a>
</li>
<li>
<a href="#f74199df-1b88-491d-827d-edee2b1665ba">First Run (No Cache)</a>
</li>
<li>
<a href="#502c7c39-045b-4d2a-b269-2eba77a03038">Second Run: Modify <tt>h_my_add.m</tt></a>
</li>
<li>
<a href="#7d8121b9-4ce3-41bd-8881-5ac847978938">Third Run: Modify <tt>my_subtract.m</tt></a>
</li>
<li>
<a href="#f14363e2-509f-4460-be96-608c0c88eafe">Wrapping Up</a>
</li>
</ul>
</div>
<h2>Example Project: <i>arithmetic</i><a name="ebf16b03-f3ac-4771-999f-8258cf0bf75a"></a>
</h2>
<div style="border-left: 4px solid #007acc; background-color: #f0f8ff; padding: 12px 16px; margin: 16px 0; font-family: sans-serif;"><strong>Tip:</strong>To follow along, you can access the supporting files for this post in the <a href="https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-CI">Developer Zone blog GitHub repository</a>. </div>
<p>For this walkthrough, we'll use a simple example project, <i>arithmetic</i>, that contains:</p>
<div>
<ul>
<li>MATLAB functions for basic arithmetic operations.</li>
<li>Unit tests for those functions.</li>
</ul>
</div>
<p>
<b>Project Structure:</b>
</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-project-structure.png" alt=""> </p>
</p>
<p>The <tt>toolbox</tt> folder holds the source code, while the <tt>tests</tt> folder contains tests for those functions.</p>
<h2>Context<a name="e83568d7-56cb-48a7-9112-b1c4c979a00e"></a>
</h2>
<p>Whether (and when) you choose to run only impacted tests versus the full test suite depends on many factors, including:</p>
<div>
<ul>
<li>Project complexity</li>
<li>Branching strategy</li>
<li>Release cadence and workflow</li>
<li>Team or organizational standards</li>
</ul>
</div>
<p>This post does not prescribe a software qualification strategy. Instead, it shows an example of how to achieve incremental testing in CI using the build tool's <i>test impact analysis</i>.</p>
<p>For this example, we'll configure the build to run incremental tests on <b>feature branches</b> whenever a developer pushes changes. The same approach, however, can be adapted to other events such as pull requests, merges to <tt>main</tt> , or nightly builds.</p>
<p>I'll demonstrate this example using <b>GitHub Actions</b>, but this pattern is easily transferable to other CI systems like GitLab CI, Azure DevOps or Jenkins.</p>
<h2>The Build File<a name="d80cebc8-1927-4b75-ba01-eb8a1e5a9630"></a>
</h2>
<p>The <tt>buildfile.m</tt> in the project defines a build plan with a <tt>test</tt> task that runs the project's tests and produces results.</p>
<pre class="language-matlab">
<span class="keyword">function</span> plan = buildfile
import<span class="string"> matlab.buildtool.tasks.*</span>

plan = buildplan(localfunctions);

plan(<span class="string">"clean"</span>) = CleanTask;
plan(<span class="string">"test"</span>) = TestTask(SourceFiles=<span class="string">"toolbox"</span>,TestResults=<span class="string">"results/test-results.xml"</span>);

plan.DefaultTasks=<span class="string">"test"</span>;

<span class="keyword">end</span>
</pre>
<p>Incremental testing is enabled by setting <tt>RunOnlyImpactedTests</tt> property or task argument to true on a TestTask instance. In this example, we will use the task argument at runtime, rather than baking it directly into the <tt>test</tt> task configuration.</p>
<p>As discussed in the <a href="https://blogs.mathworks.com/developer/2025/08/20/tldr-too-long-didnt-run-part-3-incremental-testing-with-the-matlab-build-tool/">previous post</a>, the build tool stores task traces in the <tt>.buildtool</tt> cache folder. A <b>task trace</b> is a MATLAB release-specific record of a task's inputs, outputs, actions and arguments from its last successful run.</p>
<p>By caching and restoring these task traces (and outputs such as test results) appropriately in CI, we can effectively enable the build tool to detect changes and run only impacted tests in CI workflows as well.</p>
<h2>CI Pipeline Configuration<a name="6ad55d00-b3ec-4bf2-9647-0f6c263054c5"></a>
</h2>
<p>The GitHub Actions workflow configuration is defined in <tt>.github/workflows/ci.yml</tt>:</p>
<pre>
name: MATLAB Build

on:
  push:
    branches:
      - 'feature/*'    # Only run on feature branches

  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      # Check out the repository
      - uses: actions/checkout@v4
      
      # Sets up MATLAB on a GitHub-hosted runner
      - name: Set up MATLAB
        uses: matlab-actions/setup-matlab@v2
        with:
          release: R2025a
          products: &gt;
            MATLAB
            MATLAB_Test

      # Cache .buildtool and test results
      - name: Cache buildtool artifacts
        id: buildtool-cache
        uses: actions/cache@v4
        with:
            path: |
                .buildtool
                results
            key: ${{ runner.os }}-buildtool-cache-${{ github.ref_name }}

      # Run MATLAB build
      - name: Run build
        uses: matlab-actions/run-build@v2
        with:
          tasks: test(RunOnlyImpactedTests=1)
          build-options: -verbosity 3
</pre>
<p>The configuration has the following key steps:</p>
<div>
<ul>
<li><strong>Setup MATLAB</strong>
<p>Installs MATLAB R2025a including MATLAB Test using the MathWorks' official <a href="https://github.com/matlab-actions/setup-matlab">matlab-actions/setup-matlab</a> action. We are using GitHub-hosted runners in this demo.</p>
</li>
</ul>
</div>
<div>
<ul>
<li><strong>Setup Caching</strong>
<p>Cache and restore the <tt>.buildtool</tt> folder and <tt>results/</tt> directory. The cache key, in this example, includes the OS and branch name (e.g., Linux-buildtool-cache-feature/cache). See <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#cache-action-usage">GitHub Actions cache action usage</a> for more information on how to use cache action and how key matching works.</p></li>
</ul>
</div>
<div>
<ul>
<li><strong>Run MATLAB</strong>
<p>Uses <a href="https://github.com/matlab-actions/run-build">matlab-actions/run-build</a> to execute the test task with RunOnlyImpactedTests=true to run only impacted tests.</p></li>
</ul>
</div>
<h2>First Run (No Cache)<a name="f74199df-1b88-491d-827d-edee2b1665ba"></a>
</h2>
<p>Let's create a feature branch <tt>feature/cache</tt> under this blog's branch <tt>2025-Test-Impact-Analysis-CI</tt>.</p>
<p>On the first pipeline run, there is no cache hit for key <tt>Linux-buildtool-cache-feature/cache</tt>.</p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-first-run-cache-miss.png" alt="" width="640" height="180"> </p>
<p>All tests run because no prior traces exist: </p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-first-run-all-tests.png" alt="" width="640" height="180"> </p>
</p>
<p>The pipeline then creates and saves a cache for the <strong>feature/cache</strong> branch for future runs:</p>
<p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-first-run-cache.png" alt="" width="480" height="120"> </p>
</p>
<h2>Second Run: Modify <tt>h_my_add.m</tt><a name="502c7c39-045b-4d2a-b269-2eba77a03038"></a>
</h2>
<p>Let's make a change.</p>
<div>
<ul>
<li>Clone the repository at branch <tt>2025-Test-Impact-Analysis-CI</tt>.</li>
<li>Run the build locally within MATLAB using <tt>buildtool</tt>. All the tests will run since there are no task traces yet.</li>
</ul>
</div>
<p>Next, checkout and switch to the <tt>feature/cache</tt> branch, then modify <tt>h_my_add.m</tt>, say, by adding an arguments block:</p>
<pre class="language-matlab">
<span class="keyword">function</span> out = h_my_add(in1, in2)
<span class="comment">% This is a helper function to add 2 values</span>

<span class="keyword">arguments</span> 
     in1 {mustBeNumeric}
     in2 {mustBeNumeric}
<span class="keyword">end</span>

out = in1 + in2;
<span class="keyword">end</span>
</pre>
<p>Verify locally with:</p>
<pre class="language-matlab">&gt;&gt; buildtool test(RunOnlyImpactedTests=1) -verbosity 3
</pre>
<p>
<div style="border-left: 4px solid #007acc; background-color: #f0f8ff; padding: 12px 16px; margin: 16px 0; font-family: sans-serif;"><strong>Tip: </strong>Running the build at verbosity 3 or higher shows you what exactly has changed and why the task is re-running.</div>
<p>
<b>Output (excerpt)</b> :</p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-second-run-local.png" alt="" width="640" height="180"> </p>
<p>Only 8 out of 21 tests were selected to run&mdash;those impacted by the modified file. That's promising!</p>
<p>Now let's push the changes and inspect the CI pipeline.</p>
<p>We see a cache hit and it confirms the <tt>.buildtool</tt> and <tt>results</tt> folder were restored.</p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-feature-cache-hit.png" alt="" width="640" height="180"> </p>
<p>The build tool leverages the restored cache to run only impacted tests.</p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-feature-cache-run-build.png" alt="" width="640" height="180"> </p>
<h2>Third Run: Modify <tt>my_subtract.m</tt><a name="7d8121b9-4ce3-41bd-8881-5ac847978938"></a>
</h2>
<p>Make another change, commit, and push. The cache is restored again, and now only the tests impacted by both outstanding changes on the feature branch are executed:</p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-third-run-cache-hit.png" alt="" width="640" height="180"> </p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-tia-ci-third-run-impacted-tests.png" alt="" width="640" height="180"> </p>
<h2>Wrapping Up<a name="f14363e2-509f-4460-be96-608c0c88eafe"></a>
</h2>
<p>There you have it! This workflow demonstrates how to combine: 
<div>
<ul>
<li>MATLAB build tool's test impact analysis, and</li>
<li>CI platform's caching</p></li>
</ul>
</div>
<p>... to achieve incremental testing in CI.</p>
<p>You can refine this pattern by adding things like: 
<div>
<ul>
<li>Adding cache restore keys to support fallback scenarios.</li> 
<li>Adjusting cache keys for multi-platform or multi-branch setups.</li> 
<li>Deciding when to run incremental tests vs. full regression tests.</li>
</p>
</ul>
</div>
<p><em>Would you run incremental testing in your CI pipeline? At what point in your release cycle do you feel most comfortable running only impacted tests?</em></p>
<hr>
<p>
We envision continuing to invest in making incremental testing better across both local development and CI workflows. Your feedback is essential in helping us focus on the improvements that matter most to you. So, leave us your thoughts in the comments section below.
</p>
<p>
That’s a wrap (for now) on our series about Test Impact Analysis. Stay tuned — we have more software development topics in the pipeline, and we look forward to sharing them with you!
</p>
<script language="JavaScript"> <!-- 
    function grabCode_505b7ee61872420f9dcd2b3a2f0c5c47() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='505b7ee61872420f9dcd2b3a2f0c5c47 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 505b7ee61872420f9dcd2b3a2f0c5c47';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        copyright = 'Copyright 2025 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add copyright line at the bottom if specified.
        if (copyright.length > 0) {
            d.writeln('');
            d.writeln('%%');
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');

        d.title = title + ' (MATLAB code)';
        d.close();
    }   
     --> </script>
<p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray">
<br>
<a href="javascript:grabCode_505b7ee61872420f9dcd2b3a2f0c5c47()"><span style="font-size: x-small;        font-style: italic;">Get 
      the MATLAB code <noscript>(requires JavaScript)</noscript>
</span></a>
<br>
<br>
      Published with MATLAB&reg; R2025a<br>
</p>
</div>
<!--
505b7ee61872420f9dcd2b3a2f0c5c47 ##### SOURCE BEGIN #####
%% 
% In the <https://blogs.mathworks.com/developer/2025/08/20/tldr-too-long-didnt-run-part-3-incremental-testing-with-the-matlab-build-tool/ previous post> we explored how to use the MATLAB build tool to run only impacted tests
% during local, iterative development cycles. In this post, we'll take that
% concept further and apply incremental testing in a continuous integration
% (CI) environment to speed up feedback and improve overall throughput.
% 
%% Example Project: _arithmetic_ 
% For this walkthrough, we'll use a simple example project,
% _arithmetic_, that contains:
% 
% * MATLAB functions for basic arithmetic operations.
% * Unit tests for those functions. 
%
% *Project Structure:* 
%
%   PROJECT_ROOT
%       │   arithmetic.prj
%       │   buildfile.m
%       │
%       ├───.github
%       │   └───workflows
%       │           ci.yml
%       │
%       ├───tests
%       │       MyAddTest.m
%       │       MyCalculateTest.m
%       │       MyDivideTest.m
%       │       MyMultiplyTest.m
%       │       MySubtractTest.m
%       │
%       └───toolbox
%               h_my_add.m
%               my_add.m
%               my_calculate.m
%               my_divide.m
%               my_multiply.m
%               my_subtract.m
%
% The |toolbox| folder holds the source code, while the |tests| folder 
% contains tests for those functions.
% 
%% Context
% Whether (and when) you choose to run only impacted tests versus the full
% test suite depends on many factors, including:
% 
% * Project complexity
% * Branching strategy
% * Release cadence and workflow
% * Team or organizational standards
%
% This post does not prescribe a software qualification strategy. Instead,
% it shows an example on how to achieve incremental testing in CI using the
% build tool's _test impact analysis_.
% 
% For this example, we'll configure the build to run incremental tests on
% *feature branches* whenever a developer pushes changes. The same
% approach, however, can be adapted to other events such as pull requests,
% merges to |main| , or nightly builds.
% 
% I'll demonstrate this example using *GitHub Actions*, but this pattern is
% easily transferable to other CI systems like GitLab CI, Azure DevOps or
% Jenkins.
%
%% The Build File
% The |buildfile.m| in the project defines a build plan with a |test| task
% that runs the project's tests and produces results.
% 
% <include>buildfile.m</include>
%
% Incremental testing is enabled by setting |RunOnlyImpactedTests| property
% or task argument to true on a TestTask instance. In this example, we will
% use the task argument at runtime, rather than baking it directly into the
% |test| task configuration.
% 
% As discussed in the previous post, the build tool stores task traces in
% the |.buildtool| cache folder. A *task trace* is a MATLAB
% release-specific record of a task's inputs, outputs, actions and
% arguments from its last successful run.
% 
% By caching and restoring these task traces (and outputs such as test
% results) in CI, we can effectively enable the build tool to detect changes
% and run only impacted tests in CI workflows as well. 
% 
%% CI Pipeline Configuration
% The GitHub Actions workflow configuration is defined in
% |.github/workflows/ci.yml|:
% 
% <include>.github/workflows/ci.yml</include>
% 
% The configuration has the following key steps:
% 
% * Setup MATLAB
% Installs MATLAB R2025a including MATLAB Test using the MathWorks'
% official <https://github.com/matlab-actions/setup-matlab matlab-actions/setup-matlab> action. 
% 
% * Setup Caching 
% Cache and restore the |.buildtool| folder and |results/| directory. The
% cache key, in this example, includes the OS and branch name (e.g.,
% Linux-buildtool-cache-feature/cache). See
% <https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#cache-action-usage
% GitHub Actions cache action usage> for more information on how to use
% cache action and how key matching works.
% 
% * Run MATLAB
% Uses <https://github.com/matlab-actions/run-build
% matlab-actions/run-build> to execute the test task with
% RunOnlyImpactedTests=true to run only impacted tests. 
% 
%% First Run (No Cache)
% Let's create a feature branch |feature/cache| under this blog's branch
% |2025-Test-Impact-Analysis-CI|. 
% 
% On the first pipeline run, there is no cache hit for key
% |Linux-buildtool-cache-feature/cache|.
% 
% <<2025-tia-ci-first-run-cache-miss.png>>
% 
% All tests run because no prior traces exist:
% <<2025-tia-ci-first-run-all-tests.png>>
% 
% The pipeline then creates and saves a cache for the |feature/cache| branch for future runs:
% <<2025-tia-ci-first-run-cache.png>>
% 
% <<created_cache>>
% 
%% Second Run: Modify |h_my_add.m|
% Let's make a change. 
%
% * Clone the repository at branch |2025-Test-Impact-Analysis-CI|. 
% * Run the build locally with |buildtool|. 
% ** On the first run, all the tests run (no task traces yet).
%   
% Next, checkout and switch to the |feature/cache| branch, then modify
% |h_my_add.m|, say, by adding an arguments block:
% 
%   arguments 
%       in1 {mustBeNumeric}
%       in2 {mustBeNumeric}
%   end
% 
%   Verify locally with:
% 
%   >> buildtool test(RunOnlyImpactedTests=1) -verbosity 3
% 
%   *Tip:* Run the build at verbosity 3 or higher to see exactly what has
%          changed and why the task is re-running.
% 
%   *Output (excerpt)* :
%   ** Starting test because:
%   ** REPLACE_WITH_DASH_DASH> Input 'SourceFiles' modified
%   **     REPLACE_WITH_DASH_DASH> Files modified: 'toolbox\h_my_add.m'
%   **  Evaluating task action: runTests
%   Finding impacted tests...
%   REPLACE_WITH_DASH_DASH> Found 8 tests impacted by changes since the last successful run (21 total).
%   Setting up matlab.unittest.fixtures.ProjectFixture
%   Done setting up matlab.unittest.fixtures.ProjectFixture in 0.0042568 seconds: Project 'arithmetic' is already loaded. Setup is not required.
%   __________
% 
%   Running MyAddTest
%   <SNIP>
%   Done MyAddTest in 0.013943 seconds
%   __________
% 
%   Running MyCalculateTest
%   <SNIP>
%   Done MyCalculateTest in 0.041587 seconds
%   __________
% 
%   <SNIP>    
% 
%   Test Summary:
%        Total Tests: 8
%             Passed: 8
%             Failed: 0
%         Incomplete: 0
%           Duration: 0.061731 seconds testing time.
% 
%   <SNIP>
% ** Finished test in 1.1026 seconds
% 
% Only 8 out of 21 tests were selected to run—those impacted by the
% modified file. That's promising!
% 
% Now let's push the changes and inspect the CI pipeline.
% 
% <<2025-tia-ci-feature-push-trigger.png>>
% 
% We see a cache hit and it confirms the |.buildtool| and |results| folder were restored. 
% 
% <<2025-tia-ci-feature-cache-hit.png>>
% 
% The build tool leverages the restored cache to run only impacted tests.
% 
% <<2025-tia-ci-feature-cache-run-build.png>>
% 
%% Third Run: Modify |my_subtract.m|
% Make another change, commit, and push. The cache is restored again, and
% now only the tests impacted by both outstanding changes on the feature
% branch are executed:
% 
% <<2025-tia-ci-third-run-cache-hit.png>>
% 
% <<2025-tia-ci-third-run-impacted-tests.png>>
%
%% Wrapping Up
% There you have it! This workflow demonstrates how to combine:
% * MATLAB build tool's test impact analysis
% * CI platform's output caching
% 
% ... to achieve incremental testing in CI. 
% 
% You can refine this pattern by adding things like:
% * Adding cache restore keys to support fallback scenarios.
% * Adjusting cache keys for multi-platform or multi-branch setups.
% * Deciding when to run incremental tests vs. full regression tests.
% 
% Would you run incremental testing in your CI pipeline? At what point in
% your release cycle do you feel most comfortable running only impacted
% tests?
%
% We anticipate investing in improving incremental testing across both
% local and CI workflows. Your feedback will help us prioritize what
% matters most to you.
% 
% That's a wrap (for now) for this series on *Test Impact Analysis* but
% stay tuned, we are lining up more software development topics to bring to
% you!

##### SOURCE END ##### 505b7ee61872420f9dcd2b3a2f0c5c47
-->
]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2025/09/29/tldr-too-long-didnt-run-part-4-incremental-testing-in-ci/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>TL;DR: Too Long; Didn’t Run: Part 3 – Incremental Testing with the MATLAB Build Tool</title>
		<link>https://blogs.mathworks.com/developer/2025/08/20/tldr-too-long-didnt-run-part-3-incremental-testing-with-the-matlab-build-tool/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2025/08/20/tldr-too-long-didnt-run-part-3-incremental-testing-with-the-matlab-build-tool/#comments</comments>
		
		<dc:creator><![CDATA[apuvvala]]></dc:creator>
		<pubDate>Wed, 20 Aug 2025 18:21:20 +0000</pubDate>
				<category><![CDATA[Build Tooling]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[MATLAB Test]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[test impact analysis]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=4040</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/Incremental_Testing_ROIT_3.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="Incremental testing with MATLAB build tool" decoding="async" loading="lazy" /></div><!--introduction-->

<p><em>Alright! I'm back after a mid-series break to continue our talk about incremental testing.</em>... <a class="read-more" href="https://blogs.mathworks.com/developer/2025/08/20/tldr-too-long-didnt-run-part-3-incremental-testing-with-the-matlab-build-tool/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class="content">

<!--introduction-->

<p><em>Alright! I'm back after a mid-series break to continue our talk about incremental testing.</em></p>
<p>In parts <a href="https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/">1</a> and <a href="https://blogs.mathworks.com/developer/2025/07/23/test-impact-analysis-test-manager/">2</a>, we looked at interactive development workflows to help run the right set of tests at the right time. In this post, we'll look at how that same idea extends to automated builds using the MATLAB build tool, and specifically, how incremental testing enables faster local prequalification. The motivation remains the same – to enable frequent, high-quality integrations verified by automated builds, without incurring the overhead of running the full regression suite after every incremental change.</p>

<p>Running all the tests might be manageable at small scale but it quickly becomes prohibitively expensive for larger projects.</p>
<div style="border-left: 4px solid #007acc; background-color: #f0f8ff; padding: 12px 16px; margin: 16px 0; font-family: sans-serif;">This post assumes that you are somewhat familiar with the <a href="https://www.mathworks.com/help/matlab/matlab_prog/overview-of-matlab-build-tool.html">MATLAB build tool</a>. It provides a uniform and standardized way to define and run MATLAB builds.</div>
<!--/introduction-->
<h3>Contents</h3>
<div>
<ul>
 	<li><a href="#c1d7c55e-08fe-4d91-a283-e617f1b26733">What Is Incremental Testing?</a></li>
 	<li><a href="#3a5dd755-05e9-4b4b-b978-c23d6a17fa7c">Background</a></li>
 	<li><a href="#7ffca756-1a67-45f8-b564-b93ae037796a">Defining the Build</a></li>
 	<li><a href="#2b1b0609-b83c-454d-b79d-eb8dc4d17c05">Optimizing Performance with Incremental Build</a></li>
 	<li><a href="#64a78dc2-ff90-47a3-85ed-e66556c0c7a9">Enabling Incremental Testing</a></li>
 	<li><a href="#6581c44f-ab93-44a3-ad8c-219d842654b7">A Closer Look at Impact-Based Testing</a></li>
 	<li><a href="#ea885be6-ecda-484d-97b2-5679a814a414">Interaction Between Incremental Build and Incremental Testing</a></li>
 	<li><a href="#6340e957-281e-41d0-863d-f33c9a483ed6">Summary</a></li>
</ul>
</div>
<h2>What Is Incremental Testing?<a name="c1d7c55e-08fe-4d91-a283-e617f1b26733"></a></h2>
<p>The MATLAB build tool supports <a href="https://www.mathworks.com/help/matlab/matlab_prog/improve-performance-with-incremental-builds.html">incremental builds</a>, which skips unnecessary work by tracking each build task's inputs, outputs, actions and arguments to determine if the task is up-to-date. If nothing has changed since its last successful run, the task is skipped.</p>

<p>Starting in <strong>R2025a</strong>, the build tool enhances this capability with incremental testing, available with MATLAB Test. While incremental build determines whether a task should rerun, incremental testing goes further – it uses test impact analysis to decide which tests need to run. This can significantly optimize test execution and speed up your builds.</p>

<p>With incremental testing enabled, the build tool analyzes the source and test code changes and runs only tests impacted by those changes.</p>

<p>Let's unpack how this works. We'll start with some basics.</p>
<h2>Background<a name="3a5dd755-05e9-4b4b-b978-c23d6a17fa7c"></a></h2>
<p>We'll use the same goal as in <a href="https://blogs.mathworks.com/developer/2025/07/23/test-impact-analysis-test-manager/">Part 2</a> – enhancing the AND perceptron to introduce a trainable bias term. The exact goal isn't critical; it's just a useful backdrop.</p>
<div style="border-left: 4px solid #007acc; background-color: #f0f8ff; padding: 12px 16px; margin: 16px 0; font-family: sans-serif;"><strong>Tip:</strong> You can access the supporting files for this post in the <a href="https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-Build-Tool">Developer Zone blog GitHub repository</a>. The <a href="https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-Build-Tool/before">"before"</a> folder contains the original code to reproduce the steps outlined in this blog, while the <a href="https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-Build-Tool/after">"after"</a> folder includes the final version of the code.</div>
<h3>Defining the Build<a name="7ffca756-1a67-45f8-b564-b93ae037796a"></a></h3>
<p>A <tt>buildfile.m</tt> at the project root defines your MATLAB build.</p>
<img decoding="async" loading="lazy" class="alignnone" src="https://blogs.mathworks.com/developer/files/buildfile_location.png" alt="" width="438" height="170" hspace="5" vspace="5" />
<p>This build file creates a plan that describes how to build your project – it defines a set of build tasks and their dependencies to establish a task graph to execute with a single <a href="https://www.mathworks.com/help/matlab/ref/buildtool.html">buildtool</a> command.</p>
<pre class="language-matlab"><span class="keyword">function</span> plan = buildfile 
import <span class="string">matlab.buildtool.tasks.*

</span>plan = buildplan(localfunctions);

plan(<span class="string">"clean"</span>) = CleanTask;
plan(<span class="string">"test"</span>) = TestTask(<span class="string">"tests"</span>, SourceFiles=<span class="string">"toolbox"</span>);

plan.DefaultTasks=<span class="string">"test"</span>;

<span class="keyword">end</span>
</pre>
<p>In this example, the build file includes:</p>
<ul>
 	<li>A <tt>test</tt> task to run tests.</li>
 	<li>A <tt>clean</tt> task to delete task outputs and traces.</li>
</ul>
<p>These tasks are created using the <a href="https://www.mathworks.com/help/matlab/ref/matlab.buildtool.tasks-package.html">built-in task classes</a>. Built-in task classes simplify defining common tasks like identifying code issues, building MEX binaries and testing. These classes are designed for reuse and generally support <a href="https://www.mathworks.com/help/matlab/matlab_prog/improve-performance-with-incremental-builds.html">incremental build</a> out of the box.</p>

<p>Our <tt>test</tt> task uses the <a href="https://www.mathworks.com/help/matlab/ref/matlab.buildtool.tasks.testtask-class.html">matlab.buildtool.tasks.TestTask</a> class, which runs tests using the MATLAB Unit Testing Framework.</p>

<h3>Optimizing Performance with Incremental Build<a name="2b1b0609-b83c-454d-b79d-eb8dc4d17c05"></a></h3>
<p>Before diving into incremental testing, let's briefly look at how incremental build works.</p>

<p>When we first clone our repository, the build tool has no task traces.</p>
<div style="border-left: 4px solid #007acc; background-color: #f0f8ff; padding: 12px 16px; margin: 16px 0; font-family: sans-serif;">A <b>task trace</b> is a MATLAB release-specific record of a task's inputs, outputs, actions and arguments from its last successful run.</div>
</div>
<p>So, when we run the <tt>test</tt> task, it runs because there are no traces yet, and runs <em>all</em> the tests defined by the task.</p>
<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/run_with_no_task_trace.png" alt="" width="301" height="64" hspace="5" vspace="5" />
<p>...</p>
<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/test_run_summary_no_task_trace.png" alt="" width="438" height="170" hspace="5" vspace="5" />
<br><br>
<p>This is nice because it gives us confidence that the repository is in a known-good state before making any code changes.</p>

<p>The build tool creates a <tt>.buildtool</tt> cache folder in the project root folder to store the task traces.</p>
<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/task_trace_folder.png" alt="" width="549" height="251" hspace="5" vspace="5" />
<br><br>
<p>On subsequent builds, if nothing has changed, the task is skipped.</p>
<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/skipped_task.png" alt="" width="294" height="82" hspace="5" vspace="5" />

<br><br>
<p>Now, let's say we modify a source file like <tt>initializeWeights.m</tt>, and re-run the build.</p>

<img decoding="async" loading="lazy" src="https://blogs.mathworks.com/developer/files/sample_change_source_control.png" alt="" width="549" height="251" hspace="5" vspace="5" />

<br><br>
<p>Since this file is tracked via the <tt>SourceFiles</tt> property, one of the task inputs of the test task that the build tool tracks as part of <a href="https://www.mathworks.com/help/matlab/ref/matlab.buildtool.tasks.testtask-class.html#mw_96cca6ff-6c81-4dd9-87d2-5c7df47b475b">up-to-date check</a>, the tool recognizes the changes and re-runs the task.</p>

<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/rerun_after_sample_change.png" alt="" width="410" height="244" hspace="5" vspace="5" />

<br><br>
<p>Nice! But do we really need to run all the tests for that single source file change? Wouldn't it be better if the <tt>test</tt> task ran just the impacted tests. That's exactly what incremental testing in R2025a delivers.</p>
<h2>Enabling Incremental Testing<a name="64a78dc2-ff90-47a3-85ed-e66556c0c7a9"></a></h2>
<p>So, how do we get the incremental testing behavior?</p>

<p>Incremental testing is powered by test impact analysis. To enable it, you can simply run the <tt>test</tt> task with the <tt>RunOnlyImpactedTests</tt> task argument.</p>
<pre class="language-matlab">&gt;&gt; buildtool test(RunOnlyImpactedTests=1)
</pre>
<p>Let's look at an example. Say we change <tt>initializeWeights.m</tt> and <tt>calculateWeightedSum.m</tt> as part of our perceptron enhancement, like we did in Part 2:</p>
<b>initializeWeights.m</b>
<p><u>Before:</u></p>
<pre class="language-matlab"><span class="keyword">function </span>weights = initializeWeights()
<span class="comment">% Initialize weights randomly for two inputs and one bias
</span>weights = rand(1,3) * 0.5;
<span class="keyword">end</span>
</pre>
<p><u>After:</u></p>
<pre class="language-matlab"><span class="keyword">function </span>[weights, bias] = initializeWeights(numInputs)
<span class="comment">% Initialize weights and bias randomly
</span>weights = rand(1, numInputs); <span class="comment">% Random weights for each input
</span>bias = rand() - 0.5; <span class="comment">% Bias initialized to a small random value between -0.5 and 0.5
</span><span class="keyword">end</span>
</pre>
<p><b>calculateWeightedSum.m</b></p>
<p><u>Before:</u></p>
<pre class="language-matlab"><span class="keyword">function </span>output = calculateWeightedSum(weights, inputs)
<span class="comment">% Compute the weighted sum
</span>total_input = sum(weights .* [inputs, 1]); 
<span class="comment">
% Activation logic
</span><span class="keyword">if </span>total_input &gt; 0 
<span class="comment">% step function threshold; activate if weighted sum is positive
</span>   output = 1;
<span class="keyword">else
</span>   output = 0;
<span class="keyword">end
</span><span class="keyword">end</span>
</pre>
<p><u>After:</u></p>
<pre class="language-matlab"><span class="keyword">function </span>output = calculateWeightedSum(weights, bias, inputs)
<span class="comment">% Compute the weighted sum
</span>total_input = sum(weights .* inputs) + bias;

<span class="comment">% Activation logic
</span><span class="keyword">if </span>total_input &gt; 0
<span class="comment">% step function threshold; activate if weighted sum is positive
</span>   output = 1;
<span class="keyword">else
</span>   output = 0;
<span class="keyword">end
</span><span class="keyword">end</span>
</pre>
<p>When you set <tt>RunOnlyImpactedTests</tt> to <tt>true</tt>, the <tt>test</tt> task analyzes those changes and runs only the impacted tests. Look at that!</p>

<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/run_impacted_tests.png" alt="" width="712" height="221" hspace="5" vspace="5" />

<br><br>
<p>Behind the scenes, the build tool tracks changes to the source and test files of the <tt>test</tt> task created using the the built-in <tt>TestTask</tt> class (more on this later in the post). When <tt>RunOnlyImpactedTests</tt> is true, the <tt>test</tt> task doesn't just detect that the files changed – it determines which tests are impacted by those changes and runs only those.</p>

<p>Increasing the build verbosity to level 3 (<tt>Detailed</tt>) or higher reveals which changes are causing the task to rerun. In our example, we see that the <tt>SourceFiles</tt> property has changed because <tt>initializeWeights.m</tt> and <tt>calculateWeightedSum.m</tt> were modified.</p>

<p>As seen in <a href="https://blogs.mathworks.com/developer/2025/07/23/test-impact-analysis-test-manager/">Part 2</a>, changes to just those two files do not meet the goal. The diagnostics will reflect this.</p>

<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/run_impacted_tests_failures.png" alt="" width="585" height="202" hspace="5" vspace="5" />

<p>Let's fix the rest of the code base like we did in Part 2 to ensure we have all the necessary changes and rerun the build with incremental testing.</p>

<p><i>After some coding and a cup of coffee...</i></p>

<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/rerun_impacted_tests.png" alt="" width="779" height="147" hspace="5" vspace="5" />

<br><br>
<p>Success! The build passes and we ran just the related tests.</p>

<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/run_impacted_tests_success.png" alt="" width="483" height="169" hspace="5" vspace="5" />

<br><br>
<p>Our toy example had just 5 tests, but real-world projects can have hundreds or even thousands – so the potential for performance gain is substantial.</p>

<p>To avoid the need to specify the task argument every time, we can configure the test task at plan-creation time in your <tt>buildfile.m</tt> to always run only impacted tests by default.</p>

<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/buildfile_roit.png" alt="" width="648" height="239" hspace="5" vspace="5" />

<br><br>
<p>Then at run time, we can specify just "test".</p>
<pre class="language-matlab">&gt;&gt; buildtool test
</pre>
<p>You can toggle the <tt>RunOnlyImpactedTests</tt> option at run time or create separate test tasks with and without incremental testing to match your workflow preferences.</p>
<h2>A Closer Look at Impact-Based Testing<a name="6581c44f-ab93-44a3-ad8c-219d842654b7"></a></h2>
<p>Impact-based testing involves two key concepts:</p>
<div>
<ul>
 	<li><strong>Change Detection</strong> refers exclusively to the concern of detecting changes to the task's tracked files</li>
 	<li><strong>Impact Analysis</strong> refers exclusively to the concern of analyzing the impact of those changes.</li>
</ul>
</div>
<h3>Change Detection</h3>
<p>When you enable test impact analysis, the <tt>TestTask</tt> detects changes to source files, supporting files and tests as defined by the task's <tt>SourceFiles</tt>, <tt>SupportingFiles</tt>, and <tt>Tests</tt> properties. It also tracks test class folders and test super classes.</p>

<p>But what is the change window? … <em>It's the changes <strong>since the last successful run</strong></em>.</p>

<p>A picture may help… it always goes a long way for me.</p>

<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/change_window.png" alt="" width="568" height="265" hspace="5" vspace="5" />

<p>For example, let's suppose you have a successful build, <b>b<sup>1</sup></b>. After you make a change <b>C1</b>, and run the build, the build tool checks for changes in source, supporting, and test files since <b>b<sup>1</sup></b>. If <b>C1</b> causes a regression and <b>b<sup>2</sup></b> fails, the next build, <b>b<sup>3</sup></b> still uses <b>b<sup>1</sup></b> as the reference point – because it's the last successful run. This ensures the integrity of your commits and code integration.</p>

<p>Only files that are <i>added</i> or <i>modified</i> are considered for impact analysis; <i>removed</i> files are not. If you're using MATLAB projects, removing a file triggers dependency analysis to help you identify which files are affected so you action appropriately and clean up cruft and dead code.</p>

<p>In summary, change detection:</p>
<ul>
 	<li>Detects files defined by the <tt>SourceFiles</tt>, <tt>SupportingFiles</tt> and <tt>Tests</tt> properties of the <tt>test</tt> task.</li>
 	<li>Detects files that are either <i>added</i> or <i>modified</i>.</li>
 	<li>Detects changes since the last successful task run.</li>
</ul>
<h3>Impact Analysis</h3>
<p>Like the <b>Find Tests</b> (<a href="https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/">Part 1</a>) feature in the Editor and <b>Impacted Tests Since Last Commit</b> option (<a href="https://blogs.mathworks.com/developer/2025/07/23/test-impact-analysis-test-manager/">Part 2</a>) in the MATLAB test manager app, the TestTask also leverages <a href="https://www.mathworks.com/help/matlab/ref/dependencyanalyzer-app.html#mw_16e23e55-ae1c-4228-8f5f-97273d840a70">dependency analysis</a> to find impacted tests. It leverages it via the <a href="https://www.mathworks.com/help/matlab-test/ref/matlabtest.selectors.dependson-class.html">DependsOn</a> test selector, which, in R2025a, enhanced the accuracy of test selection with the ability to select individual tests within a test file.</p>
<div style="border-left: 4px solid #007acc; background-color: #f0f8ff; padding: 12px 16px; margin: 16px 0; font-family: sans-serif;"><strong>Reminder:</strong> Static analysis isn't perfect. It has <a href="https://www.mathworks.com/help/matlab/ref/dependencyanalyzer-app.html#mw_16e23e55-ae1c-4228-8f5f-97273d840a70">limitations</a>. Use incremental testing with vigilance and discipline – <b>trust but verify</b>. Always run the full test suite at key points in your release cycle to ensure complete coverage and confidence.</div>
<h2>Interaction Between Incremental Build and Incremental Testing<a name="ea885be6-ecda-484d-97b2-5679a814a414"></a></h2>
<p>Earlier, I mentioned that if a task's inputs, outputs, actions and arguments haven't changed since the last successful run, the build tool skips the task. The <tt>RunOnlyImpactedTests</tt> option is itself considered an input to the task, so incremental build applies to this property as well.</p>

<img decoding="async" loading="lazy" class="" src="https://blogs.mathworks.com/developer/files/skipped_task_roit.png" alt="" width="603" height="331" hspace="5" vspace="5" />

<br><br>
<p>When you rerun the test task with the same <tt>RunOnlyImpactedTests</tt> value and the task has no other changes either, the build tool skips the task. Why? 'cuz of Incremental Build!</p>
<h3>Quiz Time!</h3>
<p>Suppose you change the <tt>TestResults</tt> task output property:</p>

<p><em>From:</em></p>
<pre class="language-matlab">plan(<span class="string">"test"</span>) = TestTask(<span class="string">"tests"</span>, SourceFiles = <span class="string">"toolbox"</span>, TestResults = <span class="string">"results/test-results.xml"</span>);
</pre>
<p><em>To:</em></p>
<pre class="language-matlab">plan(<span class="string">"test"</span>) = TestTask(<span class="string">"tests"</span>, SourceFiles = <span class="string">"toolbox"</span>, TestResults = <span class="string">"results/test-results.html"</span>);
</pre>
<p><em>Question</em>: What tests will run if <tt>RunOnlyImpactedTests</tt> is set to <tt>true</tt>, assuming the above <tt>buildfile.m</tt> is the only change made in your project since the last successful run and no other changes?</p>

<p>Let us know what you think in the comments!</p>

<p><b>Extra Credit:</b></p>
<p>In <tt>buildfile.m</tt>, <a href="https://www.mathworks.com/help/matlab/ref/matlab.buildtool.task-class.html?searchHighlight=DisableIncremental&amp;s_tid=srchtitle_support_results_2_DisableIncremental">disable incremental build</a>:</p>
<pre class="language-matlab">plan(<span class="string">"test"</span>) = TestTask(<span class="string">"tests"</span>, SourceFiles = <span class="string">"toolbox"</span>, TestResults = <span class="string">"results/test-results.xml"</span>);
plan(<span class="string">"test"</span>).DisableIncremental = 1;
</pre>
<p>Then run:</p>
<pre class="language-matlab">&gt;&gt; buildtool test(RunOnlyImpactedTests=1)
</pre>
<p><em>Question:</em> What tests do you expect to run? And why? Share your thoughts in the comments.</p>
<p>I will share the answers in the comments next week!</p>
<h2>Summary<a name="6340e957-281e-41d0-863d-f33c9a483ed6"></a></h2>
<p>There you have it! Incremental testing with the MATLAB Build Tool and MATLAB Test can greatly improve the efficiency of automated builds, locally and in CI, by running only the tests impacted by recent changes. It complements interactive development and helps reduce test times without sacrificing coverage.</p>

<p>While static dependency analysis has limitations, incremental testing can deliver substantial value with some user awareness and discipline.</p>

<p>This post focused on local builds, but the same benefits apply to CI environment as well – we'll dive into that in the next part!</p>

<p><i>Would you consider using incremental testing in your workflows? What challenges do you foresee? Are there gaps in change detection or impact analysis that MathWorks could address to help you trust incremental testing more? We'd love to hear your thoughts – share them in the comments section below!</i></p>
<script language="JavaScript"> <!-- 
    function grabCode_56f6e7b4223646428020c27162ba6f75() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='56f6e7b4223646428020c27162ba6f75 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 56f6e7b4223646428020c27162ba6f75';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        copyright = 'Copyright 2025 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add copyright line at the bottom if specified.
        if (copyright.length > 0) {
            d.writeln('');
            d.writeln('%%');
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');

        d.title = title + ' (MATLAB code)';
        d.close();
    }   
     --> </script>
<p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray">
<br>
<a href="javascript:grabCode_56f6e7b4223646428020c27162ba6f75()"><span style="font-size: x-small;        font-style: italic;">Get 
      the MATLAB code <noscript>(requires JavaScript)</noscript>
</span></a>
<br>
<br>
      Published with MATLAB&reg; R2025a<br>
</p>
</div>
<!--
56f6e7b4223646428020c27162ba6f75 ##### SOURCE BEGIN #####
%%
% Alright! I'm back after a mid-series break to continue our talk about
% incremental testing.
%
% In parts 1 and 2, we looked at interactive development workflows to help
% run the right set of tests at the right time. In this post, we'll look at
% how that idea extends to automated builds using the MATLAB build tool,
% and specifically, how incremental testing enables faster local
% prequalification. The motivation remains the same – to enable frequent,
% high-quality integrations verified by automated builds, without incurring
% the overhead of running the full regression suite after every change.
%
% Running all the tests might be manageable at small scale but it quickly
% becomes prohibitively expensive for larger projects.
%
% *Info:* This post assumes that you are somewhat familiar with the
%         <https://www.mathworks.com/help/matlab/matlab_prog/overview-of-matlab-build-tool.html % MATLAB build tool> . If not, you can get an overview here. It
%         provides a uniform and standardized way to define and run
%         MATLAB builds.
%
%% What Is Incremental Testing?
% The MATLAB build tool supports
% <https://www.mathworks.com/help/matlab/matlab_prog/improve-performance-with-incremental-builds.html % incremental builds>, which skips unnecessary work by tracking each build
% task's inputs, outputs, actions and arguments to determine if the task is
% up-to-date. If nothing has changed since its last successful run, the
% task is skipped.
%
% Starting with R2025a, it enhances this capability with incremental
% testing, available with MATLAB Test. While incremental build determines
% whether a task should rerun, incremental testing goes further – it uses
% test impact analysis to decide which tests need to run. This can
% significantly optimize test execution and speed up your builds
%
% With incremental testing enabled, the build tool analyzes the source and
% test code changes and runs only tests impacted by those changes.
%
% Let's unpack how this works. We'll start with some basics.
%
%% Background
% We'll use the same goal as in Part 2 – enhancing the AND perceptron to
% introduce a trainable bias term. The exact goal isn't critical; it's just
% a useful backdrop.
%
%%% Defining the Build
% A |buildfile.m| at the project root defines your MATLAB build.
%
% <<buildfile_location.png>>
%
% This build file creates a plan that describes how to build the project –
% it defines a set of build tasks and their dependencies to establish a
% task graph to execute with a single
% <https://www.mathworks.com/help/matlab/ref/buildtool.html buildtool>
% command.
%
% <include>before/buildfile.m</include>
%
% In our example, the build file includes:
%   * A |test| task to run tests
%   * A |clean| task to delete task outputs and traces
%
% These tasks are created using the
% <https://www.mathworks.com/help/matlab/ref/matlab.buildtool.tasks-package.html % built-in task classes> . Built-in task classes streamline the creation of
% standard tasks like identifying code issues, building MEX binaries and
% testing. The built-in task classes are designed for reuse and generally
% support
% <https://www.mathworks.com/help/matlab/matlab_prog/improve-performance-with-incremental-builds.html % incremental build> out of the box.
%
% Out |test| tasks uses the
% <https://www.mathworks.com/help/matlab/ref/matlab.buildtool.tasks.testtask-class.html % matlab.buildtool.tasks.TestTask> class, which runs tests using the MATLAB
% Unit Testing Framework.
%
%%% Optimizing Performance with Incremental Build
% Before diving into incremental testing, let's briefly look at how
% incremental build works.
%
% When we first clone our repository, the build tool has no task traces.
%
% *Info:* A *task trace* is a MATLAB release-specific record of a task's inputs, outputs,
%         actions and arguments from its last successful run.
%
% So, when we run the |test| task, it runs because there are no traces yet,
% and runs *all* the tests defined by the task.
%
% <<run_with_no_task_trace.png>>
%
% ...
%
% <<test_run_summary_no_task_trace.png>>
%
% This is nice because it gives us confidence that the repository is in a
% known-good state before making any code changes.
%
% The build tool creates a |.buildtool| cache folder in the project root
% folder to store the task traces.
%
% <<task_trace_folder.png>>
%
% On subsequent builds, if nothing has changed, the task is skipped.
%
% <<skipped_task.png>>
%
% Now, let's say we modify a source file like |initializeWeights.m|, and
% re-run the build.
%
% <<sample_change_source_control.png>>
%
% Since this file is tracked via the |SourceFiles| property, one of the
% task inputs of the test task that the build tool tracks as part of
% <https://www.mathworks.com/help/matlab/ref/matlab.buildtool.tasks.testtask-class.html#mw_96cca6ff-6c81-4dd9-87d2-5c7df47b475b % up-to-date check>, the tool recognizes the changes and re-runs the task.
%
% <<rerun_after_sample_change.png>>
%
% Nice! But do we really need to run all the tests for that single source
% file change? Wouldn't it be better if just the impacted tests ran. That's
% exactly what incremental testing in R2025a delivers.
%
%% Enabling Incremental Testing
% So, how do we get the incremental testing behavior?
%
% Incremental testing is powered by test impact analysis. To enable it, you
% can simply run the |test| task with the |RunOnlyImpactedTests| task
% argument.
%
%   >> buildtool test(RunOnlyImpactedTests=1)
%
% Let's look at an example. Say we change |initializeWeights.m| and
% |calculateWeightedSum.m| as part of our perceptron enhancement, like we
% did in Part 2:
%
% *initializeWeights.m*
%
% <html><u>Before:</u></html>
%
% <include>before/toolbox/initializeWeights.m</include>
%
% <html><u>After:</u></html>
%
% <include>after/toolbox/initializeWeights.m</include>
%
% *calculateWeightedSum.m*
%
% <html><u>Before:</u></html>
%
% <include>before/toolbox/calculateWeightedSum.m</include>
%
% <html><u>After:</u></html>
%
% <include>after/toolbox/calculateWeightedSum.m</include>
%
% When you set |RunOnlyImpactedTests| to |true|, the |test| task analyzes
% those changes and runs only the impacted tests. Look at that!
%
% <<run_impacted_tests.png>>
%
% Behind the scenes, the build tool tracks changes to the source and test
% files of the |test| task created using the the built-in |TestTask| class
% (more on this later in the post).
%
% When |RunOnlyImpactedTests| is true, the |test| task doesn't just detect
% that the files changed – it determines which tests are impacted by those
% changes and runs only those.
%
% Increasing the build verbosity to level 3 (Detailed) or higher reveals
% which changes triggered the task execution. In our example, we see that
% the |SourceFiles| property has changed because |initializeWeights.m| and
% |calculateWeightedSum.m| were modified.
%
% As seen in Part 2, changes to just those two files do not meet the goal.
% The diagnostics will reflect this.
%
% <<run_impacted_tests_failures.png>>
%
% Let's fix the rest of the code base like we did in Part 2 to ensure we
% have all the necessary changes and rerun the build with incremental
% testing.
%
% _After some coding and a cup of coffee..._
%
% <<rerun_impacted_tests.png>>
%
% Success! The build passes and we ran just the related tests.
%
% <<run_impacted_tests_success.png>>
%
% Our toy example had just 5 tests, but real-world projects can have
% hundreds or thousands – so the potential for performance gain is
% substantial.
%
% To avoid the need to specify the task argument every time, we can
% configure the test task in your |buildfile.m| to always run only impacted
% tests by default.
%
% <<buildfile_roit.png>>
%
% Then at run time, we can specify just "test".
%
%   >> buildtool test
%
% You can toggle the |RunOnlyImpactedTests| option at run time or create
% separate test tasks with and without incremental testing to match your
% workflow preferences.
%
%% A Closer Look at Impact-Based Testing
%
% Impact-based testing involves two key concepts:
%
% * Change Detection refers exclusively to the concern of detecting changes
% to the task's tracked files
% * Impact Analysis refers exclusively to the concern of analyzing the
% impact of those changes.
%
% *Change Detection*
% When you enable test impact analysis, the |TestTask| detects changes to
% source files, supporting files and tests as defined by the task's
% |SourceFiles|, |SupportingFiles|, and |Tests| properties. It also tracks test
% class folders and test superclasses.
%
% But what is the change window? … It's changes _since the last successful
% run_.
%
% A picture might help… it always goes a long way for me.
%
% <<change_window.png>>
%
% For example, let's suppose you have a successful build, *b_1*. After you
% make a change *C1*, and run the build, the build tool checks for changes
% in source, supporting, and test files since *b_1*. If *C1* causes a
% regression and *b_2* fails, the next build, *b_3* still uses *b_1* as the
% reference point - because it's the last successful run. This ensures the
% integrity of your commits and code integration.
%
% Only files that are _added_ or _modified_ are considered  for impact
% analysis; _removed_ files are not. If you're using MATLAB projects,
% removing a file triggers dependency analysis to help you identify which
% files are affected so you action appropriately and clean up cruft and
% dead code.
%
% In summary, change detection:
%   * Detects files defined by the |SourceFiles|, |SupportingFiles| and
%   |Tests| properties of the |test| task.
%   * Detects files that are either _added_ or _modified_.
%   * Detects changes since the last successful task run.
%
% *Impact Analysis*
% Like the *Find Tests* (Part 1) feature in the Editor and *Impacted Tests
% Since Last Commit* option (Part 2) in the MATLAB test manager app, the
% TestTask also uses
% <https://www.mathworks.com/help/matlab/ref/dependencyanalyzer-app.html#mw_16e23e55-ae1c-4228-8f5f-97273d840a70 % dependency analysis> to find impacted tests. It uses it via the
% <https://www.mathworks.com/help/matlab-test/ref/matlabtest.selectors.dependson-class.html % DependsOn> test selector, which, in R2025a, enhanced the accuracy of test
% selection with the ability to select individual tests within a test file.
%
% > *Important Reminder:* Static analysis isn't perfect. It has
% <https://www.mathworks.com/help/matlab/ref/dependencyanalyzer-app.html#mw_16e23e55-ae1c-4228-8f5f-97273d840a70 % limitations> . Use incremental testing with vigilance and discipline –
% *trust but verify*. Always run the full test suite at key points in your
% release cycle to ensure complete coverage and confidence.
%
%% Interaction Between Incremental Build and Incremental Testing
%
% Earlier, I mentioned that if a task's inputs, outputs, actions and
% arguments haven't changed since the last successful run, the build tool
% skips the task. The |RunOnlyImpactedTests| option is itself considered 
% an input to the task, so incremental build applies to this property as well.
%
% <<skipped_task_roit.png>>
%
% When you rerun the test task with the same |RunOnlyImpactedTests| value
% and the task has no other changes either, the build tool skips the task.
% Why? 'cuz of Incremental Build!
%
% *Quiz Time!*
%
% Suppose you change the |TestResults| task output property:
%
% From:
%
%   plan("test") = TestTask("tests", SourceFiles="toolbox", TestResults="results/test-results.xml");
%
% To:
%
%   plan("test") = TestTask("tests", SourceFiles="toolbox", TestResults="results/test-results.html");
%
% *Question:* What tests will run if |RunOnlyImpactedTests| is set to
% |true|, assuming the above |buildfile.m| is the only change made in your
% project since the last successful run and no other changes?
%
% Let us know what you think in the comments!
%
% *Bonus Credit*
%
% In |buildfile.m|,
% <https://www.mathworks.com/help/matlab/ref/matlab.buildtool.task-class.html?searchHighlight=DisableIncremental&s_tid=srchtitle_support_results_2_DisableIncremental % disable incremental build>:
%
%   plan("test") = TestTask("tests", SourceFiles="toolbox", TestResults="results/test-results.xml");
%   plan("test").DisableIncremental = 1;
%
% Then run:
%
%   >> buildtool test(RunOnlyImpactedTests=1)
%
% *Question:* What tests do you expect to run? And why? Share your thoughts
% in the comments.
% 
% I will share the answers in the comments next week!
%
%% Summary
% There you have it! Incremental testing with the MATLAB Build Tool and
% MATLAB Test can greatly improve the efficiency of automated builds,
% locally and in CI, by running only the tests impacted by recent changes.
% It complements interactive development and helps reduce test times
% without sacrificing coverage.
%
% While static dependency analysis has limitations, incremental
% testing can deliver substantial value with some user awareness and
% discipline.
%
% This post focused on local builds, but the same benefits
% apply to CI environment as well – we'll dive into that in the next part!
%
% _Would you consider using incremental testing in your workflows?
% What challenges do you foresee? Are there gaps in change detection or
% impact analysis that MathWorks could address to help you trust
% incremental testing more? We'd love to hear your thoughts – share them in
% the comments section below!_

##### SOURCE END ##### 56f6e7b4223646428020c27162ba6f75
-->]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2025/08/20/tldr-too-long-didnt-run-part-3-incremental-testing-with-the-matlab-build-tool/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>TL;DR: Too Long; Didn&#8217;t Run: Part 2 &#8211; Ensuring Integrity of Your Commits Using MATLAB Test Manager</title>
		<link>https://blogs.mathworks.com/developer/2025/07/23/test-impact-analysis-test-manager/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2025/07/23/test-impact-analysis-test-manager/#comments</comments>
		
		<dc:creator><![CDATA[apuvvala]]></dc:creator>
		<pubDate>Wed, 23 Jul 2025 21:48:58 +0000</pubDate>
				<category><![CDATA[MATLAB Test]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[test impact analysis]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=3809</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/featured_image_tia_part2.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><!--introduction-->
<p>In <a href="https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/">Part 1</a>, we looked at how the <a href="https://www.mathworks.com/help/matlab-test/ug/find-tests-that-depend-on-files.html#mw_bb1343da-2b30-4bd8-9444-b7b37f93ba05">Find Tests</a> button in the MATLAB Toolstrip can streamline your workflow by surfacing the relevant tests for the MATLAB file you are currently editing. While that approach works great for making changes to a single file, as development progresses and you prepare to commit a batch of changes, your focus shifts from a single file towards ensuring the integrity of those whole commits. And, a quick feedback loop is key to enabling frequent and high-quality commits before pushing to your remote branch.... <a class="read-more" href="https://blogs.mathworks.com/developer/2025/07/23/test-impact-analysis-test-manager/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class="content"><!--introduction-->
<p>In <a href="https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/">Part 1</a>, we looked at how the <a href="https://www.mathworks.com/help/matlab-test/ug/find-tests-that-depend-on-files.html#mw_bb1343da-2b30-4bd8-9444-b7b37f93ba05">Find Tests</a> button in the MATLAB Toolstrip can streamline your workflow by surfacing the relevant tests for the MATLAB file you are currently editing. While that approach works great for making changes to a single file, as development progresses and you prepare to commit a batch of changes, your focus shifts from a single file towards ensuring the integrity of those whole commits. And, a quick feedback loop is key to enabling frequent and high-quality commits before pushing to your remote branch.</p>
<p>Starting in R2025a, the <a href="https://www.mathworks.com/help/matlab-test/ref/matlabtestmanager-app.html">MATLAB Test Manager</a> app helps you do just that. It lets you manage a test suite that automatically detects which tests are <a href="https://www.mathworks.com/help/matlab-test/ug/qualify-changes-by-finding-and-running-impacted-tests.html">impacted by changes</a> since your last source control commit. This means you can avoid running the full (potentially time-consuming) test suite, while still catching any regressions early.</p>
<p>Let's look at how that works in practice.</p>
<p>We'll take the same example from Part 1: A Simple AND Perceptron</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/example.png" alt=""> </p>
<p>But before we dive into the example, let me take a quick moment to highlight something that is also new in MATLAB R2025a - the <strong>Source Control panel</strong>.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/source_control_panel.png" alt=""> </p>
<p>This new panel, easily accessible off the sidebar, automatically detects source control folders you are actively working on. That means you can quickly get oriented without needing to dig through menus. As you make changes, it gives you a clear view of modified and untracked files, and let's you make source control actions right from the panel. You can also jump into the <b>Branch Manager</b> from there to manage your branches with ease. Wanna know more? Check out <a href="https://www.mathworks.com/help/matlab/matlab_prog/about-mathworks-source-control-integration.html">Source Control Integration in MATLAB documentation</a>.</p>
<p>
<b>Note:</b> Source Control integration in MATLAB supports both Git and SVN systems, but for the purposes of this post, I'll be using Git.</p>
<p>Alright, back to our example...</p>
<!--/introduction-->
<h3>Contents</h3>
<div>
<ul>
<li>
<a href="#adad3d86-93bd-4ee7-b057-3c4e97512f66">Goal: Enhancing the Perceptron to Use Bias as a Parameter</a>
</li>
<li>
<a href="#2b020be5-56cb-4425-b3c5-dce2e58f8b26">Solution: Trainable Bias Term</a>
</li>
<li>
<a href="#3ca19b33-d039-47b2-a491-dfd84fb0007a">Utilizing MATLAB Test Manager to find and run impacted tests</a>
</li>
<li>
<a href="#ff4163f4-0e09-4ebc-8ec8-3f8f719541f9">What's Next...</a>
</li>
</ul>
</div>
<h3>Goal: Enhancing the Perceptron to Use Bias as a Parameter<a name="adad3d86-93bd-4ee7-b057-3c4e97512f66"></a>
</h3>
<p>
<div style="border-left: 4px solid #007acc; background-color: #f0f8ff; padding: 12px 16px; margin: 16px 0; font-family: sans-serif;">
  <strong>Tip:</strong> You can access the supporting files for this post in the <a href="https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-MATLAB-Test-Manager">Developer Zone blog GitHub repository</a>. The <a href="https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-MATLAB-Test-Manager/before">"before"</a> folder contains the original code to reproduce the steps outlined in this blog, while the <a href="https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-MATLAB-Test-Manager/after">"after"</a> folder includes the final version of the code. 
</div>
</p>
<p>In the <a href="https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/" rel="noopener" target="_blank">previous post</a>, we explored how the perceptron model classifies data by calculating a weighted sum of inputs and applying a threshold function. This approach utilizes a fixed bias term to adjust the decision boundary.</p>
<p>In that implementation, the bias term is set to a constant value of 1, as shown below:</p>
<pre class="language-matlab">
<span class="keyword">function</span> output = calculateWeightedSum(weights, inputs)
<span class="comment">% Compute the weighted sum</span>
total_input = sum(weights .* [inputs, 1]);
<span class="comment">% Activation logic</span>
<span class="keyword">if</span> total_input &gt; 0 <span class="comment">% step function threshold; activate if weighted sum is positive</span>
    output = 1; 
<span class="keyword">else</span>
    output = 0;
<span class="keyword">end</span>
<span class="keyword">end</span>
</pre>
<p>This fixed bias term simplifies the model but limits its adaptability.</p>
<h3>Solution: Trainable Bias Term<a name="2b020be5-56cb-4425-b3c5-dce2e58f8b26"></a>
</h3>
<p>To improve the model's flexibility and potentially enhance its performance, we propose modifying the bias term to be trainable. This adjustment allows the bias to be learned alongside the weights during training, enabling the model to better fit the data. The updated code should represent the following equation:</p>
<p>$z = w * x + b$</p>
<p>where <tt>b</tt> is now a learnable bias parameter.</p>
<p>Let's explore how the MATLAB Test Manager can facilitate efficient implementation of this change through impact-based testing.</p>
<h3>Utilizing MATLAB Test Manager to find and run impacted tests<a name="3ca19b33-d039-47b2-a491-dfd84fb0007a"></a>
</h3>
<p>We'll begin by examining what tests the test manager identifies before we make any changes. When you select <b>All Tests in Current Project</b> , it finds, well, all the tests in your MATLAB Project.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/all_tests_in_current_project_before.png" alt=""> </p>
<p>In R2025a, the app introduced a new option named <b>Impacted Tests Since Last Commit</b>. 
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_menu_option.png" alt=""> </p>
Initially, with no changes made, selecting <b>Impacted Tests Since Last Commit</b> reveals no affected tests, confirming that our codebase is unchanged.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_before.png" alt=""> </p>
<p>The Source Control panel agrees!</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_source_control_panel_before.png" alt=""> </p>
<p>So, let's get to work and start making the changes. We begin by creating a new branch <tt>feature/bias</tt> using <b>Source Control &gt; Branch Manager</b>
</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_branch_creation.png" alt=""> </p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/git_repo_current_branch.png" alt=""> </p>
<p>Looks like we are in a good source control state here &ndash; right branch for the change.</p>
<p>To turn <i>bias</i> into a model parameter, we need to modify the functions that initialize the weights and calculate the weighted sum.</p>
<p>
<b>initializeWeights.m</b>
</p>
<p><u>Before:</u></p>
<pre class="language-matlab">
<span class="keyword">function</span> weights = initializeWeights()
<span class="comment">% Initialize weights randomly for two inputs and one bias</span>
weights = rand(1, 3) * 0.5;
<span class="keyword">end</span>
</pre>
<p><u>After:</u></p>
<pre class="language-matlab">
<span class="keyword">function</span> [weights, bias] = initializeWeights(numInputs)
<span class="comment">% Initialize weights and bias randomly</span>
weights = rand(1, numInputs); <span class="comment">% Random weights for each input</span>
bias = rand() - 0.5; <span class="comment">% Bias initialized to a small random value between -0.5 and 0.5</span>
<span class="keyword">end</span>
</pre>
<p>
<b>calculateWeightedSum.m</b>
</p>
<p><u>Before:</u></p>
<pre class="language-matlab">
<span class="keyword">function</span>output = calculateWeightedSum(weights, inputs)
<span class="comment">% Compute the weighted sum</span>
total_input = sum(weights .* [inputs, 1]);
<span class="comment">% Activation logic</span>
<span class="keyword">if </span>total_input &gt; 0 <span class="comment">% step function threshold; activate if weighted sum is positive</span>
    output = 1;
<span class="keyword">else</span>
    output = 0;
<span class="keyword">end</span>
<span class="keyword">end</span>
</pre>
<p><u>After:</u></p>
<pre class="language-matlab">
<span class="keyword">function</span>output = calculateWeightedSum(weights, bias, inputs)
<span class="comment">% Compute the weighted sum</span>
total_input = sum(weights .* inputs) + bias;
<span class="comment">% Activation logic</span>
<span class="keyword">if </span>total_input &gt; 0 <span class="comment">% step function threshold; activate if weighted sum is positive</span>
    output = 1;
<span class="keyword">else</span>
    output = 0;
<span class="keyword">end</span>
<span class="keyword">end</span>
</pre>
<p>OK, we made the desired changes. With those changes implemented, we'll now rely on MATLAB Test Manager to identify and run only the tests impacted by our modifications. This targeted testing approach helps maintain efficiency and ensures that we address any regressions introduced by the changes.</p>
<p>Let's select <b>Impacted Tests Since Last Commit</b> in the test manager to identify the relevant tests.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_first_changeset_after.png" alt=""> </p>
The Test Manager detected 4 impacted tests. Let's run them&hellip;
<p>

<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_first_changeset_failures_after.png" alt=""> </p>
<p>Uh-oh! All tests have failed.</p>
<p>Thankfully, failure diagnostics are provided alongside the results, offering helpful insights for troubleshooting.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/initializeWeights_failure.png" alt=""> </p>
<p>Ah, right! We modified the function signatures of <tt>initializeWeights.m</tt> and <tt>calculateWeightedSum.m</tt>. Let's address this.</p>
<p>The first two failures are straightforward &ndash; they simply require us to update the tests corresponding to those two modified functions.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_source_control_partial_fixes.png" alt=""> </p>
<p>We re-run the tests in the MATLAB Test Manager.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/two_pass_two_failures.png" alt=""> </p>
<p>Progress! The first two tests now pass. However, we still have two failures remaining.</p>
<p>Upon closer inspection, it seems the remaining issues are related to other source files, such as <tt>trainPerceptron.m</tt> and <tt>predict.m</tt>. These need to be updated to account for the new trainable bias parameter and ensure it is trained alongside the weights.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_source_control_all_fixes.png" alt=""> </p>
<p>OK, we have updated those functions and their corresponding tests as well to address the regression and ensure we have a cohesive set of changes. We'll click <b>Refresh tests</b> in the test manager to get an updated list of impacted tests.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_refresh.png" alt=""> </p>
<p>Good news - there are no additional impacted tests. The tests identified earlier are already covering the newly updated source files.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/impacted_tests_passing_after.png" alt=""> </p>
<p>Great! All tests are passing now, giving us confidence that the changes are compatible with the rest of the codebase.</p>
<p>Ideally, we would add new tests to specifically target the new functionality. Even better, we could start with those new tests to drive our implementation. Depending on the complexity of the application we might also consider performing ad-hoc testing to further bolster the rigor of our qualification and ensure full confidence in the changes.</p>
<p>The test manager supports you throughout this process by automatically identifying and running only the tests impacted by the changes in each development iteration. Much like the <b>Find Tests</b> feature we discussed in <a href="https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/">Part 1</a>, <b>Impacted Tests Since Last Commit</b> also leverages dependency analysis to find impacted tests.</p>
<p>An additional feature I find particularly useful in the test manager is its ability to track the history of test runs. This allows you to review previous test results, providing valuable insights as you iterate through your development process.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/mtm_test_run_history.png" alt=""> </p>
<p>Once we've validated our changes, we can commit them using the Source Control panel:</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/commit_changes.png" alt=""> </p>
<p>We now have a new commit</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/updated_repo_commit.png" alt=""> </p>
<p>After committing, the test manager indicates that no tests have been impacted since the last commit. That makes sense!</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/mtm_no_impacted_tests.png" alt=""> </p>
<p>If further development is needed for the feature, we continue to implement changes in manageable increments and commit frequently. This approach ensures the integrity of each commit while leveraging the test impact analysis capability for efficient qualification.</p>
<p>
<i>Would you consider adopting this capability in your workflow? Are there any aspects of test impact analysis or the workflow itself that we could improve to facilitate a more seamless development cycle for you? We welcome your thoughts in the comments below!</i>
</p>
</p>
<h3>What's Next...<a name="ff4163f4-0e09-4ebc-8ec8-3f8f719541f9"></a>
</h3>
<p>So far, we have conducted cycles of interactive testing using the <strong>Find Tests</strong> button and <strong>MATLAB Test Manager</strong> capabilities. Our next step will be to explore how the MATLAB build tool can help automate and further enhance your development workflow. We'll look at that in the next post. We'll specifically examine how it can leverage the same foundational test impact analysis capability to enable incremental testing and faster local automated builds as part of your pre-qualification process.</p>
<script language="JavaScript"> <!-- 
    function grabCode_f95637d87d1c48a58c97ad3a21a6bd06() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='f95637d87d1c48a58c97ad3a21a6bd06 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' f95637d87d1c48a58c97ad3a21a6bd06';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        copyright = 'Copyright 2025 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add copyright line at the bottom if specified.
        if (copyright.length > 0) {
            d.writeln('');
            d.writeln('%%');
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');

        d.title = title + ' (MATLAB code)';
        d.close();
    }   
     --> </script>
<p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray">
<br>
<a href="javascript:grabCode_f95637d87d1c48a58c97ad3a21a6bd06()"><span style="font-size: x-small;        font-style: italic;">Get 
      the MATLAB code <noscript>(requires JavaScript)</noscript>
</span></a>
<br>
<br>
      Published with MATLAB&reg; R2025a<br>
</p>
</div>
<!--
f95637d87d1c48a58c97ad3a21a6bd06 ##### SOURCE BEGIN #####
%%
% In
% <https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/
% Part 1>, we looked at how the
% <https://www.mathworks.com/help/matlab-test/ug/find-tests-that-depend-on-files.html#mw_bb1343da-2b30-4bd8-9444-b7b37f93ba05
% Find Tests> button in the MATLAB Toolstrip can streamline your workflow
% by surfacing the relevant tests for the MATLAB file you are currently
% editing. While that approach works great for making changes to a single
% file, as development progresses and you prepare to commit a
% batch of changes, your focus shifts from a single file towards ensuring
% the integrity of those whole commits. And, a quick feedback loop is key
% to enabling frequent and high-quality commits before pushing to your
% remote branch.
%
% Starting in R2025a, the
% <https://www.mathworks.com/help/matlab-test/ref/matlabtestmanager-app.html
% MATLAB Test Manager> app helps you do just that. It lets you manage a
% test suite that automatically detects which tests are
% <https://www.mathworks.com/help/matlab-test/ug/qualify-changes-by-finding-and-running-impacted-tests.html
% impacted by changes> since your last source control commit. This means
% you can avoid running the full (potentially time-consuming) test suite,
% while still catching any regressions early.
% 
% Let's look at how that works in practice.
%
% We'll take the same example from Part 1: A Simple AND Perceptron
%
% <<example.png>>
% 
% But before we dive into example, let me take a quick moment to highlight something
% that is also new in MATLAB R2025a - the *Source Control panel*.
% 
% <<source_control_panel.png>>
% 
% This new panel, easily accessible off the sidebar, automatically detects
% source control folders you are actively working on. That means you can
% quickly get oriented without needing to dig through menus. As you make
% changes, it gives you a clear view of modified and untracked files, and
% let's you make source control actions right from the panel. You can also
% jump into the *Branch Manager* from there to manage your branches with ease. 
% Wanna know more? Check out
% <https://www.mathworks.com/help/matlab/matlab_prog/about-mathworks-source-control-integration.html
% Source Control Integration in MATLAB documentation>.
%
% *Note:* Source Control integration in MATLAB supports both Git and SVN
% systems, but for the purposes of this post, I'll be using Git.
%
% Alright, back to our example...
%
%% Example Task: Enhancing the Perceptron to Use a Trainable Bias Term
% 
% *Tip:* 
% You can access the supporting files for this post in the
% developer-zone-blog GitHub repository. The |before| folder contains the
% original code to reproduce the steps outlined in this blog, while the
% |after| folder includes the final version of the code.
%
% In the <https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/
% previous post>, we explored how the perceptron model classifies
% data by calculating a weighted sum of inputs and applying a threshold
% function. This approach utilizes a fixed bias term to adjust the decision
% boundary.
%
% In that implementation, the bias term is set to a constant value of 1, as
% shown below:
%
% <include>before/toolbox/calculateWeightedSum.m</include>
%
% This fixed bias term simplifies the model but limits its adaptability.
% 
%% Proposed Enhancement: Trainable Bias Term
% To improve the model's flexibility and potentially enhance its
% performance, we propose modifying the bias term to be trainable. This
% adjustment allows the bias to be learned alongside the weights during
% training, enabling the model to better fit the data. The updated code
% should represent the following equation:
%
% $z = w * x + b$ 
% 
% where |b| is now a learnable bias parameter.
% 
% Let's explore how the MATLAB Test Manager can facilitate efficient
% implementation of this change through impact-based testing.
%
%% Utilizing MATLAB Test Manager to find and run impacted tests 
% 
% We'll begin by examining what tests the test manager identifies before
% we make any changes. When you select *All Tests in Current Project* , it
% finds, well, all the tests in your MATLAB Project.
%
% <<all_tests_in_current_project_before.png>>
%
% In R2025a, the app introduced a new option named *Impacted Tests Since
% Last Commit*. 
%
% <<impacted_tests_menu_option.png>>
%
% Initially, with no changes made, selecting *Impacted Tests
% Since Last Commit* reveals no affected tests, confirming that our
% codebase is unchanged.
%
% <<impacted_tests_before.png>>
%
% The Source Control panel agrees!
%
% <<impacted_tests_source_control_panel_before.png>>
%
% So, let's get to work and start making the changes. We begin by creating
% a new branch |feature/bias| using *Source Control > Branch Manager*
%
% <<impacted_tests_branch_creation.png>>
%
% <<git_repo_current_branch.png>>
%
% Looks like we are in a good source control state here – right branch for
% the change.
%
% To turn _bias_ into a model parameter, we need to modify the functions that
% initialize the weights and calculate the weighted sum.
%
% 
% *initializeWeights.m*
% 
% <html><u>Before:</u></html>
% 
% <include>before/toolbox/initializeWeights.m</include>
% 
% <html><u>After:</u></html>
% 
% <include>after/toolbox/initializeWeights.m</include>
% 
% *calculateWeightedSum.m* 
% 
% <html><u>Before:</u></html>
%
% <include>before/toolbox/calculateWeightedSum.m</include>
% 
% <html><u>After:</u></html>
% 
% <include>after/toolbox/calculateWeightedSum.m</include>
%
% OK, we made the desired changes. With those changes implemented, we'll
% now rely on MATLAB Test Manager to identify and run only the tests
% impacted by our modifications. This targeted testing approach helps
% maintain efficiency and ensures that we address any regressions
% introduced by the changes.
%
% Let's select *Impacted Tests Since Last Commit* 
% in the test manager to identify the relevant tests.
%
% <<impacted_tests_first_changeset_after.png>>
%
% The Test Manager detected 4 impacted tests. Let's run them…
%
% <<impacted_tests_first_changeset_failures_after.png>>
%
% Uh-oh! All tests have failed. 
% 
% Thankfully, failure diagnostics are provided alongside the results,
% offering helpful insights for troubleshooting.
%
% <<initializeWeights_failure.png>>
%
% Ah, right! We modified the function signatures of |initializeWeights.m| and
% |calculateWeightedSum.m|. Let's address this. 
% 
% The first two failures are straightforward – they simply require us to
% update the tests corresponding to those two modified functions.
%
% <<impacted_tests_source_control_partial_fixes.png>>
%
% We re-run the tests in the MATLAB Test Manager.
%
% <<two_pass_two_failures.png>>
%
% Progress! The first two tests now pass. However, we still have two
% failures remaining. 
% 
% Upon closer inspection, it seems the remaining issues are related to
% other source files, such as |trainPerceptron.m| and |predict.m|. These
% need to be updated to account for the new trainable bias parameter and
% ensure it is trained alongside the weights.
%
% <<impacted_tests_source_control_all_fixes.png>>
%
% OK, we have updated those functions and their corresponding tests as well
% to address the regression and ensure we have a cohesive set of changes. 
% We'll click *Refresh tests* in the test manager to get an updated list of
% impacted tests. 
% 
% <<impacted_tests_refresh.png>>
%
% Good news - there are no additional impacted tests. The tests identified
% earlier are already covering the newly updated source files. 
%
% <<impacted_tests_passing_after.png>>
%
% Great! All tests are passing now, giving us confidence that the changes
% are compatible with the rest of the codebase.
%
% Ideally, we would add new tests to specifically target the new
% functionality. Even better, we could start with those new tests to drive
% our implementation. Depending on the complexity of the application we
% might also consider performing ad-hoc testing to further bolster the
% rigor of our qualification and ensure full confidence in the changes. 
% 
% The test manager supports you throughout this process by automatically
% identifying and running only the tests impacted by the changes in each
% development iteration. Much like the *Find Tests* feature we discussed in
% <https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/
% Part 1>, *Impacted Tests Since Last Commit* also leverages dependency
% analysis to find impacted tests.
%
% An additional feature I find particularly useful in the test manager is
% its ability to track the history of test runs. This allows you to review
% previous test results, providing valuable insights as you iterate through
% your development process.
%
% <<mtm_test_run_history.png>>
%
% Once we've validated our changes, we can commit them using the Source Control panel:
%
% <<commit_changes.png>>
%
% We now have a new commit
%
% <<updated_repo_commit.png>>
%
% After committing, the test manager indicates that no tests have been
% impacted since the last commit. That makes sense!
%
% <<mtm_no_impacted_tests.png>>
%
% If further development is needed for the feature, we continue to
% implement changes in manageable increments and commit  frequently. This
% approach ensures the integrity of each commit while leveraging the test
% impact analysis capability for efficient qualification.
%
% _Would you consider adopting this capability in your workflow? Are there
% any aspects of test impact analysis or the workflow itself that we could
% improve to facilitate a more seamless development cycle for you? We
% welcome your thoughts in the comments below!_
%
%% What's Next...
% 
% So far, we have conducted cycles of interactive testing using the *Find
% Tests* button and *MATLAB Test Manager* capabilities. Our  next step will
% be  to explore how the MATLAB  build tool can help automate and further
% enhance your development workflow. We'll look at that in the next post. 
% We'll specifically examine how it can leverage the same foundational 
% test impact analysis capability to enable incremental testing and faster 
% local automated builds as part of your pre-qualification process.
##### SOURCE END ##### f95637d87d1c48a58c97ad3a21a6bd06
-->
]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2025/07/23/test-impact-analysis-test-manager/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>TL;DR: Too Long; Didn&#8217;t Run: Part 1 &#8211; Finding the Right Tests from your Editor</title>
		<link>https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/#respond</comments>
		
		<dc:creator><![CDATA[apuvvala]]></dc:creator>
		<pubDate>Wed, 09 Jul 2025 18:47:45 +0000</pubDate>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[MATLAB Test]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[test impact analysis]]></category>
		<category><![CDATA[Testing]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=3384</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/find-tests-button.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><!--introduction-->
<p>Welcome back! As promised, I am here to kick things off with Part 1 of our <a href="https://blogs.mathworks.com/developer/2025/07/02/test-impact-analysis-intro">blog series</a> on impact-based test selection. Lezz go!... <a class="read-more" href="https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class="content"><!--introduction-->
<p>Welcome back! As promised, I am here to kick things off with Part 1 of our <a href="https://blogs.mathworks.com/developer/2025/07/02/test-impact-analysis-intro">blog series</a> on impact-based test selection. Lezz go!</p>
<p>Imagine you are developing an application and writing code in your MATLAB development environment.</p>
<p>Code changes, even small ones, can introduce unintended consequences in complex software systems. Running an entire test suite to validate every change slows down feedback loops and reduces development efficiency. For new contributors, unfamiliarity with the codebase further amplifies this challenge, making it harder to identify which tests are relevant.</p>
<p>When you make code changes, your focus is usually on a specific file. You want to iterate swiftly and confidently without losing context. To streamline this just-in-time validation process, <b><a href="https://www.mathworks.com/products/matlab-test.html">MATLAB Test</a> R2025a</b> integrates dependency-based test impact analysis directly into the MATLAB Editor. This makes it easier to find and run only the tests related to the file you are actively working on.</p>
<p>At the heart of this is the new <strong><a href="https://www.mathworks.com/help/matlab-test/ug/find-tests-that-depend-on-files.html">Find Tests</a></strong> button on the MATLAB Toolstrip that shows up if you have the MATLAB Test toolbox. MATLAB easily analyzes dependencies for the open file and identifies relevant tests. These are automatically populated in the <a href="https://www.mathworks.com/help/matlab/ref/testbrowser-app.html">Test Browser</a>, so you can run just those necessary tests without ever leaving the Editor or searching manually through your project.</p>
<p><img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/FindTests.png" width="640" height="240" alt=""> </p>
<p>Test impact analysis uses MATLAB dependency analysis. Tim Johns wrote a nice post on <a href="https://blogs.mathworks.com/developer/2023/10/26/dependency-based-test-selection/">Dependency-based Test Selection</a> that you may be interested in checking out as well. It also touches on the nuances and limitations of static analysis that one ought to keep in mind. 
<!--/introduction-->
<h3>Contents</h3>
<div>
<ul>
<li>
<a href="#abffce27-fc77-4511-aa69-baf502359a7e">Example: Testing a Simple Perceptron</a>
</li>
<li>
<a href="#8c8bf6b8-ac6d-43a7-8a75-37916a8b3040">Stay Focused. Stay In Context.</a>
</li>
<li>
<a href="#a0fe6420-827d-4038-8b49-1457f765321b">Key Considerations</a>
</li>
<li>
<a href="#8605320e-0174-4dd2-9478-bdeee4645a5a">In Summary...</a>
</li>
</ul>
</div>
<h2>Example: Testing a Simple Perceptron<a name="abffce27-fc77-4511-aa69-baf502359a7e"></a>
</h2>
<p>
<div style="border-left: 4px solid #007acc; background-color: #f0f8ff; padding: 12px 16px; margin: 16px 0; font-family: sans-serif;">
  If you have MATLAB Test R2025a, and want to follow along or reproduce the content of this post later, you can access all the code now at our new <a href="https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-Find-Tests">Developer Zone Blog GitHub repo</a>.
</div>
</p>
<p>
While impact-based testing shines brightest in large projects, let's take a simple example to see how it works in practice. Our example here is a simple neural network, <a href="https://www.codecademy.com/learn/perceptrons-and-neural-nets-skill-path/modules/perceptrons-skill-path/cheatsheet">perceptron</a> , that creates a binary linear classification model that simulates the task of decision making. You don't need to fully understand the details of how it works; in fact, it's better if you don't. Like the scenario of a new contributor unfamiliar with the codebase, this lets you see how the <strong>Find Tests</strong> feature helps you identify which tests are relevant, without having to reverse-engineer everything first.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/project_setup.png" alt=""> </p>
<p>The project has some source code and tests. The main goal of a perceptron is to make accurate classifications. This is achieved through optimizing the weights of the perceptron so the model can be better trained. We start off by calculating the weighted sum and that is used to train the model and use the trained model for prediction.</p>
<h3>Let's make a change</h3> 
<p>
Say, you are interested in determining how changes to the initialization of weights affect the classifier's performance. So, you open the <tt>initializeWeights.m</tt> file in the MATLAB Editor.</p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/initializeWeights_before-1.png" width="780" height="360" alt=""> </p>
<p>You change the scaling factor from 0.1 to 0.5 and want to validate the change. Luckily the project has tests. In this case, there's only a handful of them, but you are not sure if all of them are relevant to this file and change, and how long it would take to run them all. You want your iterations to be quick. The new <strong>Find Tests</strong> button to the rescue!</p>
<p>
<img decoding="async" loading="lazy" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/initializeWeights_after-1.png" width="780" height="360" alt=""> </p>
<p>When you click the <strong>Find Tests</strong> button, it prompts you to choose the folder where tests are located. It runs MATLAB dependency analysis and populates the <a href="https://www.mathworks.com/help/matlab/ref/testbrowser-app.html">Test Browser</a> app with just those related tests.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/testbrowser_related_tests.png" alt=""> </p>
<p>Now you can interact with the Test Browser as you normally would. Click the <strong>Run Tests</strong> button to run the test suite and see how your changes impact the perceptron performance.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/testbrowser_related_tests_run.png" alt=""> </p>
<p>Hmm, changing the scaling factor to 0.5 didn't seem to have much impact. Perhaps that is because this is a simple AND perceptron. But that tighter, faster feedback loop gives you confidence to keep experimenting or moving forward with the change.</p>
<h2>Stay Focused. Stay In Context.<a name="8c8bf6b8-ac6d-43a7-8a75-37916a8b3040"></a>
</h2>
<p>When you're editing a file, that file is your primary focus. Everything else can be noise. <strong>Find Tests</strong> optimizes for that mental context by populating just the relevant tests in a clean Test Browser, reducing distraction and cognitive load.</p>
<p>You can also then enable coverage collection in the Test Browser to see which parts of your modified or new code are exercised by existing tests. This helps you identify and close coverage gaps before pushing your changes. (The <strong>Generate Tests</strong> button right next to <strong>Find Tests</strong> can also help here.)</p>
<h2>Key Considerations<a name="a0fe6420-827d-4038-8b49-1457f765321b"></a>
</h2>
<p>Test impact analysis is only as effective as our test coverage. If there are no tests or not enough tests in the project, there's little to analyze and benefit from. The richer the test suite, the better the outcome from test impact analysis. The better the test impact analysis, the better the confidence in making code changes.</p>
<p>
<strong>Find Tests</strong> determines dependencies (a.k.a. impact) with static analysis, and like any static analysis technique, it has <a href="https://www.mathworks.com/help/matlab/ref/dependencyanalyzer-app.html#mw_16e23e55-ae1c-4228-8f5f-97273d840a70">limitations</a>. It's not perfect or exhaustive. Think of it as a performance optimization that benefits from user vigilance &minus; <strong>trust but verify</strong>. It is still recommended to run your full test suite at key stages in your development and release cycle.</p>
<p>
<div class="info-box">
    <span class="info-icon"><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span>
    <span>
      <strong>Tip:</strong> If you know of a test that needs to run due to an untracked dependency you can still manually add it via the Test Browser after you "find the tests".
    </span>
  </div>
</p>
<h2>In Summary...<a name="8605320e-0174-4dd2-9478-bdeee4645a5a"></a>
</h2>
<p>You can find impacted tests manually, but by surfacing the relevant tests just at the right time, MATLAB Test's <strong>Find Tests</strong> reduces the cognitive load, time and effort required to validate changes&mdash;especially in large projects with extensive test suites&mdash;and provides immediate guidance for new contributors or when working in unfamiliar areas of the codebase. Ultimately, it helps maintain high confidence in code changes while accelerating development workflows.</p>
<p><em>How do you see this feature helping your day-to-day development workflows? What other tools or capabilities would you like to see integrated more tightly with <strong>Find Tests</strong> and the Editor to further assist you in completing your workflows without having to switch too many contexts? What else do you see valuable for a more rigorous test impact analysis?</em></p>
<p>Let us know in the comments!</p>
<script language="JavaScript"> <!-- 
    function grabCode_b75ca75c937144bb8eb6af0eb5a5cc78() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='b75ca75c937144bb8eb6af0eb5a5cc78 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' b75ca75c937144bb8eb6af0eb5a5cc78';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        copyright = 'Copyright 2025 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add copyright line at the bottom if specified.
        if (copyright.length > 0) {
            d.writeln('');
            d.writeln('%%');
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');

        d.title = title + ' (MATLAB code)';
        d.close();
    }   
     --> </script>
<p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray">
<br>
<a href="javascript:grabCode_b75ca75c937144bb8eb6af0eb5a5cc78()"><span style="font-size: x-small;        font-style: italic;">Get 
      the MATLAB code <noscript>(requires JavaScript)</noscript>
</span></a>
<br>
<br>
      Published with MATLAB&reg; R2025a<br>
</p>
</div>
<!--
b75ca75c937144bb8eb6af0eb5a5cc78 ##### SOURCE BEGIN #####
%% 
% Welcome back! As promised, I am here to kick things off with Part 1 of our
% <https://blogs.mathworks.com/developer/2025/07/02/test-impact-analysis-intro/
% blog series> on impact-based test selection.
%
% Imagine you are developing an application and writing code in your MATLAB
% development environment.
% 
% Code changes, even small ones, can introduce unintended consequences in
% complex software systems. Running an entire test suite to validate every
% change slows down feedback loops and reduces development efficiency. For
% new contributors, unfamiliarity with the codebase further amplifies this
% challenge, making it harder to identify which tests are relevant.
% 
% When you make code changes, your focus is usually on a specific file. You
% want to iterate swiftly and confidently without losing context. To
% streamline this just-in-time validation process, <https://www.mathworks.com/products/matlab-test.html MATLAB Test> *R2025a*
% integrates dependency-based test impact analysis directly in the MATLAB
% Editor. This makes it easier to find and run only the tests related to
% the file you are actively working on.
% 
% At the heart of this is the new *Find Tests* button on the MATLAB
% Toolstrip that shows up if you have the MATLAB Test toolbox. MATLAB
% easily analyzes dependencies for the open file and identifies relevant
% tests. These are automatically populated in the
% <https://www.mathworks.com/help/matlab/ref/testbrowser-app.html Test
% Browser>, so you can run just those necessary tests without ever leaving
% the Editor or searching manually through your project.
% 
% Test impact analysis uses MATLAB dependency analysis. Tim Johns wrote 
% a nice post on <https://blogs.mathworks.com/developer/2023/10/26/dependency-based-test-selection/
% Dependency-based Test Selection> that you may be interested in checking out as well. 
% It also touches on the nuances and limitations of static analysis that 
% one ought to keep in mind. 
% 
%% Example: Testing a Simple Perceptron
% 
% If you have MATLAB Test R2025a, and want to follow along or reproduce the content of this post later,
% you can access all the code now at our new <https://github.com/mathworks/developer-zone-blog/tree/2025-Test-Impact-Analysis-Find-Tests Developer Zone Blog GitHub repo>.
% 
% While impact-based testing shines brightest in large projects, let's take
% a simple example to see how it works in practice. Our example here is a simple neural network,
% <https://www.codecademy.com/learn/perceptrons-and-neural-nets-skill-path/modules/perceptrons-skill-path/cheatsheet
% perceptron> , that creates a binary linear classification model that
% simulates the task of decision making. You don't need to fully understand
% the details of how it works; in fact, it's better if you don't. Like the
% scenario of a new contributor unfamiliar with the codebase, this lets you
% see how the *Find Tests* feature helps you identify which tests are
% relevant, without having to reverse-engineer everything first.
% 
% <<project_setup.png>>
% 
% The project has some source code and tests. The main goal of a perceptron
% is to make accurate classifications. This is achieved through optimizing
% the weights of the perceptron so the model can be better trained. We
% start off by calculating the weighted sum and that is used to train the
% model and use the trained model for prediction.
% 
% *Let's make a change*
%
% Say, you are interested in determining how changes to the initialization
% of weights affect the classifier's performance. So, you open the
% |initializeWeights.m| file in the MATLAB Editor.
% 
% <<initializeWeights_before.png>>
% 
% You change the scaling factor from 0.1 to 0.5 and want to validate the
% change. Luckily the project has tests. In this case, there's only a
% handful of them, but you are not sure if all of them are relevant to this
% file and change, and how long it would take to run them all. You want
% your iterations to be quick. The new *Find Tests* button to the rescue!
% 
% <<initializeWeights_after.png>>
% 
% When you click the *Find Tests* button, it prompts you to choose the
% folder where tests are located. It runs MATLAB dependency analysis and
% populates the
% <https://www.mathworks.com/help/matlab/ref/testbrowser-app.html Test
% Browser> app with just those related tests.
% 
% <<testbrowser_related_tests.png>>
% 
% Now you can interact with the *Test Browser* as you normally would. Click
% the *Run Tests* button to run the test suite and see how your changes
% impact the perceptron performance. 
%
% Hmm, changing the scaling factor to
% 0.5 didn't seem to have much impact. Perhaps that is because this is a
% simple AND perceptron. But that tighter, faster feedback loop gives you
% confidence to keep experimenting or moving forward with the change.
% 
% <<testbrowser_related_tests_run.png>>
% 
%% Stay Focused. Stay In Context. 
% When you're editing a file, that file is your primary focus. Everything
% else can be noisy. *Find Tests* optimizes for that mental context by
% populating just the relevant tests in a clean Test Browser, reducing
% distraction and cognitive load.
% 
% You can also then enable coverage collection in the Test Browser to see
% which parts of your modified or new code are exercised by existing tests.
% This helps you identify and close coverage gaps before pushing your
% changes. (The *Generate Tests* button right next to *Find Tests* can also
% help here.)
% 
%% Key Considerations 
% Test impact analysis is only as effective as our test coverage. If there
% are no tests or not enough tests in the project, there's little to
% analyze and benefit from. The richer the test suite, the better the
% outcome from test impact analysis. The better the test impact analysis,
% the better the confidence in making code changes.
% 
% *Find Tests* determines dependencies (a.k.a. impact) with static analysis,
% and like any static analysis technique, it has <https://www.mathworks.com/help/matlab/ref/dependencyanalyzer-app.html#mw_16e23e55-ae1c-4228-8f5f-97273d840a70 limitations>. 
% It's not perfect or exhaustive. Think of it as a performance optimization that
% benefits from user vigilance − trust but verify. It is still recommended
% to run your full test suite at key stages in your development and release
% cycle. Check out the Dependency-based Test Selection blog post for more
% insights. 
%
%       *Tip*: If you know of a test that needs to run due to an untracked
%       dependency you can still manually add it via the Test Browser
%       after you "find the tests".
% 
%% In Summary...
% You can find impacted tests manually, but by surfacing the relevant tests
% just at the right time, MATLAB Test's *Find Tests* reduces the cognitive
% load, time and effort required to validate changes—especially in large
% projects with extensive test suites—and provides immediate guidance for
% new contributors or when working in unfamiliar areas of the codebase.
% Ultimately, it helps maintain high confidence in code changes while
% accelerating development workflows.
% 
% _How do you see this feature helping your day-to-day development
% workflows? What other tools or capabilities would you like to see
% integrated more tightly with *Find Tests* and the Editor to further
% assist you in completing your workflows without having to switch too many
% contexts? What else do you see valuable for a more rigorous test impact
% analysis?_ 
% 
% Let us know in the comments!
##### SOURCE END ##### b75ca75c937144bb8eb6af0eb5a5cc78
-->
]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2025/07/09/test-impact-analysis-find-tests/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>TL;DR: Too Long; Didn&#8217;t Run</title>
		<link>https://blogs.mathworks.com/developer/2025/07/02/test-impact-analysis-intro/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2025/07/02/test-impact-analysis-intro/#comments</comments>
		
		<dc:creator><![CDATA[apuvvala]]></dc:creator>
		<pubDate>Wed, 02 Jul 2025 20:27:39 +0000</pubDate>
				<category><![CDATA[Build Tooling]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[MATLAB Test]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[test impact analysis]]></category>
		<category><![CDATA[Testing]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=3342</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/tia.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>
In the fast-paced world of software development, speed and quality often feel like they're pulling us in opposite directions. On the one hand, we’re racing to deliver new features and fixes. On the... <a class="read-more" href="https://blogs.mathworks.com/developer/2025/07/02/test-impact-analysis-intro/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<p>
In the fast-paced world of software development, <em>speed</em> and <em>quality</em> often feel like they're pulling us in opposite directions. On the one hand, we’re racing to deliver new features and fixes. On the other, every change we make adds a little more complexity to the codebase — and with complexity comes risk. Bugs slip in. Dependencies tangle up. Suddenly, what once felt agile starts to feel... fragile. Finding the right balance between moving fast and maintaining reliable, high-quality software isn’t easy. It’s a real, everyday challenge for teams everywhere.
</p>

<h2>One of the biggest hurdles?... <em>Testing.</em></h2>
<p>
  <a href="https://blogs.mathworks.com/developer/files/testing_bottleneck-1.png">
    <img decoding="async" src="https://blogs.mathworks.com/developer/files/testing_bottleneck-1-300x300.png" alt="Testing Bottleneck" width="240" align="right" />
  </a>
As applications grow, so does the burden of making sure they still work after every small change. Running <em>all</em> the tests every time you tweak a piece of code can be painfully inefficient. It drags down developer productivity, introduces bottlenecks in CI pipelines, and turns quick feedback loops into long, frustrating waits. 
</p>
<p>Imagine fixing a minor issue in a single function — only to sit there while an entire suite of unrelated tests run. Not only is it a waste of time, but most of those tests may have nothing to do with the change you just made. It’s easy to see how this adds up over time, leading to diminishing returns and growing developer frustration.
</p>

<p>
Waste from running unrelated tests is not limited to development iterations. It slows down CI throughput. While it is a good practice to run all the tests at a meaningful cadence to ensure the entire application is always in a deployable state, running them all for every incremental job can be an overkill and hinders CI efficiency. It is counterproductive and makes an organization arguably less agile.
</p>

<h2>We can be smarter. Let's see how!</h2>
<p>
  <a href="https://blogs.mathworks.com/developer/files/happy_developer_incremental_testing-1.png">
    <img decoding="async" src="https://blogs.mathworks.com/developer/files/happy_developer_incremental_testing-1-300x300.png" alt="Happy Developer Incremental Testing" width="240" align="right" />
  </a>
<strong>R2025a</strong> release of <strong>MATLAB Test</strong> introduced a set of new features designed to ease some of these pain points — both during everyday development and when running automated builds locally or in CI. 
</p>

<p>We'll dive into these capabilities in this blog series. I am planning a 4-part series at the moment, but we'll add more if we get carried away!
</p>

Here's what's coming:
<p>
<ul>
 	<li><strong>Part 1:</strong> We’ll start with local development workflow, looking at a feature that helps you make changes to your source code with more confidence.</li>
 	<li><strong>Part 2:</strong> We’ll talk about how to ensure commit integrity using MATLAB Test Manager.</li>
 	<li><strong>Part 3:</strong> We'll explore how the MATLAB Build Tool can help you leverage incremental testing for faster local builds as part of your pre-qualification workflow.</li>
 	<li><strong>Part 4:</strong> Finally, we’ll walk through a CI workflow, how you can take advantage of incremental testing and boost your CI throughput.</li>
</ul>
</p>

<p>
<em>What’s your testing experience been like? Have you ever felt stuck waiting on test runs that didn’t need to happen? Or maybe you’ve found creative ways to speed up your workflows? We’d love to hear your stories — drop them in the comments below.</em>
</p>

<p>
We’ll kick things off with Part 1 next week. Stay tuned!
</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2025/07/02/test-impact-analysis-intro/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>CI, for example</title>
		<link>https://blogs.mathworks.com/developer/2025/06/19/ci-for-example/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2025/06/19/ci-for-example/#respond</comments>
		
		<dc:creator><![CDATA[Andy Campbell]]></dc:creator>
		<pubDate>Thu, 19 Jun 2025 18:52:05 +0000</pubDate>
				<category><![CDATA[Build Tooling]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[MATLAB Test]]></category>
		<category><![CDATA[MEX]]></category>
		<category><![CDATA[Toolbox Development]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=3303</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/2025-advanced-config.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><!--introduction-->
<p>Hello everyone, it has been a long time! I am excited to resurrect the conversation a bit here because we have a number of topics that are in the pipeline. Actually, there have always been plenty of topics in the ol' blog pipeline, but the good news now is that we actually have been able to sit down and write some of them.... <a class="read-more" href="https://blogs.mathworks.com/developer/2025/06/19/ci-for-example/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[
<div class="content"><!--introduction-->
<p>Hello everyone, it has been a long time! I am excited to resurrect the conversation a bit here because we have a number of topics that are in the pipeline. Actually, there have always been plenty of topics in the ol' blog pipeline, but the good news now is that we actually have been able to sit down and write some of them.</p>
<p>Over the next little while Ajay Puvvala will be publishing a series of posts related to some exciting features we have in MATLAB around test selection. Super exciting stuff so be sure to keep an eye out for these.</p>
<p>While you wait, I also wanted to quickly plug a couple of GitHub repositories that we've published to help with your CI workflows.</p>
<!--/introduction-->
<h3>Contents</h3>
<div>
<ul>
<li>
<a href="#19155a1d-a79b-4ace-99ee-8873b9c1b5ad">The simplest config that works</a>
</li>
<li>
<a href="#36f92e4e-f9a1-4824-8f89-1e8bdd8b119c">(Slightly) more advanced configurations</a>
</li>
<li>
<a href="#4bfda38c-9869-4c61-ba8e-f70adbcecb64">Multi-platform Toolbox Creation</a>
</li>
<li>
<a href="#552350a2-6694-4821-89fe-69827e2f70a3">Multi-release deployment to integrate with Python&reg;</a>
</li>
</ul>
</div>
<h4>The simplest config that works<a name="19155a1d-a79b-4ace-99ee-8873b9c1b5ad"></a>
</h4>
<p>First, if you want to just get up and going on your CI platform with the simplest of configs, take a look at the <a href="https://github.com/mathworks/ci-configuration-examples">CI Configuration Examples</a> repository. This shows a basic "Hello World!" example for GitHub&reg; Actions, GitLab&reg; CI/CD, Jenkins&trade;, Azure&reg; DevOps, and CircleCI&reg;. You can go there right now, fork it, and immediately use cloud hosted runners on GitHub, Azure DevOps, or CircleCI to see the CI process in action. Note, GitHub makes it particularly easy because Actions are just built into GitHub itself.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-ci-config-examples.png" alt=""> </p>
<h4>(Slightly) more advanced configurations<a name="36f92e4e-f9a1-4824-8f89-1e8bdd8b119c"></a>
</h4>
<p>Additionally, for those looking for more advanced configurations, check out the <a href="https://github.com/mathworks/advanced-ci-configuration-examples">Advanced CI Configuration Examples</a> repository. This includes more complex setups and best practices for integrating MATLAB with these CI/CD tools. In this repository you will currently find two workflows that are demonstrated on 4 CI platforms: GitHub Actions, Azure DevOps, Jenkins, and CircleCI.</p>
<p>
<img decoding="async" vspace="5" hspace="5" src="https://blogs.mathworks.com/developer/files/2025-advanced-config.png" alt=""> </p>
<h4>Multi-platform Toolbox Creation<a name="4bfda38c-9869-4c61-ba8e-f70adbcecb64"></a>
</h4>
<p>The first example goes through the build of a MATLAB toolbox across 3 platforms to produce and release a single <b><tt>.mltbx</tt></b> file. This workflow currently shows:</p>
<div>
<ul>
<li>How to use a matrix build across platforms (Linux, Windows, and Mac)</li>
<li>Building platform specific mex files</li>
<li>Uploading these artifacts on each</li>
<li>Retrieving the built mex files for each platform and packaging the toolbox</li>
<li>Publishing the toolbox to a GitHub release for distribution</li>
</ul>
</div>
<h4>Multi-release deployment to integrate with Python&reg;<a name="552350a2-6694-4821-89fe-69827e2f70a3"></a>
</h4>
<p>The second example shows how you can leverage the MATLAB Compiler SDK&trade; to create a python package from this algorithm. It does this across releases and operating systems. Some highlights of this workflow:</p>
<div>
<ul>
<li>A double matrix build (across MATLAB releases and operating systems)</li>
<li>Creation and deployment of a python package from the MATLAB code using Compiler SDK</li>
<li>Equivalence testing of the deployed algorithm using <a href="https://www.mathworks.com/products/matlab-test.html">MATLAB Test</a>
</li>
<li>Using <a href="https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/alternates/non-interactive/MATLAB-BATCH.md">batch tokens</a> for licensing of MATLAB Compiler SDK on cloud hosted runners. While licensing of many MathWorks products is provided for public projects, batch tokens allow you to leverage other products not supported (like Coders and Compilers). They also enable you to leverage CI for private projects.</li>
</ul>
</div>
<p>It's great to be back! Stay tuned for more and we'd love to hear how you are doing and what you'd like to learn more about!</p>
<script language="JavaScript"> <!-- 
    function grabCode_926d43d8b90b4d5a9eadbd68596b9931() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='926d43d8b90b4d5a9eadbd68596b9931 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 926d43d8b90b4d5a9eadbd68596b9931';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        copyright = 'Copyright 2025 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add copyright line at the bottom if specified.
        if (copyright.length > 0) {
            d.writeln('');
            d.writeln('%%');
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');

        d.title = title + ' (MATLAB code)';
        d.close();
    }   
     --> </script>
<p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray">
<br>
<a href="javascript:grabCode_926d43d8b90b4d5a9eadbd68596b9931()"><span style="font-size: x-small;        font-style: italic;">Get 
      the MATLAB code <noscript>(requires JavaScript)</noscript>
</span></a>
<br>
<br>
      Published with MATLAB&reg; R2025a<br>
</p>
</div>
<!--
926d43d8b90b4d5a9eadbd68596b9931 ##### SOURCE BEGIN #####
%%
% Hello everyone, it has been a long time! I am excited to resurrect the
% conversation a bit here because we have a number of topics that are in
% the pipeline. Actually, there have always been plenty of topics in the
% ol' blog pipeline, but the good news now is that we actually have been
% able to sit down and write some of them.
%
% Over the next little while Ajay Puvvala will be publishing a series of
% posts related to some exciting features we have in MATLAB around test
% selection. Super exciting stuff so be sure to keep an eye out for these.
%
% While you wait, I also wanted to quickly plug a couple of GitHub
% repositories that we've published to help with your CI workflows. 
%
%% The simplest config that works
% First, if you want to just get up and going on your CI platform with the
% simplest of configs, take a look at the
% <https://github.com/mathworks/ci-configuration-examples CI Configuration
% Examples> repository. This shows a basic "Hello World!" example for
% GitHub(R) Actions, GitLab(R) CI/CD, Jenkins(TM), Azure(R) DevOps, and
% CircleCI(R). You can go there right now, fork it, and immediately use
% cloud hosted runners on GitHub, Azure DevOps, or CircleCI to see the CI
% process in action. Note, GitHub makes it particularly easy because
% Actions are just built into GitHub itself.
%
% <<2025-ci-config-examples.png>>
%
%
%% (Slightly) more advanced configurations
% Additionally, for those looking for more advanced configurations, check out the
% <https://github.com/mathworks/advanced-ci-configuration-examples Advanced CI Configuration
% Examples> repository. This includes more complex setups and best practices
% for integrating MATLAB with these CI/CD tools. In this repository you
% will currently find two workflows that are demonstrated on 4 CI
% platforms: GitHub Actions, Azure DevOps, Jenkins, and CircleCI.
%
% <<2025-advanced-config.png>>
%
%% Multi-platform Toolbox Creation
% The first example goes through the build of a MATLAB toolbox across 3
% platforms to produce and release a single *|.mltbx|* file. This workflow
% currently shows:
% 
% * How to use a matrix build across platforms (Linux, Windows, and Mac)
% * Building platform specific mex files
% * Uploading these artifacts on each 
% * Retrieving the built mex files for each platform and packaging the
% toolbox
% * Publishing the toolbox to a GitHub release for distribution
% 
%% Multi-release deployment to integrate with Python(R)
% The second example shows how you can leverage the MATLAB Compiler SDK(TM)
% to create a python package from this algorithm. It does this across
% releases and operating systems. Some highlights of this workflow:
%
% * A double matrix build (across MATLAB releases and operating systems)
% * Creation and deployment of a python package from the MATLAB code using
% Compiler SDK
% * Equivalence testing of the deployed algorithm using
% <https://www.mathworks.com/products/matlab-test.html MATLAB Test>
% * Using
% <https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/alternates/non-interactive/MATLAB-BATCH.md
% batch tokens> for licensing of MATLAB Compiler SDK on cloud hosted
% runners. While licensing of many MathWorks products is provided for public
% projects, batch tokens allow you to leverage other products not supported
% (like Coders and Compilers). They also enable you to leverage CI for
% private projects.
%
% It's great to be back! Stay tuned for more and we'd love to hear how you
% are doing and what you'd like to learn more about!
##### SOURCE END ##### 926d43d8b90b4d5a9eadbd68596b9931
-->
]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2025/06/19/ci-for-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Everything you wanted to know about Big Data processing (but were too afraid to ask)</title>
		<link>https://blogs.mathworks.com/developer/2024/09/09/everything-you-wanted-to-know-about-big-data-processing-but-were-too-afraid-to-ask/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2024/09/09/everything-you-wanted-to-know-about-big-data-processing-but-were-too-afraid-to-ask/#respond</comments>
		
		<dc:creator><![CDATA[Arvind Hosagrahara]]></dc:creator>
		<pubDate>Tue, 10 Sep 2024 03:10:23 +0000</pubDate>
				<category><![CDATA[Big Picture]]></category>
		<category><![CDATA[Third Party Integration]]></category>
		<category><![CDATA[big data]]></category>
		<category><![CDATA[databricks]]></category>
		<category><![CDATA[spark]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=3227</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/GFS_architecture.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>
Let me start with a simple observation - You Probably Don’t Have Big Data. Modern data processing tools including our very own MATLAB and Simulink are powerful enough to handle hefty workloads.... <a class="read-more" href="https://blogs.mathworks.com/developer/2024/09/09/everything-you-wanted-to-know-about-big-data-processing-but-were-too-afraid-to-ask/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div>
<div>Let me start with a simple observation - <em>You Probably Don’t Have Big Data</em>. Modern data processing tools including our very own MATLAB and Simulink are powerful enough to handle hefty workloads. Today's computers have evolved to be massively powerful and can scale (sometimes trivially) to meet most data processing needs. Simultaneously, mature cloud technologies bring with them the promise of practically unlimited compute, storage, and networking capabilities.</div>
<br/>
<div>This evolution has led to the explosion of "Big Data". Datasets are now measured in Petabytes or larger. Event streams are ingested at the rates of hundreds of billions of data points a day, etc.</div>
<br/><div></div>
<div>The <a href="https://engineering.linkedin.com/kafka/running-kafka-scale" target="_blank" rel="noopener">LinkedIn Kafka system</a> processed over 175 terabytes (over 800 billion messages) daily as far back as 2015. At peak loads that translated to 2.75 gigabytes of data per second balanced over thousands of brokers on more than 60 clusters.</div>
<div></div>
<br/>
<div>Impressive as that may sound, in our line of work, i.e., in accelerating the pace of discovery in engineering, we run across systems that will clock up that kind of traffic in a hurry. The optical slipring on a typical CAT scan achieves speeds in excess of 10 Gbps. Some of these machines record tremendous amounts of data over minutes. From a different domain, the datasets that result from LIDAR point clouds acquired for large fleets of vehicles or the sampling rates from high-speed acquisition systems result in significant Big Data challenges. It would be fair to say that engineering data presents the same acute challenges and have been doing so for quite a while.</div>
<br/><div></div>
<div>The happy marriage of the techniques developed for handling Google sized workloads, with engineering data problems of today presented the rationale for this blog post. To fully understand why we are where we are, let us turn the clock back and start at the beginning.</div>
<br/></div>
<div></div>
<div>
<div>
<h3>In the beginning ...</h3>
</div>
</div>
<div>
<div>
<div>I could start with <a href="https://en.wikipedia.org/wiki/Monoid" target="_blank" rel="noopener">monoids</a>, <a href="https://en.wikipedia.org/wiki/Bird%E2%80%93Meertens_formalism" target="_blank" rel="noopener">Bird-Meertens formalism</a>, the <a href="https://en.wikipedia.org/wiki/Parallelization_contract" target="_blank" rel="noopener">parallelizaton contract</a>, <a href="https://en.wikipedia.org/wiki/*Lisp" target="_blank" rel="noopener">StarLisp</a>'s *map and reduce!! implementations and other esoteric topics when it comes to tracing the root of modern Big Data processing. This dates back to the 1980s and sometimes even earlier. Some of the debate on who did it first is a religious topic and often contested.</div>
<div><a href="https://blogs.mathworks.com/developer/files/ETLWoes.png"><img decoding="async" loading="lazy" width="636" height="487" class="aligncenter size-full wp-image-3257" src="https://blogs.mathworks.com/developer/files/ETLWoes.png" alt="Picture of pyramid. Nice! Can you move it 50ft that way! I'm sure our Data and ETL engineers will love it." /></a></div>
</div>
</div>
<div>For this post, however, I am going to adopt a more pragmatic view of modern Big Data processing and its roots. So, please sit back and enjoy the story, as re-told from my perspective. And no, I am not going to cover the 4 V's of what Big Data is - Volume, Velocity, Variety and Veracity... if you were curious. It is a topic that has been beaten to death elsewhere across the internet.</div>
<div></div>
<div>
<div>
<br/>
<h3>In the not so distant past ...</h3>
<div>In the early 2000s when I joined MathWorks, the tech industry was an exciting place to be. It still is. At the time, my work with leading automotive companies was where I touched my first Peta scale database - an <a href="https://www.asam.net/standards/detail/ods/" target="_blank" rel="noopener">ASAM ODS</a> data fusion server containing test data for post-processing and evaluation. All of this was set against the backdrop of early internet giants on the west coast jockeying for internet search dominance.</div>
<div></div>
<br/>
<div>At the time, Yahoo offered a hugely popular free email service and within a few years Google introduced the now ubiquitous Gmail service. With that offering, the internet search giant offered the internet connected public a treat. Rather than the 4-10MB capacities commonly available for free, Gmail offered a staggeringly large 1GB mailbox at launch - for free. Some people actually thought it was a hoax while many engineers (including myself) had only one thought... how are they doing it?</div>
<br/>
<div></div>
</div>
</div>
<div>
<div>
<h3>2002 - Apache Nutch</h3>
<div>The Apache Nutch project was in the process of building a search engine system that can index 1 billion pages. After a lot of research, two of their key researchers (Doug Cutting and Mike Cafarella) concluded that such a system would cost around half a million dollars in hardware, along with a monthly running cost of $30,000 approximately - which was both extremely expensive and infeasible. This will become relevant to our story shortly.</div>
<div></div>
</div>
</div>
<div>
<br/>
<h3>2003 - The Google File System</h3>
<div>The “how” of the Google approach became clear with the publication of the whitepaper detailing the <a href="https://storage.googleapis.com/gweb-research2023-media/pubtools/pdf/035fc972c796d33122033a0614bc94cff1527999.pdf" target="_blank" rel="noopener">Google File System (GFS)</a> by Sanjay Ghemawat, et. al. From a high-level, the system looked like:</div>
</div>
<a href="https://blogs.mathworks.com/developer/files/GFS_architecture.png"><img decoding="async" loading="lazy" width="1024" height="418" class="aligncenter size-large wp-image-3239" src="https://blogs.mathworks.com/developer/files/GFS_architecture-1024x418.png" alt="" /></a>
<div>
<div>Their design described how they achieved consistency, reliability and high-availability of a storage medium distributed across clusters. What is available as modern cloud storage e.g.: Amazon's S3, Azure Blob, Google Cloud Storage, Hadoop Distributed File System (HDFS), etc. are implementations of similar concepts. The real implication of the work was that the cost of storage plummeted. Esoteric and expensive enterprise storage systems had competition in the form of systems running over massive scales with cheap low-cost hardware (mentally, think of consumer-grade computers).</div>
<div></div>
</div>
<div>
<br/>
<h3>2004 - MapReduce: Simplified Data Processing on Large Clusters</h3>
<div>The Google system scanned all data on Gmail and on the heels of the “how we store stuff” came a key whitepaper describing “how we analyze stuff”. Their paper on <a href="https://static.googleusercontent.com/media/research.google.com/en//archive/mapreduce-osdi04.pdf" target="_blank" rel="noopener">MapReduce: Simplified Data Processing on Large Clusters</a> by Jeff Dean and Sanjay Ghemawat, shed light on how the massive amounts of data was being processed. While one can argue that the concepts for map-reduce pre-date the whitepaper, it is usually accepted that this represented the first accessible implementation for practitioners. A functional programming API designed for ease of use. In operation, this looked like:</div>
<a href="https://blogs.mathworks.com/developer/files/MapReduce.png"><img decoding="async" loading="lazy" width="1024" height="743" class="aligncenter size-large wp-image-3242" src="https://blogs.mathworks.com/developer/files/MapReduce-1024x743.png" alt="" /></a>
<div>It became clear that data being split or chunked could be replicated, stored, and distributed across a cluster. This data could then be analyzed in a distributed way <em>without moving the data</em>. Results of the analysis could be mapped and reduced to the user. In other words <em><strong>when the data is too big to move, you move the program to the data</strong></em>.</div>
<br/>
<div>This approach was disruptive to the way algorithms are built. As the simplest example, if I ran a <em>mean</em>() operation over every chunk or slice of data distributed across a cluster, I may never get the right result.</div>
<div></div>
<br/>
<div>To correctly compute a mean, I would need to return the sum of the samples on each chunk and the number of samples i.e. a tuple. This step would be the <em>map</em>() operation and subsequently I could <em>reduce</em>() these two numbers by adding all the totals and then dividing the result by the sum of the number of samples across the chunks.</div>
<div></div>
<br/>
<div>In short, the structure and staging of my math operation changes at scale.</div>
<div></div>
</div>
<div>
<div>
<br/>
<h3>2006 Apache Community support and adoption by Yahoo</h3>
<div>The ideas in the whitepapers above were used by the engineers/researchers working on Nutch who formed an independent subproject they called <a href="https://en.wikipedia.org/wiki/Apache_Hadoop" target="_blank" rel="noopener">Hadoop</a>. Additionally, Doug joined Yahoo and by 2007 Yahoo reported using Hadoop on a 1000 node cluster. By 2008, Yahoo released Hadoop as an open-source project and at around the same time, Google reported that its MapReduce implementation had sorted 1 TB in 68 seconds. By 2009, the team at Yahoo broke that record by doing it in 62 secs.</div>
<div></div>
<br/>
<div>The size of the clusters grew. The cost of storing data plummeted. Big Data movement grew nearly exponentially and continues to grow to this day fueled by the advances in AI, IoT systems and the cloud.</div>
<div></div>
</div>
</div>
<div>
<div>
<br/>
<h3>2009 Spark</h3>
<div>MapReduce was not without its challenges. It forced a particular linear dataflow on distributed programs and much of the map and reduce activity relied on disk storage. At the University of California Berkeley, Matei Zaharia initially developed Spark which as a fault-tolerant, in-memory, implementation with architectural roots in a resilient distributed dataset (RDD). The management of workflows as directed acyclic graphs (DAG), as well as a robust API to allow transformations and operations on the RDD resulted in reduced latencies sometimes orders of magnitude faster when compared to MapReduce implementations. The code was open sourced in 2010 and donated to the Apache Software Foundation.</div>
<div></div>
</div>
</div>
<div>
<div>
<br/>
<h3>2013 Databricks</h3>
<div>The company founded by Ali Ghodsi, Andy Konwinski, Arsalan Tavakoli-Shiraji, Ion Stoica, Matei Zaharia, Patrick Wendell, and Reynold Xin, grew out of the AMPLab at Berkeley offered a managed cloud-native data platform based on Spark.</div>
<div></div>
</div>
</div>
<div>
<div>
<br/>
<h3>2014 Spark Top-level Apache Project</h3>
<div>By 2014 Spark became a Top-Level Apache Project. The core contributors to the project from Databricks, <a href="https://www.databricks.com/blog/2014/11/05/spark-officially-sets-a-new-record-in-large-scale-sorting.html" target="_blank" rel="noopener">set a new record</a> by sorting 100TB (1 trillion records) in 23 minutes breaking the previous record set by Hadoop MapReduce. Their system ran 3X faster with 10X fewer machines.</div>
<br/>
<div>That was nearly 10 years ago. Since then, there have been steady advances in the optimization of performance of the libraries. A stream of innovations such as <a href="https://delta.io/" target="_blank" rel="noopener">Delta Lake</a> (to boost query performance) which launched in 2020, <a href="https://mlflow.org/" target="_blank" rel="noopener">MLflow</a> (for model lifecycle management), <a href="https://www.databricks.com/product/photon" target="_blank" rel="noopener">Photon</a> (vectorized engine in C++ that maintains a Spark compatible API) etc. continue to evolve capabilities of these big data systems.</div>
<div></div>
</div>
</div>
<br/>
<h3>2014-Present</h3>
Building on the foundation of Spark, innovation continues with innumerable optimizations in workflow, security, and performance.  The ecosystem of big data tools, features and vendor plugins mature with a focus on interoperability and access to a wide array of clients. Governance features such as the <a href="https://www.unitycatalog.io/" target="_blank" rel="noopener">Unity Catalog</a> appear as industry converge around standards.  The unification of the underlying storage formats, brings large top-level projects closer together in terms of performance and feature parity.

&nbsp;
<div>
<div>
<br/>
<h3>How it all works</h3>
<div>Enough of the history lesson, let us take a high-level peek as to how these systems work. I can try to summarize it in layperson terms with a few core principles.</div>
<ol>
 	<li><strong>Move the compute to the data</strong> - if the data is too big to move, it is easier to move the compute to the data.</li>
 	<li><strong>Speed is achieved by being smart about what work to do</strong> - When optimized down to the storage format, many of these systems are fast because they are not doing the work. For example, does a software program need to actually read all the rows of a dataset looking for a max if the metadata for the chunk of rows tells you that the answer you are looking for is not within the chunk.</li>
 	<li><strong>Keep it in memory when possible</strong> - The RDD and subsequently the Dataset and DataFrame APIs allow higher level abstractions to perform distributed computing tasks efficiently.</li>
 	<li>Try not to do the work until absolutely necessary - The DAG and <strong>lazy evaluation</strong> translate to methods of optimizing the work before actually doing any work.</li>
</ol>
There is a story behind each of these principles. I can describe what can you do with say a Parquet or ORC file that cannot be done with HDF or other binary file but that is a topic that is best left to a different blog post.

&nbsp;

</div>
</div>
<div>
<br/>
<h3>The hidden requirements</h3>
<div>As one starts doing real work with these systems, a whole slew of other technical and non-technical challenges emerge.</div>
<ol>
 	<li>How does one enable access to the data securely and effectively?</li>
 	<li>How are the insights from the analytics shared with the rest of the organization leading to actionable information?</li>
 	<li>What is the lineage of the data (where it came from and how has it been processed and enriched)?</li>
 	<li>What is the provenance of the analytics models (which version, what data was used to train it, how does it perform, etc.)?</li>
</ol>
The actual data processing is a subset of a larger picture in the context of data and model management. In this space, there is a need for security and governance. Often these requirements can be traced down to a maturity model. For example, are all users centralizing the tracking of their experiments so that they can compare effectively?

All of this leads to a desire for a holistic and unified approach to data analytics.

&nbsp;

</div>
<div>
<br/>
<h3>Hold on, why are you discussing this?</h3>
<div>I wanted to address how a typical user of MATLAB and Simulink can leverage these developments in handling Big Data problems. With the proliferation of the cloud, the explosion in the data sizes as well as the availability and maturity of data platforms like <a href="https://www.databricks.com/" target="_blank" rel="noopener">Databricks</a>, these advancements enable our users to tackle bigger problems while being faster. My desire is to enable our users to leverage all the domain specific expertise that comes with the wide array of our toolboxes with approaches that scale.</div>
<div></div>
<br/>
<div>The <strong>Ah-ha!</strong> moment for me was realizing that the same tools that are used to tackle web indexing problems at scale can be used to tackle some of the more gnarly engineering problems. After all, data is just data. Sometimes even the math is similar and well as we all know, the Math... Works.</div>
<br/>
<div>In an upcoming series of posts, we will hear from Michael Browne, Anders Sollander and Andy Thé, on the topic of processing Big Data. The next post will dive into the details of the many workflows enabled by integrations into our products.</div>
<div></div>
<br/>
<div>P.S: The view of "<em>why we are where we are"</em> in this post is my perspective. Perhaps a bit romanticized, but the narrative should be mostly accurate. How did I do? Please do consider leaving a comment below as hearing from you, the reader, usually makes my day.</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2024/09/09/everything-you-wanted-to-know-about-big-data-processing-but-were-too-afraid-to-ask/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Streamlining the Medical Imaging Software Development Lifecycle</title>
		<link>https://blogs.mathworks.com/developer/2024/05/23/software-development-with-medical-software/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2024/05/23/software-development-with-medical-software/#comments</comments>
		
		<dc:creator><![CDATA[Andy Campbell]]></dc:creator>
		<pubDate>Thu, 23 May 2024 17:55:52 +0000</pubDate>
				<category><![CDATA[Industry]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=3176</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/2024MedicalSoftware.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>Hello everyone, today I am excited to introduce a guest on the blog. Akhilesh Mishra provides industry specific support for our tool, focusing on the medical devices industry in particular. He and I... <a class="read-more" href="https://blogs.mathworks.com/developer/2024/05/23/software-development-with-medical-software/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<em>Hello everyone, today I am excited to introduce a guest on the blog. <strong>Akhilesh Mishra</strong> provides industry specific support for our tool, focusing on the medical devices industry in particular. He and I have been working together more often because the medical software and device industry that he supports is in the midst of a transformation to highly leverage the types of solid, robust, and proven software development practices that we know and love here on this blog. The further development of software tools such as our testing frameworks, quality management platforms like MATLAB Test, build automation tools, CI/CD platform support, and other VnV tools is very promising to support the quality needs of this industry, so today we have a little "industry deep dive" to see how these tools can make a difference in a </em><i>specific domain. Let us know what you think of this type of content in the comments. With that, Akhilesh, take it away!</i>

&nbsp;
<p style="font-weight: 400;"><a href="https://blogs.mathworks.com/developer/files/2024MedicalSoftware.png">
<img decoding="async" loading="lazy" width="1775" height="600" class="aligncenter size-full wp-image-3185" src="https://blogs.mathworks.com/developer/files/2024MedicalSoftware.png" alt="" /></a></p>
<p style="font-weight: 400;">The development of medical imaging software is a meticulous process that plays a critical role in advancing healthcare diagnostics and treatment. The rapid pace of technological change requires continuous investment in innovation to stay competitive. Companies must constantly update their devices with the latest advancements, such as artificial intelligence for image analysis. To accomplish that, the lifecycle of such software development usually encompasses several stages, from conception and design to deployment and maintenance. Each phase presents unique challenges that developers and project managers must overcome to ensure the delivery of high-quality, reliable, and compliant software in the shortest amount of time.</p>

<h2 style="font-weight: 400;"><strong>The Power of a Common Platform</strong></h2>
<p style="font-weight: 400;">To navigate these complexities effectively, a strategic and unified approach is essential. A common platform for medical imaging software development emerges as the key solution, offering a connected ecosystem where all stages of the lifecycle are seamlessly integrated. This enables efficient collaboration among diverse teams – software developers, verification engineers, regulatory specialists, and more – streamlining the entire process.</p>
<p style="font-weight: 400;">MATLAB is one such platform that has an integrated workflow for tying all the stages of the software development lifecycle together. Maintaining a digital thread throughout the development lifecycle is one of the ways to significantly shorten the software development timeline.</p>
<p style="font-weight: 400;"><a href="https://blogs.mathworks.com/developer/files/2024DevLifecycle.png"><img decoding="async" loading="lazy" class="aligncenter wp-image-3188" src="https://blogs.mathworks.com/developer/files/2024DevLifecycle.png" alt="" width="1040" height="553" /></a></p>
<p style="font-weight: 400; text-align: center;"><em>Figure 1: Bring all the software development lifecycle stages to one platform</em></p>
<p style="font-weight: 400;">Let's explore how a common platform tackles the specific challenges encountered throughout the development lifecycle:</p>

<ol>
 	<li><strong>Conceptualization and Planning: </strong>Medical imaging software is usually focused on three areas: image formation and reconstruction, pre-processing, or analysis algorithms. Defining clear and achievable objectives is necessary to clearly state the current capability being reformed or new functionality being added. Given the complexity of medical imaging needs and the diversity of clinical environments, setting realistic goals can be challenging. Defining requirements of the new feature - considering integration with the existing system and/or redefining the requirements of the existing system due to the new feature to ensure integrity - often becomes a challenging problem.</li>
</ol>
<p style="font-weight: 400; padding-left: 40px;"><strong>Solution: </strong> Starting with conceptualization, MATLAB offers solutions for requirements analysis and software architecture, which help define clear objectives and deliverables for the new feature. These tools integrate with various third-party requirements and system engineering tools so that the software development can also be linked to the entire system development workflows (electrical, mechanical, fluids, etc.).</p>

<ol start="2">
 	<li style="font-weight: 400;"><strong>Design and Prototyping:</strong> During the design phase, developers must create a design concept that balances advanced imaging functionality with user-friendly interfaces. Complex features should not compromise the ease of use for healthcare professionals. For that reason, several iterations usually happen during the prototyping phase to figure out the best possible version. This prototyping and iterative feedback from the end-users phase can sometimes be long and impact the overall product timeline.</li>
</ol>
<p style="font-weight: 400; padding-left: 40px;"><strong>Solution: </strong>MATLAB offers an extensive suite of image processing, signal processing, analysis, and <strong>AI capabilities</strong> that simplify the creation of complex algorithms. With the high-level language and interactive environment, developers can quickly prototype and iterate on sophisticated image formation, pre-processing, and analysis algorithms, reducing development time and increasing efficiency.</p>

<ol start="3">
 	<li><strong>Testing, Verification and Validation: </strong>Medical imaging software must be rigorously tested to ensure accuracy and reliability. Simulating the full range of clinical scenarios can be difficult. Again, with regulatory compliance in consideration, there is no shortcut for thorough testing. It is more often required to collaborate with clinical partners to conduct thorough testing, including unit, integration, system, and acceptance testing – which becomes a long iterative process.</li>
</ol>
<p style="font-weight: 400; padding-left: 40px;"><strong>Solution: </strong>Once the prototypes are developed, testing, verification, and validation are integrated into the prototype development process. The requirements and system architectures are directly tied to the prototype code, which extends to all the testing, verification, and validation suites. MATLAB also allows for the automation of the testing processes with continuous integration workflows, leading to more reliable and repeatable test outcomes. You can also develop Web Apps for sharing and testing the algorithms with clinical collaborators.</p>

<ol start="4">
 	<li><strong>Deployment and Integration:</strong> Integrating new software into existing healthcare IT systems such as RIS or PACS without disrupting clinical workflows is a common challenge. Sometimes the software needs to be deployed on edge systems; other times, the algorithms live on an enterprise system such as a cloud or hospital server. Using established standards like DICOM and HL7 to ensure compatibility is often necessary, and there is a need for comprehensive integration and system testing to ensure the functionality of the overall system is not compromised.</li>
</ol>
<p style="font-weight: 400; padding-left: 40px;"><strong>Solution: </strong>MATLAB supports interoperability with other programming languages and technologies, making it easier to integrate MATLAB-based algorithms into the healthcare IT infrastructures. The ability to compile MATLAB code into standalone applications or software components also facilitates integration with various systems. MATLAB can generate standalone C/C++/CUDA/HDL code for integration into various edge systems and compile into various libraries, e.g., Python, .NET, Java, etc., for integrating with enterprise systems. MathWorks fully supports cloud integration and integration with PACS databases while ensuring DICOM compatibility. All the deployment steps are usually automated—sometimes just a click of a button, which significantly reduces the overall development time. The requirements, test suites, and prototype code are all tied to the deployed code, making the testing and validation much faster while ensuring true code quality.</p>

<ol start="5">
 	<li style="font-weight: 400;"><strong>Regulatory Compliance:</strong> Compliance with regulations such as FDA 21 CFR Part 11, IEC 62304/IEC 82304, or the MDR is mandatory for bringing medical imaging software to the market. Keeping up with changing regulations and ensuring compliance can be overwhelming. It is mandatory for companies to implement a quality management system (QMS) that is designed to meet regulatory requirements throughout the software development lifecycle. This is also a necessary process, and sometimes a software development lifecycle can involve several iterations between the development, verification, and software teams. Since in this phase all the product teams get involved, the time taken to converge is often very long.</li>
</ol>
<p style="font-weight: 400; padding-left: 40px;"><strong>Solution : </strong>MATLAB supports compliance with regulations (FDA/MDR)  and industry standards(IEC 62304) by providing solutions for tool validation, ,traceability from requirements to code, verification, and test report generation for technical files. The MATLAB environment supports the creation of clear and comprehensive documentation that can save significant amount of time and effort for regulatory submission and audits. The digital thread enables tracking any changes to the artifacts, tracing relationships between artifacts, identifying outdated results, performing incremental updates of results, and many more capabilities which greatly reduce the regulatory burden. Every single line of code that becomes part of the medical device can be traced back to the original requirements, architecture, prototype code, and test cases; and other metrics such as code coverage, etc., are also reported.</p>

<ol start="6">
 	<li style="font-weight: 400;"><strong>Maintenance and Updates:</strong> After deployment and market release, the software must be maintained, updated, and scaled to meet evolving clinical needs and technological advancements. Companies are required to develop a long-term maintenance plan that includes regular updates, patches, and technical support. Designing the software with scalability in mind to accommodate future growth and changes adds to the total development timeline.</li>
</ol>
<p style="font-weight: 400; padding-left: 40px;"><strong>Solution: </strong>MATLAB's modular structure allows for easy updates and scalability. Developers can modify or extend functionality without overhauling the entire system. MATLAB's compatibility with previous versions also ensures a smoother transition when upgrading software components.</p>

<h2 style="font-weight: 400;"><strong>Benefits Beyond Efficiency</strong></h2>
<p style="font-weight: 400;">Adopting a common platform approach extends beyond just efficiency gains. It fosters collaboration, enhances transparency, and ensures data integrity throughout the development process. This ultimately leads to higher-quality software, faster time-to-market, and improved patient care.</p>

<h2 style="font-weight: 400;"><strong>The Path Forward</strong></h2>
<p style="font-weight: 400;">As the medical imaging landscape continues to evolve, a common platform becomes increasingly essential for navigating the complexities of software development. By embracing this unified approach, companies can unlock their full potential, bringing innovative and reliable solutions to the healthcare industry while ensuring compliance and patient safety.</p>
&nbsp;]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2024/05/23/software-development-with-medical-software/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Dependency-based Test Selection</title>
		<link>https://blogs.mathworks.com/developer/2023/10/26/dependency-based-test-selection/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2023/10/26/dependency-based-test-selection/#respond</comments>
		
		<dc:creator><![CDATA[Tim Johns]]></dc:creator>
		<pubDate>Thu, 26 Oct 2023 10:53:14 +0000</pubDate>
				<category><![CDATA[MATLAB Test]]></category>
		<category><![CDATA[Testing]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=3168</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/dependency_based_test_selection_1.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>This is the final part in my series on MATLAB Test where we’ll look at how to select tests based on files they depend on. Previously, I have covered:An introduction to MATLAB Test and the Test... <a class="read-more" href="https://blogs.mathworks.com/developer/2023/10/26/dependency-based-test-selection/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This is the final part in my series on </span><a href = "https://uk.mathworks.com/products/matlab-test.html"><span style=' text-decoration: underline;'>MATLAB Test</span></a><span> where we’ll look at how to select tests based on files they depend on. Previously, I have covered:</span></div><ol  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://blogs.mathworks.com/developer/2023/08/16/introducing-matlab-test/"><span style=' text-decoration: underline;'>An introduction to MATLAB Test and the Test Manager</span></a><span> </span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://blogs.mathworks.com/developer/2023/08/30/weve-got-you-covered/"><span style=' text-decoration: underline;'>The use of advanced coverage metrics</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://blogs.mathworks.com/developer/2023/09/18/measuring-and-monitoring-code-quality/"><span style=' text-decoration: underline;'>Measuring and monitoring code quality</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://blogs.mathworks.com/developer/2023/10/26/equivalence-testing/"><span style=' text-decoration: underline;'>Equivalence testing</span></a><span>.</span></li></ol><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In large and complex projects, running the entire test suite every time something changes can be prohibitively expensive in time and/or compute resource. In these instances, just running the tests that are affected by the changes may be preferable. MATLAB Test provides mechanisms for easily doing this:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://uk.mathworks.com/help/matlab/ref/runtests.html?s_tid=doc_ta#mw_79355383-7fd0-49be-89c1-40d892b92f33"><span style=' text-decoration: underline;'>runtests(__,DependsOn=val)</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://uk.mathworks.com/help/matlab/ref/testsuite.html?s_tid=doc_ta#d126e1626824"><span style=' text-decoration: underline;'>testsuite(__,DependsOn=val)</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://uk.mathworks.com/help/matlab/ref/matlab.unittest.testsuite-class.html#mw_7c3ef716-b759-4c2e-82cf-0173a2c03285"><span style=' text-decoration: underline;'>matlab.unittest.TestSuite.fromX(__,DependsOn=val)</span></a><span> where </span><span style=' font-style: italic;'>X</span><span> can be </span><span style=' font-style: italic;'>Class</span><span>, </span><span style=' font-style: italic;'>File</span><span>, </span><span style=' font-style: italic;'>Folder</span><span>, </span><span style=' font-style: italic;'>Method</span><span>, </span><span style=' font-style: italic;'>Name</span><span>, </span><span style=' font-style: italic;'>Package</span><span>, </span><span style=' font-style: italic;'>Project</span><span>, or </span><span style=' font-style: italic;'>Requirements</span><span>.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://uk.mathworks.com/help/matlab/ref/matlab.unittest.testsuite.selectif.html#bt44o27-1_sep_mw_515891b9-6fdf-4b32-85c7-7c75157d5b07"><span style=' text-decoration: underline;'>selectIf(suite,DependsOn=Val)</span></a><span> where </span><span style=' font-style: italic;'>suite</span><span> is a </span><span style=' font-style: italic;'>matlab.unittest.TestSuite</span><span> array.</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In the above, </span><span style=' font-style: italic;'>val</span><span> is a string array of files and folders that the tests must depend on to be selected. A MATLAB Test licence is required to use this feature.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In the following example, I have a project with source code and tests. The Dependency Analyzer shows me that some tests depend on </span><span style=' font-style: italic;'>AccountManager</span><span> whilst those in </span><span style=' font-style: italic;'>DocPolynomTest</span><span> don’t.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/developer/files/dependency_based_test_selection_1.png" width = "845" height = "405" alt = "dependency-analysis.png" style = "vertical-align: baseline; width: 845px; height: 405px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span style=' font-style: italic;'>Example project and dependencies.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If I create a test suite from the project, I get 8 test points from both test classes:</span></div><div class = 'preformatted-plain' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&gt;&gt; s = testsuite(pwd);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&gt;&gt; {s.Name}'</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >ans =</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >  8×1 cell array</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testConstructor'               }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testConstructorNotEnoughInputs'}</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testDeposit'                   }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testWithdraw'                  }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testNotifyInsufficientFunds'   }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'DocPolynomTest/testConstructor'                }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'DocPolynomTest/testAddition'                   }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'DocPolynomTest/testMultiplication'             }</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If I instead specify that I only want tests that depend on </span><span style=' font-style: italic;'>AccountManager</span><span>, I get the expected subset:</span></div><div class = 'preformatted-plain' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&gt;&gt; s = testsuite(pwd,DependsOn="source/AccountManager.m");</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&gt;&gt; {s.Name}'</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >ans =</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >  5×1 cell array</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testConstructor'               }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testConstructorNotEnoughInputs'}</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testDeposit'                   }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testWithdraw'                  }</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    {'BankAccountTest/testNotifyInsufficientFunds'   }</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>For more control, you can use the </span><a href = "https://uk.mathworks.com/help/matlab-test/ref/matlabtest.selectors.dependson-class.html"><span style=' text-decoration: underline;'>matlabtest.selectors.DependsOn</span></a><span> selector which allows you to control whether or not subfolders of the specified folders are included in the search, and what the maximum search depth is. The respective defaults are to not include subfolders and to search the full dependency hierarchy.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The DependsOn selector can also be used in conjunction with the Test Manager’s custom test suite functionality. From the drop-down menu, select “Manage Custom Test Suites”:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/developer/files/dependency_based_test_selection_2.png" width = "244" height = "157" alt = "manage-test-suites.png" style = "vertical-align: baseline; width: 244px; height: 157px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span style=' font-style: italic;'>Manage Custom Test Suites.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Create a new test suite that uses the DependsOn selector:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/developer/files/dependency_based_test_selection_3.png" width = "694" height = "334" alt = "test-suite-manager.png" style = "vertical-align: baseline; width: 694px; height: 334px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span style=' font-style: italic;'>Create a new test suite using the DependsOn selector.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Save and close, then select the new test suite from the Test Manager drop-down menu to view it:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/developer/files/dependency_based_test_selection_4.png" width = "678" height = "368" alt = "test-manager.png" style = "vertical-align: baseline; width: 678px; height: 368px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span style=' font-style: italic;'>New test suite in the Test Manager.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Note that for complex projects, performing the dependency analysis may take some time. There’s therefore a trade-off to be found between the time it takes to do the analysis and the time it takes to run the entire suite.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>So how do we get the list of changed files to pass into the DependsOn selector? If you’re using Projects and you have uncommitted changes, the Projects API will tell you:</span></div><div class = 'preformatted-plain' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&gt;&gt; prj = currentProject();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >&gt;&gt; prj.listModifiedFiles</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >ans = </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >  ProjectFile with properties:</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                   Path: "C:\blogs-test-selection\source\BankAccount.m"</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >               Revision: "8974b348f16d445c01409bbcd00f7b9777aa40fd"</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    SourceControlStatus: Modified</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                 Labels: [1×1 matlab.project.Label]</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>However, if you have committed changes and/or want to compare one branch to other (e.g. for a pull request), you’ll have to do some manual work with Git to get the list of changed files.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The DependsOn selector determines dependencies with static analysis. Static analysis has some limitations (</span><a href = "https://uk.mathworks.com/help/simulink/ug/scope-and-limitations.html"><span style=' text-decoration: underline;'>documented here</span></a><span>) which means that it's not infallible. Therefore, I still recommend running a full suite of tests at key stages of your development process.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In conclusion, MATLAB Test provides a mechanism for selecting tests that are impacted by source code changes, allowing you to run the subset of tests that matter and saving testing time.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This completes the series on MATLAB Test. I’ll be back with updates when new MATLAB releases come out!</span></div>
</div><script type="text/javascript">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2023/10/26/dependency-based-test-selection/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Equivalence Testing</title>
		<link>https://blogs.mathworks.com/developer/2023/10/26/equivalence-testing/?s_tid=feedtopost</link>
					<comments>https://blogs.mathworks.com/developer/2023/10/26/equivalence-testing/#respond</comments>
		
		<dc:creator><![CDATA[Tim Johns]]></dc:creator>
		<pubDate>Thu, 26 Oct 2023 10:36:45 +0000</pubDate>
				<category><![CDATA[MATLAB Test]]></category>
		<category><![CDATA[Testing]]></category>
		<guid isPermaLink="false">https://blogs.mathworks.com/developer/?p=3150</guid>

					<description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/developer/files/equivalenceTesting_2.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>This is part 4 in my series on MATLAB Test in which we’ll look at the new equivalence testing functionality it provides for MATLAB code. Previously, I have covered:An introduction to MATLAB Test and... <a class="read-more" href="https://blogs.mathworks.com/developer/2023/10/26/equivalence-testing/">read more >></a></p>]]></description>
										<content:encoded><![CDATA[<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This is part 4 in my series on </span><a href = "https://uk.mathworks.com/products/matlab-test.html"><span style=' text-decoration: underline;'>MATLAB Test</span></a><span> in which we’ll look at the new equivalence testing functionality it provides for MATLAB code. Previously, I have covered:</span></div><ol  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://blogs.mathworks.com/developer/2023/08/16/introducing-matlab-test/"><span style=' text-decoration: underline;'>An introduction to MATLAB Test and the Test Manager</span></a><span> </span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://blogs.mathworks.com/developer/2023/08/30/weve-got-you-covered/"><span style=' text-decoration: underline;'>The use of advanced coverage metrics</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://blogs.mathworks.com/developer/2023/09/18/measuring-and-monitoring-code-quality/"><span style=' text-decoration: underline;'>Measuring and monitoring code quality</span></a><span>.</span></li></ol><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>What is equivalence testing and why do I need it?</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In MATLAB, we can transform MATLAB code to C or C++ using </span><a href = "https://uk.mathworks.com/products/matlab-coder.html"><span style=' text-decoration: underline;'>MATLAB Coder</span></a><span>, or to .NET assemblies, Java classes, or Python packages using </span><a href = "https://uk.mathworks.com/products/matlab-compiler-sdk.html"><span style=' text-decoration: underline;'>MATLAB Compiler SDK</span></a><span>. In such cases, we will often want to verify that the transformed version of our code behaves in exactly the same way as the original MATLAB code. This is particularly important in safety critical environments such as medical devices or </span><a href = "https://en.wikipedia.org/wiki/Advanced_driver-assistance_system"><span style=' text-decoration: underline;'>ADAS</span></a><span> where it is the transformed code that is used in the final product.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Equivalence (or back-to-back) testing is a form of dynamic testing that checks that these two software systems produce the same output when given the same inputs. MATLAB Test provides a new framework that makes it easy to write such equivalence tests.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Basic syntax</span></h2><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span>C/C++ code</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The syntax for writing equivalence tests using the framework provided by MATLAB Test will be very familiar if you’re used to writing class-based unit tests. Given a function </span><span style=' font-style: italic;'>myAdd</span><span> defined as:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">function </span><span >y = myAdd(a,b)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    y = a + b;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The equivalence test for C code is:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">classdef </span><span >tEquivalence &lt; matlabtest.coder.TestCase</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods</span><span >(Test)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >tMyAdd(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            buildResults = build(testCase,</span><span style="color: #a709f5;">"myAdd"</span><span >,Inputs={1,2});</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            executionResults = execute(testCase,buildResults);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyExecutionMatchesMATLAB(testCase,executionResults)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>There are a few things to note:</span></div><ol  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Our test class inherits from </span><a href = "https://uk.mathworks.com/help/matlab-test/ref/matlabtest.coder.testcase-class.html"><span style=' text-decoration: underline;'>matlabtest.coder.TestCase</span></a><span> rather than the usual </span><a href = "https://uk.mathworks.com/help/matlab/ref/matlab.unittest.testcase-class.html"><span style=' text-decoration: underline;'>matlab.unittest.TestCase</span></a><span>.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>The new </span><a href = "https://uk.mathworks.com/help/matlab-test/ref/matlabtest.coder.testcase.build.html"><span style=' font-style: italic; text-decoration: underline;'>build</span></a><span> method builds the C binary that we will execute as part of the test. We specify the name of the entry point function we want to build (</span><span style=' font-style: italic;'>myAdd</span><span>) and some default inputs. These "compile-time" inputs are required for code generation and are similar to codegen’s ­</span><span style=' font-style: italic;'>-args</span><span> flag. It’s an optional argument as it’s possible to write functions with no input arguments.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>The new </span><a href = "https://uk.mathworks.com/help/matlab-test/ref/matlabtest.coder.testcase.execute.html"><span style=' font-style: italic; text-decoration: underline;'>execute</span></a><span> method executes the C binary using the default inputs. You can also specify different "run-time" inputs here if you so wish.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>The </span><a href = "https://uk.mathworks.com/help/matlab-test/ref/matlabtest.coder.testcase.verifyexecutionmatchesmatlab.html"><span style=' font-style: italic; text-decoration: underline;'>verifyExecutionMatchesMATLAB</span></a><span> method does what it says – it produces a verification failure if the output from the C code does not match that of MATLAB.</span></li></ol><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The </span><a href = "https://uk.mathworks.com/help/matlab-test/ug/generate-c-code-and-test-for-equivalence.html"><span style=' text-decoration: underline;'>documentation</span></a><span> contains more detailed information such as how to configure additional code generation options, reuse existing generated C or C++ code, or </span><a href = "https://uk.mathworks.com/help/matlab-test/ug/equivalence-test-cc-code-for-multiple-entry-points-and-function-signatures.html"><span style=' text-decoration: underline;'>test generated code with multiple entry points</span></a><span>.</span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span>.NET, Java, Python</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>For MATLAB Compiler SDK workflows, the syntax is very similar:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">classdef </span><span >tDeployment &lt; matlabtest.compiler.TestCase</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods </span><span >(Test)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >pythonEquivalence(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            buildResults = build(testCase,</span><span style="color: #a709f5;">"myAdd.m"</span><span >,</span><span style="color: #a709f5;">"pythonPackage"</span><span >);                 </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            executionResults = execute(testCase,buildResults,{1,2});</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyExecutionMatchesMATLAB(testCase,executionResults);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>We now inherit from </span><a href = "https://uk.mathworks.com/help/matlab-test/ref/matlabtest.compiler.testcase-class.html"><span style=' text-decoration: underline;'>matlabtest.compiler.TestCase</span></a><span> and the signatures of the </span><a href = "https://uk.mathworks.com/help/matlab-test/ref/matlabtest.compiler.testcase.build.html"><span style=' font-style: italic; text-decoration: underline;'>build</span></a><span> and </span><a href = "https://uk.mathworks.com/help/matlab-test/ref/matlabtest.compiler.testcase.execute.html"><span style=' font-style: italic; text-decoration: underline;'>execute</span></a><span> functions are very slightly different to those of </span><span style=' font-style: italic;'>matlabtest.coder.TestCase</span><span> that we looked at above.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Again, the </span><a href = "https://uk.mathworks.com/help/matlab-test/ug/generate-deployment-artifacts-and-test-for-equivalence.html"><span style=' text-decoration: underline;'>documentation</span></a><span> gives full details of the syntax such as how to specify additional MATLAB Compiler SDK options.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Reusing unit tests for equivalence testing</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In this section I’m going to show how tests that have be written to verify a MATLAB algorithm can be repurposed for equivalence testing. The implementation </span><span style=' font-style: italic;'>shortestPath</span><span> and corresponding 14 test points are based on the </span><a href = "https://uk.mathworks.com/help/matlab-test/gs/verify-a-matlab-algorithm.html"><span style=' text-decoration: underline;'>example project that comes with MATLAB Test</span></a><span>.</span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span>Overview</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The basic structure of the tests is:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">classdef </span><span >tMATLABTests &lt; matlab.unittest.TestCase</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods </span><span >(Test)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >aTestPoint(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Generate inputs            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjacency = </span><span style="color: rgb(225, 27, 20);">…</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = </span><span style="color: rgb(225, 27, 20);">…</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = </span><span style="color: rgb(225, 27, 20);">…</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expectedResult = </span><span style="color: rgb(225, 27, 20);">…</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            debugTxt = </span><span style="color: rgb(225, 27, 20);">…</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjacency,startIdx,endIdx, expectedResult,debugTxt);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>where the method </span><span style=' font-style: italic;'>verifyPathLength</span><span> is of the form:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">function </span><span >verifyPathLength(testCase,adjacency,startIdx,endIdx, expectedResult,debugTxt)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Execute the design</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    actualResult = shortestPath(adjacency, startIdx, endIdx);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Confirm the expected</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    msgTxt = sprintf(</span><span style="color: #a709f5;">'Failure context: %s'</span><span >, debugTxt);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    testCase.verifyEqual(actualResult, expectedResult, msgTxt);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I can use the Test Browser to add </span><span style=' font-style: italic;'>tMATLABTests</span><span> to my list of tests and run them:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/developer/files/equivalenceTesting_1.png" width = "353" height = "460" alt = "testBrowser-matlab.png" style = "vertical-align: baseline; width: 353px; height: 460px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span style=' font-style: italic;'>Output of tMATLABTests in the Test Browser.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span style=' font-style: italic;'>verifyPathLength</span><span> contains all the code that we will need to modify to switch the tests from being standard MATLAB unit tests to equivalence tests. However, it would be nice to retain the original tests whilst adding the ability to run equivalence tests without duplicating code. We can do this by subclassing </span><span style=' font-style: italic;'>tMATLABTests</span><span> and overloading the </span><span style=' font-style: italic;'>verifyPathLength </span><span>method.</span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span>Equivalence test for C code</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>To support the equivalence testing of C code, I’m going to create a subclass of </span><span style=' font-style: italic;'>tMATLABTests</span><span> called </span><span style=' font-style: italic;'>tEquivalenceTestsForC</span><span>. This code needs to do 4 things:</span></div><ol  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Inherit from </span><span style=' font-style: italic;'>matlabtest.coder.TestCase</span><span> in addition to </span><span style=' font-style: italic;'>tMATLABTests</span><span> so that we have access to the equivalence testing functionality that we need.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Build the code – it’s most efficient if we do this once for the test class rather than for each test point individually. We can use a </span><span style=' font-style: italic;'>TestClassSetup</span><span> block to do this and store the result as a property. There’s an additional catch that the </span><span style=' font-style: italic;'>adjacency</span><span> input is not of fixed size. We need to tell MATLAB Coder about this using the </span><a href = "https://uk.mathworks.com/help/coder/ref/coder.typeof.html"><span style=' font-style: italic; text-decoration: underline;'>coder.typeof</span></a><span> function.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Execute the code for the given inputs.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Compare the results to MATLAB.</span></li></ol><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Here’s the code:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">classdef </span><span >tEquivalenceTestsForC &lt; tMATLABTests &amp; matlabtest.coder.TestCase</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">properties </span><span >(Access = private)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        BuildResults</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods </span><span >(TestClassSetup)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >generateCode(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Build the function once and store the results for reuse -</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% much more efficient that building for every test point.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Define input arguments that will allow shortestPath to build.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Since adjacency can be of variable size, we use coder.typeof</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% to declare that it's a double matrix that can be up to 20x20</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% and that both rows and columns can change size.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjacency = coder.typeof(0,[20 20],[true true]);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            inputs = { adjacency -1 2};</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Build the function</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            testCase.BuildResults = testCase.build(</span><span style="color: #a709f5;">"shortestPath"</span><span >,Inputs=inputs);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >verifyPathLength(testCase,adjacency,startIdx,endIdx,~,~)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Execute the function in both MATLAB and C using the inputs</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% provided by each test point.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            executionResults = testCase.execute(testCase.BuildResults,Inputs={adjacency,startIdx,endIdx});</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Verify C matches MATLAB.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            testCase.verifyExecutionMatchesMATLAB(executionResults)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span> As before, we can add </span><span style=' font-style: italic;'>tEquivalenceTestsForC</span><span> to the Test Browser and run the tests:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/developer/files/equivalenceTesting_2.png" width = "356" height = "474" alt = "testBrowser-c.png" style = "vertical-align: baseline; width: 356px; height: 474px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span style=' font-style: italic;'>Output of tEquivalenceTestsForC in the Test Browser.</span></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span>Equivalence test for Python</span></h3><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>To support the equivalence testing of Python code, I’m going to create a second subclass of </span><span style=' font-style: italic;'>MATLABTests</span><span> called </span><span style=' font-style: italic;'>tEquivalenceTestsForPython</span><span>. Whilst this example is for Python, you can follow the same procedure for Java or .NET. Our code needs to do 4 things:</span></div><ol  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Inherit from </span><span style=' font-style: italic;'>matlabtest.compiler.TestCase </span><span>(note compiler, not coder!) in addition to </span><span style=' font-style: italic;'>tMATLABTests</span><span> so that we have access to the equivalence testing functionality that we need.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Build the code – it’s most efficient if we do this once for the test class rather than for each test point individually. We can use a </span><span style=' font-style: italic;'>TestClassSetup</span><span> block to do this and store the result as a property.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Execute the code for the given inputs.</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Compare the results to MATLAB.</span></li></ol><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Note that since Python is a dynamically typed language, we don’t need to use the </span><span style=' font-style: italic;'>coder.typeof</span><span> construct that we had for C.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Here’s the code:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">classdef </span><span >tEquivalenceTestsForPython &lt; tMATLABTests &amp; matlabtest.compiler.TestCase</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">properties </span><span >(Access = private)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        BuildResults</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods </span><span >(TestClassSetup)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >generateCode(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Build the function once and store the results for reuse -</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% much more efficient that building for every test point.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            testCase.BuildResults = testCase.build(</span><span style="color: #a709f5;">"shortestPath.m"</span><span >,</span><span style="color: #a709f5;">"pythonPackage"</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >verifyPathLength(testCase,adjacency,startIdx,endIdx,~,~)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Execute the function in both MATLAB and Python using the</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% inputs provided by each test point.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            executionResults = testCase.execute(testCase.BuildResults,{adjacency,startIdx,endIdx});</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Verify Python matches MATLAB.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            testCase.verifyExecutionMatchesMATLAB(executionResults)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span > </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>We can then run the tests in the Test Browser. Note that you must have a compatible version of Python installed – see </span><a href = "https://uk.mathworks.com/help/matlab/ref/pyenv.html"><span style=' text-decoration: underline;'>pyenv</span></a><span> for more details.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/developer/files/equivalenceTesting_3.png" width = "357" height = "530" alt = "testBrowser-python.png" style = "vertical-align: baseline; width: 357px; height: 530px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span style=' font-style: italic;'>Output of tEquivalenceTestsForPython in the Test Browser.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In this case we have a test failure which we will need to investigate further.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Conclusion</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In this blog post we’ve looked at the new functionality available in MATLAB Test to support equivalence testing when transforming MATLAB code to C, C++, Python, Java, or .NET. Equivalence testing is particularly important in safety critical environments such as medical devices or ADAS. We also looked at how inheritance can be leveraged to reuse existing MATLAB tests for equivalence testing.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In the next and final post in the series, I will explore dependency-based test selection.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Code listing</span></h2><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span>shortestPath</span></h3><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">function </span><span >pathLength = shortestPath(adjMatrix, startIdx, endIdx) </span><span style="color: #008013;">%#codegen</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">% SHORTEST_PATH - Finds length of shortest path between nodes in a graph</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">% </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">%   OUT = SHORTEST_PATH(ADJMTX, STARTIDX, ENDIDX) Takes a graph represented by</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">%   its adjacency matrix ADJMTX along with two node STARTIDX, ENDIDX as</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">%   inputs and returns a integer containing the length of the shortest path</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">%   from STARTIDX to ENDIDX in the graph.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">% Copyright 2021 The MathWorks, Inc.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">    %% Validy testing on the inputs </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% This code should never throw an error and instead should return</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% error codes for invlid inputs.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    ErrorCode = 0;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    pathLength = -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Check the validity of the adjacency matrix</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if </span><span >(~isAdjMatrixValid(adjMatrix))</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        ErrorCode = -9;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Check the validity of the startIdx</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if </span><span >~isNodeValid(startIdx)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        ErrorCode = -19;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Check the validity of the endIdx</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if </span><span >~isNodeValid(endIdx)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        ErrorCode = -29;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    [nodeCnt, n] = size(adjMatrix);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Start or end node is too large</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if </span><span >startIdx &gt; nodeCnt || endIdx &gt; nodeCnt</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        ErrorCode = -99;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Start or end node is too small</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if </span><span >startIdx &lt; 1 || endIdx &lt; 1</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        ErrorCode = -199;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if </span><span >(ErrorCode&lt;0)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        pathLength = ErrorCode;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">return</span><span >;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">    %% Self-loop path is always 0</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if </span><span >startIdx  == endIdx</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        pathLength = 0;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">return</span><span >;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #008013;">    %% Dijkstra's Algorithm </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Dijkstra's Algorithm is used to iteratively explore the graph breadth</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% first and update the shortest path until we reach the end node.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Initialization</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    max = realmax;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    visited = false(1, nodeCnt);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% The distance vector maintains the current known shortest path from </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% the start node to every node.  As nodes are processed one by one </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% the distance vestor is updated</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    distance = repmat(max, 1, nodeCnt);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    distance(startIdx) = 0;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">for </span><span >iterStep = 1:nodeCnt</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% At each iteration identify the current node to process that </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% is not yet visited and has the smallest distance from the start.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% This breadth first search ensures that we will always reach nodes</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% by the shortest possible path.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        min = max;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        nodeIdx = -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">for </span><span >v = 1:n</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #0e00ff;">if </span><span >~visited(v) &amp;&amp; distance(v) &lt;= min</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                min = distance(v);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                nodeIdx = v;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% Stop iterating when the current distance is maximum because</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% this indicates no remaining nodes are reachable</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">if </span><span >(min==max)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #0e00ff;">return</span><span >;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% Mark the current node visited and check if this is end index</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        visited(nodeIdx) = true;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">if </span><span >nodeIdx == endIdx</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            pathLength = distance(nodeIdx);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #0e00ff;">if </span><span >(pathLength==realmax)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                </span><span style="color: #008013;">% No path exists so set distance to -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                pathLength = -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #0e00ff;">return</span><span >;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% Update distances of unvisited nodes adjacent to the current node </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">for </span><span >v = 1:nodeCnt</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #0e00ff;">if</span><span >(~visited(v) &amp;&amp; adjMatrix(nodeIdx, v) ~= 0 &amp;&amp; distance(nodeIdx) ~= max)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                distVal = distance(nodeIdx) + adjMatrix(nodeIdx, v);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                </span><span style="color: #0e00ff;">if </span><span >distVal &lt; distance(v)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                    distance(v) = distVal;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">function </span><span >out = isNodeValid(node)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% For full coverage we need to create negative tests that make each</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% successively make each validity condition false</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if</span><span >(isscalar(node) &amp;&amp; isnumeric(node) &amp;&amp; ~isinf(node) &amp;&amp; floor(node) == node)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        out = true;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">else</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        out = false;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">function </span><span >out = isAdjMatrixValid(adjMatrix)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% need to be a square matrix with only 0, 1, or realmax entries. </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    [m, n] = size(adjMatrix);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% For full coverage we need to create negative tests that make each</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% successively make each validity condition false</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">if </span><span >(m==n) &amp;&amp; isempty(find((adjMatrix ~= 0) &amp; (adjMatrix ~= 1), 1))</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        out = true;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">else</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        out = false;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><h3  style = 'margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; '><span>tMATLABTests</span></h3><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">classdef </span><span >tMATLABTests &lt; tCommon</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #008013;">% Copyright 2021 The MathWorks, Inc.</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods </span><span >(Test,TestTags=</span><span style="color: #a709f5;">"InputTests"</span><span >)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_invalid_start_1(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_straight_seq();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 2;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -199;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Invalid start index, idx&lt;1'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_invalid_start_2(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_straight_seq();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 12;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 2;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -99;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Invalid start index, idx&gt;NodeCnt'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_invalid_end_1(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_straight_seq();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = -3;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -199;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Invalid end index, idx&lt;1'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_invalid_end_2(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_straight_seq();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 12;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -99;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Invalid end index, idx&gt;NodeCnt'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods</span><span >(Test,TestTags=</span><span style="color: #a709f5;">"EdgelessTests"</span><span >)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_edgeless_graph(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = zeros(20,20);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 18;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Edgeless graph'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_edgeless_start(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_some_nodes_edgeless();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 4;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Edgeless graph'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_edgeless_end(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_some_nodes_edgeless();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 3;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Edgeless graph'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_edgeless_graph_self_loop(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = zeros(20,20);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 16;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 16;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = 0;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Self loop in edgeless graph'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods </span><span >(Test)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_longest_path(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_straight_seq();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 4;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = 3;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Longest theoretic path'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_unity_path(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_all_edge();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 2;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 3;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Path length 1'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_non_unique(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_square();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 4;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 2;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = 2;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Non-unique path'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_no_path(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_disconnected_components();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 5;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'No path'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_start_end_same(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = testCase.graph_all_edge();</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 3;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 3;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = 0;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Start and end index same'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >check_invalid_idx_empty_adj(testCase)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adjMatrix = [];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            startIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            endIdx = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            expOut = -99;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            verifyPathLength(testCase, adjMatrix, startIdx, endIdx, expOut, </span><span style="color: #a709f5;">'Degenerate empty graph'</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods </span><span >(Static)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #008013;">% Utility functions to create common adjacency graph matrices</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >adj = graph_straight_seq()</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Create the graph:</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% 1---2---3---4</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adj = [0 1 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                1 0 1 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 1 0 1; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 0 1 0];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >adj = graph_square()</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Create the graph:</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%   1---2</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%   |   |</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%   4---3</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adj = [0 1 0 1; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                1 0 1 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 1 0 1; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                1 0 1 0];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >adj = graph_all_edge()</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Create the graph:</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%   1---2</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%   |\ /|</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%   |/ \|</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%   4---3</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adj = [0 1 1 1; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                1 0 1 1; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                1 1 0 1; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                1 1 1 0];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >adj = graph_disconnected_components()</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Create the graph:</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%     2         5</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%    / \       / \</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%   1---3     4---6</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adj = [0 1 1 0 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                1 0 1 0 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                1 1 0 0 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 0 0 0 1 1; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 0 0 1 0 1; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 0 0 1 1 0];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >adj = graph_some_nodes_edgeless()</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Create the graph:</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%          2</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%         / \</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%        4---3</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">%     Nodes 1, 5, 6 are edgeless</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            adj = [0 0 0 0 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 0 1 1 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 1 0 1 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 1 1 0 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 0 0 0 0 0; </span><span style="color: #0e00ff;">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >                0 0 0 0 0 0];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">methods</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">function </span><span >verifyPathLength(testCase,adjacency,startIdx,endIdx,expectedResult,debugTxt)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Execute the design</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            actualResult = shortestPath(adjacency, startIdx, endIdx);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span><span style="color: #008013;">% Confirm the expected</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            msgTxt = sprintf(</span><span style="color: #a709f5;">'Failure context: %s'</span><span >, debugTxt);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            testCase.verifyEqual(actualResult, expectedResult, msgTxt);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >            </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: #0e00ff;">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: #0e00ff;">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '></div>
</div><script type="text/javascript">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script>]]></content:encoded>
					
					<wfw:commentRss>https://blogs.mathworks.com/developer/2023/10/26/equivalence-testing/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
