cs453: software verification techniques -...

19
1 CS453: Software Verification Techniques Moonzoo Kim Provable Software Laboratory CS Dept. KAIST

Upload: others

Post on 12-Mar-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

1

CS453: Software Verification Techniques

Moonzoo KimProvable Software Laboratory

CS Dept. KAIST

Page 2: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Role of S/W: Increased in Everywhere

2자료출처: Watts Humphrey 2002

F-4

F-22

0

10

20

30

40

50

60

70

80

90

1960년 1970년 1982년 2000년

Per

cent

of f

unct

ionalit

y pr

ovid

ed b

y

softw

are

Year of introduction

Page 3: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST3

Motivation: Poor Quality of SW

Page 4: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST4

Master

Backup Master

Slave

Slave

Page 5: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST5

• SW developers have to follow scientific disciplines for building and analyzing software with high quality– This class focuses on the analysis activities

Current Practice for SW

Page 6: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST6

Software Development Cycle

A SW Development Framework for SW with High Assurance

Formalrequire-

mentSpec.

Formalsystem

modeling verification

Model analysis/

verification generation

Model-assisted

codegeneration

Model-basedtesting

monitoring Runtime

monitoring and

checking

Systemdesign

Requirementanalysis

Design analysis

Implement-ation

Testing Monitoring

• A practical end-to-end formal framework for software development

Page 7: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST7

• Embedded systems where highly reliable SW technology is a key to the success – The portion of SW in commercial embedded devices increases

continuously– More than 50% of development time is spent on SW testing and

debugging

Home Network Intelligent Mobile Systems

Highly Reliable Systems

Intelligent Medical Devices

Main Target Systems

Home Service Robots

Page 8: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

How to Improve the Quality of SW1. Systematic testing

– Coverage criteria– Mutation analysis

2. Debugging through automated analysis tools– Scientific treatment of SW with computing power– Useful tools are available

3. Formal verification– Guarantee the absence of bugs!!!

8

Page 9: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Questions???• Is formal analysis really feasible in

industry?– Yes, several case studies even in Korea

• Is formal analysis academically significant?– Yes, 3 Turing awardees in ‘07

• Is formal analysis too hard to learn and use?– No, there are tools available

9

Page 10: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST10

Verification of High-Availability Protocol

• We develop a formal model of high-availability protocol used in commercial security appliances – HA protocol coordinates a group of firewalls

• We found several problems in HA regarding a master election procedure

Master

Backup Master

Slave

Slave

Page 11: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST11

Designed for providing various services to human user- Service areas : home security, patient caring, cleaning, etc

Home Service Robot

Page 12: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST12

OneNAND® Flash Memory Verification

OneNAND® Flash Memory Devices

Low Level (LLD) Device Driver

Block Management (BML)

Sector Translation (STL)

Demand Paging

Manager (DPM)

OS Adapt-ation

Module

Unified Storage Platform

App1 App2 App3

Source: Software Center of Samsung Electronics ‘06

• Each memory cell can be written limited number of times only

• XIP by emulating NOR interface through demand-paging scheme

• Performance enhancement

Flash Translation

Layer

FileSystem

Page 13: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Research Trends toward Quality Systems

• Academic research on developing embedded systems has reached stable stage– just adding a new function to a target system is not considered as an academic

contribution anymore• Research focus has moved on to the quality of the systems from the

mere functionalities of the systems– Energy efficient design, ez-maintenance, dynamic configuration, etc

• Software reliability is one of the highly pursued qualities – NSDI 2007 Best paper

• “Life, Death, and the Critical Transition: Finding Liveness Bugs in Systems Code” @ U.C. San Diego

– Heuristic application of model checking to detect liveness bug– OSDI 2004 Best paper

• “Using Model Checking to Find Serious File System Errors” @ Stanford– Application of software model checking to find FS bugs

13

Page 14: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Formal Verification as a Foundational and Promising CS Research

• 2007 ACM Turing Awardees– Prof. Edmund Clarke– Dr. Joseph Sipfakis– Prof. E. Allen Emerson

• For the contribution of migrating from pure research to industrial reality

• One of the four Microsoft Research main areas

14

Page 15: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Tool-based Interactive Learning• Model checker

– Explicit model checker: Spin home page

– Symbolic model checker: NuSMV home page

• Software model checker– Bounded model checker

for C program:CBMChome page

– Predicate abstraction for C program: BLAST home page

15

• Satisfiability solver– MiniSAT home page

• Satisfiability Module Solver– Yices home page– Z3 home page

• Concolic testing tools – CREST home page

• Formal proof – WHY home page

Page 16: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Class Schedule• wk1: overview on formal SW

analysis techniques • Wk2-3: conventional testing

techniques • wk4: background on

Propositional logic and SAT (Satisfiability) solvers

• wk5: SAT solver heuristic and tool application 1: MiniSAT

• wk6: background on First order logic

• wk7: Satisfiability Modulo Theory (SMT) basic

• wk8: midterm exam

16

• wk9: advanced application of SMT solvers

• wk10: directed automated random testing

• wk11: tool application : CREST• wk12: basic temporal logic for r

equirement property • Wk13-14: tool application:

Spin & NuSMV• wk15: state space minimization

techniques • wk16: final exam

Page 17: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Administrative Stuff• Instructor: Prof. Moonzoo Kim• Class time: Tue/Thr 9:00 -10:30 AM• Office hour: TBD• Grade policy

– HW 50% – Attendance & quiz 20%– Mid exam 15%– Final exam 15%

• TA: Youngjoo Kim (Rm#2438)• Web page: http://pswlab.kaist.ac.kr

17

Page 18: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Final Remarks• For undergraduate students:

– Highly recommend URP studies or independent studies• Ex. 이준희 (05학번) got a silver award and macbook

air notebook ☺– Debugging Linux kernel through model checking

to detect concurrency bugs• Ex2. Nam Dang wrote down a paper on distributed

concolic testing– Y.Kim, M.Kim, N.Dang, Scalable Distributed

Concolic Testing: a Case Study on a Flash Storage Platform, Verified Software Track @ Intl. Conf. on Theoretical Aspects of Computing (ICTAC), Aug 2010

18

Page 19: CS453: Software Verification Techniques - KAISTswtv.kaist.ac.kr/courses/cs453-sw-verification-tech-fall-11/course_intro.pdfProvable SW Lab. 7 CS Dept. KAIST • Embedded systems where

Provable SW Lab.CS Dept. KAIST

Final Remarks• For graduate students:

– Welcome research discussions to apply formal analysis techniques

• Systematically debugging C programs • Concurrency bug detection• Model-based testing• Prove the correctness of algorithms, etc

19