- If possible, remove dependencies between test cases, such as global variables.
- If global variables are present:
- You should explicitly set their values as part of your test inputs or within test setup routines. By default, these values are not set, so you must initialize them manually. This process is outlined in the following documentation: Set Global Variables Before Test in Polyspace Platform User Interface and Reset Afterwards.
- You can also optionally use test teardown to reset global or static variables as needed.
- If you require a specific sequence of steps, use test steps within a test case rather than relying on Test Suite execution order, as specified in Write Multi-Step Tests in Polyspace Platform User Interface.
- For testing with generated code, do not modify the generated code, as the test itself should manage independence.
How should I maintain independent test cases in MATLAB Polyspace Test?
조회 수: 2 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2025년 9월 15일
답변: MathWorks Support Team
2025년 10월 24일 14:00
I am trying to ensure that my testing results do not rely on the execution order of my test cases. What are some best practices for independent testing in MATLAB Polyspace Test?
채택된 답변
MathWorks Support Team
2025년 9월 15일
To ensure test case independence, here are some recommended guidelines to follow when designing your test cases:
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Author Tests Using C/C++ xUnit API에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!