Main Content

이 페이지의 내용은 이전 릴리스에 관한 것입니다. 해당 영문 페이지는 최신 릴리스에서 제거되었습니다.

클래스 기반 단위 테스트

클래스 기반 테스트 작성하기. 테스트 파라미터화하기. 픽스처(Fixture) 적용하기. 테스트 선택하고 실행하기

xUnit 스타일 테스트를 작성하여 MATLAB® 코드의 출력값이 예상대로 표시되는지 확인합니다. 클래스 기반 단위 테스트를 사용하면 전체 단위 테스트 프레임워크 기능에 액세스할 수 있습니다. 예를 들어, 파라미터화된 테스트를 작성하거나, 테스트에 태그를 지정하거나, 공유 테스트 픽스처를 사용할 수 있습니다.

시작하려면 MATLAB에서 클래스 기반 단위 테스트 작성하기 항목과 클래스를 사용하여 간단한 테스트 케이스 작성하기 항목을 참조하십시오.

테스트 브라우저Run MATLAB tests and view results (R2023a 이후)

함수

runtestsRun set of tests
testsuiteCreate suite of tests
testrunnerCreate test runner (R2021a 이후)
run (TestSuite)Run test suite using default test runner
run (TestRunner)Run test suite
run (TestCase)Run tests corresponding to test case
runInParallelRun all tests in test suite in parallel

클래스

matlab.unittest.TestCaseSuperclass of all test classes
matlab.unittest.TestSuiteFundamental interface for grouping tests to run
matlab.unittest.TestSpecification of a single test
matlab.unittest.TestRunnerClass for running tests in unit testing framework
matlab.unittest.TestResultResult of running test suite

네임스페이스

matlab.unittestMATLAB 단위 테스트 프레임워크의 패키지 및 클래스 요약
matlab.unittest.qualificationsMATLAB 가설 검정 인터페이스의 클래스 요약
matlab.unittest.constraintsMATLAB 제약 조건 인터페이스의 클래스 요약
matlab.unittest.fixturesMATLAB 픽스처(Fixture) 인터페이스의 클래스 요약
matlab.unittest.parametersSummary of classes associated with MATLAB unit testing parameters
matlab.unittest.pluginsMATLAB 플러그인 인터페이스의 클래스 요약
matlab.unittest.selectorsSummary of classes in MATLAB selectors interface
Simulink.sdi.constraints.MatchesSignal시뮬레이션 데이터 인스펙터를 사용하여 시계열 데이터를 허용오차와 비교하는 제약 조건

도움말 항목

테스트 작성하기

파라미터화된 테스트 작성하기

테스트를 실행하고 결과 분석하기