1 / 6

C 프로그램을 위한 동시성 커버리지 측정 기법

C 프로그램을 위한 동시성 커버리지 측정 기법. 송지영 SWTV KAIST. 동시성 VS 순차 커버리지. Test suite A. Test suite B. 1 : 2 : … 20 : …. 1 : 2 : … 20: …. 8 0%. 60%. 순차 프로그램과 다르게 동시성 프로그램은 스레드 스케줄링에 따라 결과가 다양한 output 을 가짐 그러므로 , 수행되는 코드뿐 아니라 스레드 인터리브도 커버리지 요구사항으로 고려해야 함. Motivation example.

Download Presentation

C 프로그램을 위한 동시성 커버리지 측정 기법

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. C 프로그램을 위한 동시성 커버리지 측정 기법 송지영 SWTV KAIST

  2. 동시성 VS 순차커버리지 Test suite A Test suite B 1 : 2 : … 20 : … 1 : 2 : … 20: … 80% 60% • 순차프로그램과 다르게 동시성 프로그램은 스레드 스케줄링에 따라 결과가 다양한 output을 가짐 • 그러므로, 수행되는 코드뿐 아니라 스레드인터리브도 커버리지 요구사항으로 고려해야 함 C 프로그램을 위한 동시성 커버리지 측정 기법

  3. Motivation example Initially, balance:10 -t1: withdraw(10) – 2 if(balance>=10) 3 t = balance 4 balance=t–10 -t2: withdraw(5) – 2 if(balance>=5) • 코드수행만을 요구사항으로 간주하면 100% 커버리지를 • 달성하여도 bug를 찾지 못하는 경우가 발생 • 다음 2 테스트케이스로 분기 커버리지 100% 달성 • Tc1: balance 10, withdraw(5) • Tc2: balance 5, withdraw(10) 1:void* withdraw(long x){ 2:if(balance >= x){ 3: t = balance; 4: balance = balance-x ; 5: } 6: } Initially, balance:10 -t2: withdraw(5) – 2 if(balance>=5) 3 t = balance 4 balance=t–5 -t1: withdraw(10) – 2 if(balance>=10) 3 t = balance 4 balance=t–10 -5? • 스레드인터리브도 커버리지 요구사항으로 고려해야 함 C 프로그램을 위한 동시성 커버리지 측정 기법

  4. 동시성 커버리지 측정기법 • Synchronization coverage: synchronization-pair Lock으로 각 스레드가 동기화되는 것을 확인하기 위해 사용 • Data access coverage: def-use • 공유변수 값을 정의하고 사용하는 위치를 확인하기 위해 사용 C 프로그램을 위한 동시성 커버리지 측정 기법

  5. Synchronization coverage • Synchronization-pair: • - 스레드인터리브가 발생할 때 lock으로 공유 변수를 동기화하기 위해 사용 • - coverage requirement는 code location 쌍 < > 이다 • - 과는같은 lock 을 가진 lock statement이며, • 는 의 lock이 unlock된 후 최초로 같은 lock 을 • hold하는 구문이다. --Thread1: foo()-- --Thread1: foo()-- --Thread1: foo()-- --Thread2: bar()-- --Thread2: bar()-- --Thread2: bar()-- Covered SPs: (11, 21), (21, 23) 11:pthread_mutex_lock(m); 12:pthread_mutex_unlock(m); 21:pthread_mutex_lock(m); 22:pthread_mutex_unlock(m); 21:pthread_mutex_lock(m); 23:pthread_mutex_unlock(m); 11:pthread_mutex_lock(m); 12:pthread_mutex_unlock(m); 23:pthread_mutex_lock(m); 24:pthread_mutex_unlock(m); (11, 21) iscovered 21:pthread_mutex_lock(m); 23:pthread_mutex_unlock(m); Uncovered SPs: (21, 11), (23, 11) 11:pthread_mutex_lock(m); 12:pthread_mutex_unlock(m); (21, 23) is covered 23:pthread_mutex_lock(m); 24:pthread_mutex_unlock(m); 23:pthread_mutex_lock(m); 24:pthread_mutex_unlock(m); C 프로그램을 위한 동시성 커버리지 측정 기법

  6. Future work • C/C++ 타겟코드의 정적 분석와 동적 분석을 통해 발생 가능한 커버리지 condition찾기 • 공유변수 찾기, lock의 포인터 변수 찾기 • Pbzip2, pfscan프로그램에 대해 테스트 수행 예정 C 프로그램을 위한 동시성 커버리지 측정 기법

More Related