프로그래밍 언어와 프로그램 오류 자동 검출 기술 automatic technology for...
DESCRIPTION
프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing. 이광근 교수 Programming Research Laboratory ropas.snu.ac.kr 11/07/2007 @ POSTECH CSE Seminar. Content. What Challenges Us & How We Responded Within SW Technology Within Programming Language Technology - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/1.jpg)
프로그래밍 언어와 프로그램 오류 자동 검출 기술
Automatic Technology for Detecting Fatal SW Errors Before
Testing
이광근 교수
Programming Research Laboratory ropas.snu.ac.kr
11/07/2007 @ POSTECH CSE Seminar
![Page 2: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/2.jpg)
Content
What Challenges Us & How We Responded Within SW Technology Within Programming Language Technology
What An Exciting Opportunities Ahead!
![Page 3: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/3.jpg)
Is CSE Advanced?How Much?
![Page 4: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/4.jpg)
CSE Is NOT Advanced At All
![Page 5: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/5.jpg)
컴퓨터 하드웨어의 발전속도 ?
1946 ENIAC 1997 Intel Teraflops2002 IBM ASCI White
flops flops
![Page 6: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/6.jpg)
다른 분야의 발전속도도
비슷했습니다
![Page 7: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/7.jpg)
에너지1980 년원자력발전소 1 기
1899 년하인 1 명
hphp
![Page 8: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/8.jpg)
교통
가마 Boeing Delta-II Rocket
j j
![Page 9: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/9.jpg)
SWs Are Everywhere
So, We Are As Advanced As Othe
r Disciplines?
No, Fortunately.
![Page 10: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/10.jpg)
소프트웨어 기술의 발전은 얼마나 느린가 ?
Open Problem:작성한 소프트웨어가 제대로 실행될 지를
미리 엄밀하게 확인하는 방법은 ?
다른 분야에서는 이미 푼 문제 : 기계공학 : 제대로 작동할 지를 미리 검증할 수 있는 기계설계 건축공학 : 제대로 서 있을 지를 미리 검증할 수 있는 건축설계 화학공학 : 제대로 진행될 지를 미리 검증할 수 있는 공정설계 전자공학 : 제대로 작동할 지를 미리 검증할 수 있는 회로 설계 뉴튼역학 , 미적분 방정식 , 통계역학 , XX 이론 , XX 방정식 등등
![Page 11: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/11.jpg)
SW Bugs Are Everywhere
WE Should Provide A Solution
![Page 12: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/12.jpg)
소프트웨어 오류 자동 검출의 발달과정 3 박자
1. 오류의 정의 (logic)2. 검증방법 고안 (logic)3. 그 방법을 구현 (logic and computation)
오류 자동 검출 방법의 연구 = 3 박자의 반복된 발전과정
![Page 13: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/13.jpg)
오류 자동 검출 프로그램 : 1 세대문법 검증기 : lexical analyzer & parser (80 년대 초에 완성 )1. 오류 = 프로그램 생김새 틀린것 “{intt x = 8*) }”2.3. 100% 검증 : 오류없슴 <=> 문법이 맞음
![Page 14: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/14.jpg)
오류 자동 검출 프로그램 : 2 세대타입 검증기 : type checker (30 년 PL 분야의 결실 )
1. 오류 = 타입에 어긋나게 실행된다 “ free(1);”2. Thm. “ 검증됨” (logic) => “ 오류없슴”3. Thm. “ 검증됨” (logic) <=> “YES”(computation)
• 효과적인 검증기 (10000 lines/sec)• 전자동• higher-order & typed(HOT) languages: ML, Haskell• v.s. C, C++, Java, Python
![Page 15: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/15.jpg)
오류 자동 검출 프로그램 : 3 세대프로그램분석기 : static program analysis (2000 년이
후 )
1. 오류 = 타입보다 더 정교한 오류 “ 라면끓이기 ( 신 , 물 , 불 );”2. Thm. “ 검증됨” (logic) => “ 오류없슴”3. Thm. “ 검증됨” (logic) <= “YES”(computation)
• 현재성능 (10-10000lines/sec)• 전자동
![Page 16: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/16.jpg)
Open Problem
소프트웨어가 실행되기 전에 우리가 바라는대로 실행될 지를
no core dump/segmentation fault no buffer overrun no memory leak “x.s > 0 at line 321” “notNull(y) whenever x = 0” etc.
엄밀하게 미리 확인해주는 기술은 ?
![Page 17: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/17.jpg)
3rd Gen. Solution:Static Program Analysis
프로그램의 실행 내용을실행전에 자동으로안전하게 어림잡는
일반적인 기술
“static analysis” “ 정적분석” “프로그램분석”
![Page 18: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/18.jpg)
“ 실행전” : 프로그램을 실행시키지 않고 “ 자동으로” : 프로그램이 프로그램을 분석 “ 안전하게” : 모든 가능성을 포섭 “ 어림잡는” : 실제 이외의 것들이 포함됨
어림잡지 않으면 불가능 “ 일반적” : 소스 언어와 분석가능한 성질이
무제한 C, C++, C#, Java, ML, UML, JVM, x86, bits, etc. buffer overrun? memory leak? x=y at line 2? notNull(x) whenever y.s=0?
![Page 19: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/19.jpg)
테스트와 다른점
테스트는 SW 를 실행시킬 수 있을 때 까지 기다려야
테스트는 찾고자 하는 오류를 모두 찾을 수 없음
프로그램 분석기 (static program analyzer) 는 SW 를 실행시키지 않고 타겟 오류의 위치를
자동으로 찾아줌 SW 의 소스만 준비되면 됨
![Page 20: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/20.jpg)
정적분석이론
대상 언어 L 디자인
분석기 : L_PGM --> 분석결과 모든 L 프로그램 pgm 에 대해서 모든실행성질 (pgm) < 분석기 (pgm)
구현 많은 엔지니어링 : cost-accuracy tradeoff, scalabili
ty ropas.snu.ac.kr/~kwang/4541.664A/07
![Page 21: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/21.jpg)
SW 오류 검증 기술의 진화
1990s 2000
s
1980
s
효용
및
성숙도
2010
s
테스트기술
정적분석기
술coverity.compolyspace.com
Sparrow 1.0
자동증명기
술
![Page 22: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/22.jpg)
![Page 23: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/23.jpg)
Sparrow 1.0
이론 : Semantic-based Static Analysis 타겟 소스언어
C, C++ ANSI, GNU, MS, ARM, etc.
타겟 오류 buffer overrun memory leak uninitialized access
![Page 24: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/24.jpg)
spa-arrow.com
![Page 25: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/25.jpg)
![Page 26: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/26.jpg)
![Page 27: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/27.jpg)
Other Players coverity.com
Stanford U., 미국시장에서 활발 , ’05 국내 진출 polyspace.com
Ecole Polytech., 유럽시장에서 활발 , ’06 국내 진출 grammatech.com
U. of Wisconsin-Madison, 미국정부시장 , ’07 국내 진출 기타 ( 분석기술 미흡 : “shallow” analysis)
fortify, klocwork, secure, seque, wily 기존의 runtime tools
상용 PurifyPlus, Parasoft Insure++, Trace32, WinDBG, …
공개 SW Valgrind …
![Page 28: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/28.jpg)
BMT Results (by S company) S 사 내부 소스코드 오류분석의 BMT 결과 총 약 200 만 라인 C 코드 분석 Sparrow 만 찾을 수 있는 오류 다수 존재
19
11
7 23
611
찾은 실제 오류의 수
Sparro
w
Prevent
K7
![Page 29: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/29.jpg)
BMT Results (by D company)
약 70 만 라인 상용 OS source (Linux-base)
buffer overrun memory leak
22 24 25 69 75 81
CodeSonar Sparrow SparrowCodeSonar
![Page 30: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/30.jpg)
BMT Result (Open Source)
![Page 31: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/31.jpg)
SW 오류 검증 기술의 진화
1990s 2000
s
1980
s
효용
및
성숙도
2010
s
테스트기술
정적분석기
술coverity.compolyspace.com
Sparrow 1.0
자동증명기
술
![Page 32: 프로그래밍 언어와 프로그램 오류 자동 검출 기술 Automatic Technology for Detecting Fatal SW Errors Before Testing](https://reader035.vdocuments.mx/reader035/viewer/2022062422/5681401e550346895dab7475/html5/thumbnails/32.jpg)
Thank You
QnA
ropas.snu.ac.kr