How to organize program files in OOP with classes and tests?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi guys,
I am creating a simulator in OOP, including many classes and corresponding tests, using the Unit-Test framework.
(Test are made using classes too)
I have something like this in the directory:
root/
@MAC/
MAC.m
f_mac1.m
f_mac2.m
tests/
test1.m
@PHY
...
I don't need to export my code, or share it.
How can i organize my files in the best within OOP paradigm?
I have read this: https://nl.mathworks.com/matlabcentral/answers/350269-how-should-i-organize-my-matlab-files, but it's too generic.
Where shall I place tests and, how to call the tests, that are testing a given class?
Shall I use the @, or not?
What should be in the Matlab path?
I am getting strange errors about name mismatching.
Thank you
Marco
댓글 수: 0
답변 (2개)
Udit06
2023년 8월 25일
Hi Marco,
You can refer to the Class and Package Folders section from Class File Organisation MATLAB documentation to understand how to organize program files in OOP with classes and tests.
I hope this helps.
댓글 수: 0
Ayush Anand
2023년 8월 29일
편집: Ayush Anand
2023년 8월 29일
Hello Marco,
I understand that you want to know more about how to organize files in accordance with the OOP paradigm including classes and tests.
You can refer to the following pages for understanding how to organize your files in accordance with the OOP paradigm:
- https://in.mathworks.com/help/matlab/object-oriented-programming.html: This documentation provides an overview of OOP concepts in MATLAB, including class organization, file organization, and packages.
- https://in.mathworks.com/help/matlab/matlab_oop/scoping-classes-with-packages.html :This page explains how to use packages to organize related classes and control access to class members.
- https://in.mathworks.com/help/matlab/class-definition-and-organization.html: This page provides guidelines for organizing classes, including file naming conventions and folder structures.
I hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Software Development Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!