Main Content

단위 테스트 실행하기

테스트 선택 및 실행, 테스트 실행기 사용자 지정, 테스트 및 커버리지 결과 분석

MATLAB® 편집기 또는 라이브 편집기나 테스트 브라우저 앱에서 대화형 방식으로 테스트를 실행합니다. 혹은 프로그래밍 방식으로, 예를 들어 runtests 함수를 사용하거나 matlab.unittest.TestSuite 클래스의 run 메서드를 사용하여 테스트를 실행합니다. 테스트를 병렬로 실행한다거나(Parallel Computing Toolbox™ 필요), 테스트 출력 정보의 표시 수준을 지정하는 등의 옵션을 지정하여 테스트 실행을 사용자 정의합니다. 테스트를 실행하는 동안 코드 커버리지 메트릭을 수집하고, 테스트 및 커버리지 결과를 분석합니다.

테스트 브라우저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.coverage.ResultResult of code coverage analysis (R2023a 이후)

네임스페이스

matlab.unittestMATLAB 단위 테스트 프레임워크의 클래스 및 네임스페이스 요약
matlab.unittest.pluginsMATLAB 플러그인 인터페이스의 클래스 요약
matlab.unittest.selectorsSummary of classes in MATLAB selectors interface

도움말 항목

테스트 실행하기

결과 분석하기