Automated unit testing techniques like concolic unit testing improve the benefits of unit testing through diverse unit test executions. However, current automated unit testing techniques do not utilize valuable information on dynamic unit contexts (DUCs) (i.e., values of all parameters and global variables read by a target function) in system tests due to the technical difficulty to extract them from system tests.
I have developed a new concolic unit testing framework $CUT^2$ for complex C programs. First, $CUT^2$ instruments a target program P to insert probes that capture/carve DUCs of f for system tests. Second, $CUT^2$ carves DUCs of f while executing the instrumented target program with system tests. At this step, to carve DUCs of f accurately, $CUT^2$ carves not only parameters of f but also global variables updated by f and f's descendant functions. Third, $CUT^2$ generates a symbolic test driver and stubs that build symbolic search space based on the carved DUCs of f and performs concolic unit testing on f using the carved DUCs as initial test inputs for f.
In the experiments on CoREBench, $CUT^2$ achieves around 90% branch coverage on average, which is at lease 10.9%p higher than the existing concolic unit testing techniques on average.
Concolic 테스팅과 같은 자동 유닛 테스팅 기술은 다양한 유닛 테스트 실행을 통해 유닛 테스팅의 이점을 향상시킨다. 그러나, 현재의 자동 유닛 테스팅 기술은 기술적인 한계로 인해 시스템 테스트로부터 동적 유닛 컨텍스트(목적 함수가 읽는 모든 전역 변수 및 함수 인자의 값)를 추출해내지 못하고, 이에 담긴 정보를 활용하지 못하고 있다.
이를 해결하기 위해 복잡한 C 프로그램을 위한 새로운 Concolic 유닛 테스팅 도구인 $CUT^2$를 개발했다. 첫번째로, $CUT^2$는 시스템 테스트로부터 f의 동적 유닛 컨텍스트를 추출해내는 탐지 코드를 목적 프로그램 P에 삽입한다. 이후, $CUT^2$는 탐지 코드가 삽입된 프로그램을 시스템 테스트를 통해 실행하여 f의 동적 유닛 컨텍스트를 추출한다. 여기서 f의 동적 유닛 컨텍스트를 정확하게 추출하기 위해 $CUT^2$는 f의 인자 뿐만 아니라 f에 의해 호출되는 함수 및 f에서 읽히는 전역 변수도 추출해낸다. $CUT^2$는 추출된 f의 동적 유닛 컨텍스트를 기반으로 하여 심볼릭 테스트 드라이버 및 스텁을 생성하고 f의 동적 유닛 컨텍스트를 최초 입력값으로 하여 Concolic 테스팅을 수행한다.
CoREBench를 사용한 실험에서 $CUT^2$는 평균적으로 약 90%의 분기 커버리지를 달성하였으며 이는 기존의 Concolic 유닛 테스팅 기술에 비해 평균적으로 최소 10.9%p의 개선을 이뤄낸 것이다.