Data Flow Testing

데이터 흐름 테스팅 (Data Flow Testing) 데이터 흐름 테스팅은 프로그램에서 변수의 정의와 사용 위치에 초점을 맞춰 테스트 케이스를 설계하고 실행하는 기법이다. 이 방법은 데이터가 프로그램 내에서 어떻게 생성되고 전달되는지를 확인하는 데 중점을 둔다. 데이터 흐름에서 발생할 수 있는 주요 활동들: 정의(Definition): 변수에 값이 할당되는 지점 사용(Use): 변수의 값이 읽히는 지점 계산용(Computational use): 다른 값을 계산하는데 사용 조건용(Predicate use): 조건문에서 사용 예제 코드를 통한 데이터 흐름: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 def calculate_final_price(base_price, quantity): # 변수 정의(Definition) discount = 0 # 조건용 사용(Predicate use) if quantity > 10: # 변수 정의(Definition) discount = 0.1 elif quantity > 5: discount = 0.05 # 계산용 사용(Computational use) final_price = base_price * quantity * (1 - discount) return final_price 이 코드에서 discount 변수의 데이터 흐름을 분석해보면: ...

November 1, 2024 · 4 min · Me