CS458 Dynamic Analysis of Software Source Code, Fall 22
Announcement
- Dec 6:
- COVID-19 instruction for the final exam
- If you like CS458, you are recommended to take a URP or an independent study w/ me.
- Dec 2: Hyundai TaaS (Transportation as a Service @ Pangyo technovalley) SW developer & QA engineer job opening (to be closed at Dec 9)
- Nov 29: We have a makeup class on Dec 1 through Zoom
- Nov 14: We moved our Q&A channel from KLMS to CS458 github repo issues
- Sep 15:
- There will be 2022 Science Startup Show @ Daejeon DCC, Sep 21-22, 2022
- Sep 13:
- Sep 27 (Tues) class will be an on-line class due to 2022 KAIST Tech-Fair @ COEX
- We do not have a class at Oct 4 (Tues) per request of KAIST
- The first class starts at 2:30 - 3:45 PM Aug 30 (E3 Rm#2111)
- Tues classes will be face-to-face lectures and Thurs classes will be online one through Zoom ( https://kaist.zoom.us/j/5258253316 )
Administrative Information
- Instructor: Moonzoo Kim
Office: 2434 (located at the east wing)
Phone:042-350-3543
E-mail: moonzoo.kim @ gmail.com
Office hour: Tues 4:00-5:00 PM
(reservation e-mail is preferred)
- Teaching assistants: Ahcheong Lee (ahcheong.lee@gmail.com)
- Lecture hours: Tue/Thur 2:30 - 3:45 PM
- Lecture room: E3 Rm#2111 (and through Zoom)
- I plan to make a face-to-face lecture on Tues and an online lecture on Thurs
- the plan may change later depending on the academic performance of the class participants.
- Zoom link for Thurs class: https://kaist.zoom.us/j/5258253316
- Prerequisite: proficiency in C/C++ programming and Linux utilities
- Due to the high load of TA, TA will not provide help for basic C/C++/Linux questions.
- Highly recommend to take CS458 after taking CS230 System Programming first
- Grading: attendance/class participation/quiz: 25%, HW: 50%, final exam:25%
- You should turn on your web cam when you participate an online class; class attendance will not be counted otherwise.
- Late HW will be accepted with 10% penalty of the max score in 1 day, 30% penalty of the max score in 3 days. HW will not be accepted after then.
- Hint: many questions of exams are from the homework.
- All programming HWs you submit must be able to be replayed by executing a single script file on a TA's server account (i.e., submitted HW should not have a dependency on your home directory, environment, etc.). Also, the replayed execution must demonstrate the same output to the submitted hw. You will get 10% penalty of the max score otherwise.
- For your programming HWs, you should not use external libraries which are not available on the server machines. If you really need an external library, you have to ask TAs to install it on the server machines.
- More than 7 absences of the class will get F grade
- Late attendance shall be counted as 1/3 absence.
- If a student is not able to attend a class due to an important event (e.g., attending conf., etc.), he/she should submit 1 week prior notice to the professor.
- The official language in the class is English. All students should submit all written documents such as homework, project reports, exam, etc. in English; 20% penalty of the max score otherwise.
- Questions and answers can be done through KLMS
- Excerpts from 강의평가
- "실질적으로 써먹을 수 있는 내용을 많이 배워서 보람찼습니다"
- "과제가 많이 어려운것 같았다. 과제에 대한 도움을 수업에서 좀 더 주었으면 좋겠다."
Syllabus
This class covers automated SW testing/verification techniques to detect SW bugs effectively and efficiently. In particular, this class focuses to teach techniques that automatically generate test cases to achieve high code coverage and, thus, to detect many bugs.
The class aims to teach practical applications of advanced testing/verification techniques as well as their underlying algorithms. This class guides students to use various open-source software testing/verification tools through HWs and learn the underlying mechanisms to maximize the performance of automated testing/verification.
Course Material
- Textbook
- "Introduction to Software Testing" by P.Ammann and J.Offutt. 2nd ed. Cambridge press 2017
- Reading list
- Dictionary for testing terms (한글, English)
- Beautiful Testing: Leading Professionals Reveal How They Improve Software (Theory in Practice) by Tim Riley and Adam Goucher
- 역사속의 소프트웨어 오류 by 김종하
- The Model Checker Spin by G.Holzmann
- Logic in Computer Science 2nd ed by M. Huth and M.RyanLyan
- Related tool list
Course Schedule
Part I: Overview of software complexity and testing
“Software testers do not make software; they only make them better.” – Anonymous
Aug 30 : Introduction [pdf]
Sep 1: Necessity for systematic & automated testing techniques [pdf]
- "Variability and Reproducibility in Software Engineering: A Study of Four Companies that Developed the Same System" by Anda et al.
IEEE Trans. on Software Engineering vol. 35, no. 3, pp. 407-429, May-June 2009.
Sep 6: Overview of testing techniques (including the input partitioning technique) [pdf]
Part II: Source code coverage criteria for effective SW debugging
“It’s hard enough to find an error in your code when you’re looking for it; it’s even harder when you’ve assumed your code is error-free.”— Steve McConnell
Sep 8, 13: Graph coverage [pdf]
- Intro to Software Testing web site
- '09 Intl. Conf. on Software Testing, Verification, and Validation Workshops
Sep 15: Graph coverage for source code [pdf]
- Generating CFG using GCC and Graphviz [pdf]
- http://www.webgraphviz.com/
- Cyclometic complexity (또다른 한글문서)
Sep 20: gcov tutorial [pdf], CLang tutorial 1/2: Clang AST [pdf]
Sep 22: Clang tutorial 2/2: a program analysis tool by using Clang [pdf]
Sep 27: Logic coverage [pdf]
Sep 29: Logic coverage from source code [pdf]
Oct 4: No class (requested by KAIST)
Oct 6 : Mutation testing [pdf], Q&A session for coverage guided whitebox testing
- "Design Of Mutant Operators For The C Programming Language" by Agrawal et al
Part III: Model checking and test oracles
Oct 11, 13: SAT-based bounded software model checking [pdf]
- The importance of unwinding loop bound: SAT-based Bounded Software Model Checking for Embedded Software: A Case Study, APSEC 2014 by Kim et al
Oct 18, 20: No class due to midterm exam
Oct 25, 27: Software model checking examples [pdf]
Nov 1: Model Checking flash memory storage platform software - an industrial case study
- "A Comparative Study of Software Model Checkers as Unit Testing Tools: An Industrial Case Study," IEEE Transactions on Software Engineering (TSE), vol 37, no 2, pages 146-160, March 2011
- "Formal Verification of a Flash Memory Device Driver- an Experience Report" Spin 2008, by M.Kim, Y.Kim, Y.Choi, and H.Kim
Nov 3: Verification of the multi-sector read of flash memory storage
Part IV: Concolic testing (a.k.a., dynamic symbolic execution)
Nov 8 : Automated SW analysis for high reliability: a Concolic testing approach
Nov 10: no class
Nov 15: no class
Nov 17: CROWN Tutorial
- triangle.c example
Nov 22, 24: CROWN Examples, compared to CBMC Memory Model, application of concolic testing to the circular queue example
Nov 29: System-level concolic testing: Busybox application examples through CROWN
Dec 1 (Makeup class 1): Automated unit testing, Unit-level concolic testing: Busybox ls example
Online makeup class 2 (pre-recorded movie clip):
- Automated Unit Testing of Large Industrial Embedded Software using Concolic Testing [ASE'13 paper] [Movie (40 min)]
- Concolic Testing for High Test Coverage and Reduced Human Effort in Automotive Industry [ICSE'19 paper] [Movie (35min)]
Part V: Verification engine - SAT/SMT solver
Dec 6: SMTlib tutorial, SMTlib web page, First order theories [pdf]
- SMTlib examples
- Examples of First Order Theories [pdf] (for concolic testing, UML OCL, JML, pre/post condition verification, etc)
- Definition of "theory"
- CS402 Intro to Logic (Predicate Calculus - Semantics)
- SMT-competition 2022
Dec 8: Using SAT solver for Sudoku, Q&A for the final exam, LLVM IR basics, CLANG vs LLVM
- "Sudoku as a SAT problem" by I.Lynce and J.Ouaknine, Intl. Symp. on Artificial Intelligence and Mathematics 2006
- The SuDoku Puzzle as a Satisfiability Problem
- SAT-competition 2022
Dec 15 (13:00~15:30): Final exam (closed book)
Homeworks
- You need to submit your code or answer via KLMS.
- You should use assigned ubuntu machine for programming HWs.
- TA had assigned machine via email, if you have any problem, please contact TA.
- ID: cs(your student #), initial password: cs(your student #)!!
- You have to change your password when you log-in first time.
- Note that your account will be deleted at the end of the semester. Don't forget to backup your own data
- If you have a question on your HW score, you should post your question on KLMS first.
- HW#1 (structural and dataflow coverage, 100 points): due Sep 22 (Thurs) 23:59
- HW#2 (coverage guided testing, 100 points): due Sep 29 (Thurs) 23:59
- grep-v2.0-simplified
- This grep code contains a single C file (grep.c) for convenient analysis (i.e., no build script, no need of analyzing separate source files, etc.)
- How to use grep:
- For user-friendly coverage analysis, you may use visual coverage report tool like lcov, gcovr, and grcov.
- Simply run "gcovr --html --html-detail -o index.html" to generate visual coverage report in index.html file
- HW#3 (source code branch coverage measuring tool using Clang, 200 points): due Oct 13 (Thurs) 23:59
- HW#4 (NPD check tool using Clang, 200 points): due Nov 8 (Tues) 23:59
- HW#5 (Verification of max heap algorithm, 100 points): due Nov 15 (Tues) 23:59
- HW#6 (Concolic testing of TCAS, 100 points): due Dec 6 (Tues) 23:59
- HW#7 (SMTlib 50 points): due Dec 11 (Sun) 23:59