본문 바로가기
정보관리기술사/SW 공학

테스트 커버리지

by 두음달인 2022. 10. 7.
반응형

테스트 커버리지블랙박스 테스트 접근법입니다.

코드 커버리지화이트박스 테스트 접근법입니다.

 

테스트 커버리지 (Test Coverage)

 

하나의 테스트 케이스 또는 테스트 케이스 집합에 의해 지정된
테스트 커버리지 항목을 얼마나 실행하였는지를 백분율로 표현한 정도

 

테스트 커버리지 주요 기법

 

※ V 모델에서 개발 단계에 따른

애플리케이션 테스트 단계 (단위 - 통합 - 시스템 - 인수 테스트, 단통시인)을 알면

암기하기가 좀 더 수월할 듯 합니다. 나중에 추가 포스팅 하겠습니다.

. Unit Testing (단위 테스트)
. Responsive Testing (반응형 테스트)
. Cross-Browser Testing (크로스 브라우저 테스트)
. Integration Testing (통합 테스트)
. Acceptance Testing (인수 테스트)

 

What is Test Coverage?

 

The first major differentiator of test coverage is unlike that of code coverage,

this is a black-box testing approach.

 

It primarily measures the number of tests that have been executed,

and whether the active test cases are covering

the maximum part of the numerous documents including

  • Functional Requirements Specifications (FRS)
  • Software Requirements Specifications (SRS)
  • User Requirements Specifications (URS)

After all the functionalities mentioned in the documents are executed,

test code has to be developed to validate the implemented product features.

The objective is to provide metrics on tests being executed on a software solution. 

 

Test coverage involves numerous testing techniques like

unit testing, responsive testing, cross-browser testing, integration testing and acceptance testing.

 

The evaluation and measurement of test coverage are then done

based on a number of features covered by the test code.

 

 

테스트 커버리지 유형

 

구분 설명
Requirement
Coverage
  - 가장 중요한 테스트 커버리지 유형으로 모든 사용자 요구사항 충족을 목표로 함
  - 소프트웨어, 시스템 사양서 기반의 기능 및 비기능 충족 정도 검증
  - 요구사항 문서의 최대 요구사항 범위 검증 목적
Risk
Coverage
  - 소프트웨어 응용 프로그램과 사용자에게 잠재적으로 위험할 수 있는
    항목을 식별하는 데 중점
Product
Coverage
  - 제품을 포괄적으로 다루고 복잡한 상황을 견딜 수 있는
    소프트웨어 제품의 강점을 검증
  - 핵심 목표는 제품이 극한 조건에서도 잘 작동하는지 테스트하는 것
Boundary Value
Coverage
  - 시스템에서 수많은 입력의 경계 값을 확인

 

Types of Test Coverage

When it comes to qualitative measurement of your application’s functionality

– various aspects form it together.

From functional requirements to system requirements and risk minimization,

here are the different types of test coverage:

 

  • Requirement coverage: The most important test coverage is requirement coverage and it aims at catering to all the user requirements. 
  • Risk coverage: It is centred around identifying things that can potentially be risky for the software application and the users. Risk coverage is entirely dependent on the type of application you are developing.
  • Product coverage: It comprehensively covers the product and validates the software product’s strength to withstand complex situations. The core objective is to test if the product works fine in extreme conditions too
  • Boundary value coverage: Can you recall the boundary value analysis in testing? This type of test coverage verifies the system for boundary values in numerous inputs. Ideally, the boundary value coverage should be combined with other types of test coverage as the last thing you would want is your software accepting figures it strictly should not.

 

 

테스트 커버리지 이점

 

테스트 커버리지는 소프트웨어 구성 요소의 기능적 효율성을 측정하는 데 꼭 필요한 중요한 측정 기준입니다.

테스트되지 않은 코드 구성 요소 식별 

 

테스트 커버리지는 다양한 관련 테스트 케이스에서 지시하지 않은 코드베이스 부분을 발견하는 데 도움이 됩니다.


개발자가 새로운 테스트 케이스를 설계하도록 지원 

 

전체 테스트 커버리지를 최적화하기 위해 기존 테스트 커버리지에서 분석할 수 있는 요구 사항을 기반으로 새 테스트 케이스를 생성할 수 있습니다.


중복 테스트 케이스 감지 

 

새로운 테스트 케이스 제안과 함께 테스트 커버리지 분석은 현재 요구 사항 세트에서 활용되지 않는 쓸모없는 테스트 케이스를 감지하는 데 도움이 됩니다. 이러한 테스트 케이스를 제거하고 코드를 개선할 수 있습니다.

Advantages of Test Coverage

Test coverage is a valuable metric that caters to the much-needed measurement of functional efficiency of software components. Here are the top benefits of test coverage:

 

  • Identification of untested code components: Test coverage helps you discover parts of the codebase that have not been directed by various relevant test cases.
  • Helps developers design new test cases: To optimize the overall test coverage, you can create new test cases based on requirements that can be analyzed from the existing test coverage. 
  • Detection of redundant test cases: Along with suggesting new test cases, the analysis of test coverage will also help you detect useless test cases that aren’t utilized in the current set of requirements. So that you can eliminate those test cases and improve the code.

 

테스트 커버리지 vs. 코드 커버리지

 

테스트 커버리지

  • 전체 테스트 케이스 중 실행된 테스트 케이스의 비율(테스트 범위)을 뜻한다.
  • 100개의 테스트 케이스 중 70개의 테스트 케이스만 실행되었을 때, 테스트 커버리지는 70%가 된다.

코드 커버리지

  • 코드를 테스트하는 동안 애플리케이션의 소스코드가 실행되는 정도를 나타내는 척도이다.
  • 100 줄의 코드 중 70 줄의 코드만 테스트에 의해 실행되었을 때, 코드 커버리지는 70%가 된다.

 

참고 자료

 

sunhodev - 테스트 코드: 코드 커버리지, 테스트 커버리지

 

💻 sunhodev

테스트 코드: 코드 커버리지, 테스트 커버리지, Node.js, testcoverage, Node.js

www.sunhodev.com

 

꼭 한번 읽어보시길 권고 드립니다. ↓

 

Code Coverage vs Test Coverage: Differences You Need to Know in 2022 | Testsigma

 

Code Coverage vs Test Coverage: Differences You Need to Know

Code coverage is a quantitative measure and related to the white-box testing technique. And test coverage is a qualitative measure and a black-box testing approach.

testsigma.com

 

반응형

댓글