How to Visualize the Quality of Your MATLAB Code
Visualize and measure MATLAB® code quality using the MATLAB Test™ Code Quality Dashboard feature. The MATLAB Code Quality Dashboard captures static code analysis, coverage, tests, and requirements metrics because you can only improve what you can clearly measure.
Published: 15 Feb 2023
MATLAB tests brings visibility to your MATLAB Code Quality through the Quality Dashboard. Providing an intuitive view of key metrics, the Quality Dashboard offers two unique values. One, the ability to have clear management-ready quality information about your project. And two, by providing a new style Find and Fix workflow between viewing metrics and easily drilling into source issues.
Quality metrics are managed on a per project basis and navigation is done through the Code Quality Dashboard icon in the tool strip. We can scroll through to see code analyzer metrics, coverage metrics, test metrics, and metrics for requirements linked to tests. Clicking the Code Analyzer section of the dashboard, we see a warning and two info alerts. The Fix All button will correct least quickly.
After updates and with a refresh, the Dashboard displays no new code issues. To demonstrate the Find and Fix iterative workflow concept further, let's scroll down to the Test section where we see 14% failed tests in the dashboard. When we click this section of the panel, the Test Manager shows us all tests. Fail Test diagnostics show we verify equal failure in the graph unit tests. Let's close this and fix the errors by navigating to the source code.
Once corrected, we can go back to the test panel with new options to verify our changes. From within the dashboard you have several verification options you can see. Once tests are rerun, the dashboard is updated showing all tests have passed.