Check code compatibility with older releases

48 visualizzazioni (ultimi 30 giorni)
Hi, I am wondering if there is a more or less efficient way to check backwards compatibility. Here is an example: I am using this code in R2023a:
roi = images.roi.Rectangle;
roi.EdgeAlpha=0.75;
roi.FaceAlpha=0.05;
roi.LabelVisible = 'on';
roi.Tag = 'RegionOfInterest';
But a user reports problems with R2019b, ROI.EdgeAlpha doesn't exist yet in this release. I searched MATLAB help to find any info in which release this property was added, but I can't find any information. This has happened relatively often, and I wonder what I am doing wrong. How can I find information about properties that are missing in older releases? Thanks!

Risposta accettata

John D'Errico
John D'Errico il 11 Feb 2024
Modificato: John D'Errico il 11 Feb 2024
A way to automatically check code compatibility with older releases, and see at what point a feature that you use makes your code not backwards compatible? No. Sorry.
You would need to have those older releases installed on your computer. That is possible to some extent, as long as they themselves will launch on your computer.
Even then, you would need to have test suites for your code that will test all possible paths through your code, to insure that every possible feature in your code is fully verified. Few authors do that as it is anyway. I often try, but I'll admit that my own set of tests surely miss some things. True perfection is difficult to achieve.
Even that fails however. For example, older releases of MATLAB will not run at all on newer computers. This is due to many things, generally not anything under the control of The MathWorks. So you might have some feature in your code that is viable in an older release, but you will not be able to test that older release, because something else prohibits your computer from running that release at all. And that would force you to maintain multiple older computers at your site, just to test code compatibility. And then you need to deal with issues of different manufacturers, completely different operating systems. Mac versus Windows, etc.
Sorry. If you want to know if something will fail, you will need to read the release notes diligently. Simpler yet, just wait for reports to filter in, that something failed. But there is no direct, magical, automatic way to do what you wish to see.

Più risposte (1)

Karl
Karl il 11 Feb 2024
Modificato: Karl il 11 Feb 2024
  1 Commento
William Thielicke
William Thielicke il 11 Feb 2024
I tried this with R2019b. It doesn't detect another incompatibility:
Unrecognized property 'LabelAlpha' for class 'images.roi.Polyline'.
Error in PIVlab_GUI>extract_draw_extraction_coordinates_Callback (line 4460)
extract_poly.LabelAlpha = 0.5;
So it is actually completely useless.

Accedi per commentare.

Categorie

Scopri di più su Programming in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by