Test

Test 용어 정리

ch-yang 2023. 2. 14. 23:51

SUT - System under test

출처 : http://xunitpatterns.com/SUT.html
The "system under test". It is short for "whatever thing we are testing" and is always defined from the perspective of the test. When we are writing unit tests the system under test (SUT) is whatever class (a.k.a. CUT), object (a.k.a. OUT) or method(s) (a.k.a. MUT) we are testing; when we are writing customer tests, the SUT is probably the entire application (a.k.a. AUT) or at least a major subsystem of it. The parts of the application that we are not verifying in this particular test may still be involved as a depended-on component (DOC).

"Whatever Thing we are testing" 의 줄임말이며 항상 테스트의 관점에서 정의된다. 단위 테스트를 작성할 때 SUT의 대상은 우리가 테스트하는 클래스 (CUT), 객체 (OUT), 메서드 (MUT)가 될 수 있다.

Test Double

출처 : https://martinfowler.com/bliki/TestDouble.html
참고 : http://xunitpatterns.com/Test%20Double.html
Gerard Meszaros is working on a book to capture patterns for using the various Xunit frameworks. One of the awkward things he's run into is the various names for stubs, mocks, fakes, dummies, and other things that people use to stub out parts of a system for testing. To deal with this he's come up with his own vocabulary which I think is worth spreading further.
The generic term he uses is a Test Double (think stunt double). Test Double is a generic term for any case where you replace a production object for testing purposes. There are various kinds of double that Gerard lists:

Test Double은 테스트 목적으로 production object를 교체하는 모든 경우에 대한 일반적인 용어이다. Test Double으로는 Dummy, Fake, Stubs, Spies, Mocks가 있다.

  • Dummy Object : 일반적으로 매개변수 목록을 채우는 데만 사용되고, 실제로는 사용되지 않는다.
  • Fake Object : 실제 작동하는 구현체가 있지만, 테스트 용도로 단순화하여 구현한 객체.
    예) RDB를 사용하지 않고, Map에 저장하도록 단순화한 Repository
  • Stubs Object : 테스트 중에 만들어진 호출에 대한 미리 준비된 답변을 제공하고, 일반적으로 테스트 용도 이외의 호출에는 전혀 응답하지 않는다.
  • Spy Object : 호출 방법에 따라 일부 정보를 기록하는 Stubs. (Stubs + 특정 기록)
    예) 전송 된 메시지 수를 기록하는 이메일 서비스의 Stubs
  • Mock Object : 호출에 대해 기대되는 응답을 사전에 구현한 객체. 예상한 응답을 받지 못하면 예외를 던지거나, 예상된 모든 응답을 받았는지 확인한다.

'Test' 카테고리의 다른 글

Fake Double로 대체해서 테스트하는 방법  (0) 2023.03.17
단위 테스트 - 마틴 파울러  (0) 2023.02.15
테스트 관련 사이트  (0) 2023.02.14