| 研究生: |
楊權 Chuan Yang |
|---|---|
| 論文名稱: | A Testing and Debugging Tool for Arbitrary Interleaving on Multithreaded Programs Based on Debugger |
| 指導教授: |
鄭永斌
Yung-Pin Cheng |
| 口試委員: | |
| 學位類別: |
碩士 Master |
| 系所名稱: |
資訊電機學院 - 資訊工程學系 Department of Computer Science & Information Engineering |
| 論文出版年: | 2016 |
| 畢業學年度: | 104 |
| 語文別: | 中文 |
| 論文頁數: | 62 |
| 中文關鍵詞: | 多執行緒 、並行錯誤 、除錯 、測試 |
| 外文關鍵詞: | multi-thread, concurrency error, debugging, testing |
| 相關次數: | 點閱:13 下載:0 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
多執行緒程式在現今的軟體開發過程中幾乎難以避免,但如何設計出沒有錯誤的多執行緒程式,對開發者來說仍是一個困難的挑戰。因為多執行緒間的concurrency所引入的微妙錯誤往往需要特定的輸入及interleaving才能引發,這種nondeterminism讓引發與重現這種錯誤變得困難,進而導致了多執行緒程式不易測試與除錯的特性。
在除錯方面,儘管debugger是開發者用來除錯程式的主要工具,現有的debugger卻沒有針對重現interleaving的需求設計對應的功能。而測試concurrency error的研究雖然陸續有提出演算法及工具,來有效地探索interleaving空間以找出concurrency error,但其工具的使用往往受限於某些條件,例如相依於特定作業系統或高階語言虛擬機器,甚至必須動用昂貴的靜態分析技術。
本研究開發了一個具有彈性的多執行緒的interleaving的測試與除錯工具,並且只依賴debugger來提供所需的interleaving控制能力。在除錯上,本工具藉由提供可重現任意的interleaving的能力,來支援開發者進行除錯。在測試上,則可以系統性地探索interleaving空間,並可利用heuristic提高測試效率。此外,本工具也針對常見的兩種synchronization intention violation-atomicity violation、order violation-提供開發者設置assertion的功能,做為一種判斷程式如預期執行的測試準則(test oracle),讓開發者能夠從更多的面向檢驗程式的行為,以增加提早發現concurrency error的機會,降低後續除錯的難度。最後,由於本工具是基於debugger framework進行設計,因此更容易移植到新的除錯器上以支援更多程式語言。
Applying multithreading techniques is an inevitable trend in software development nowadays. However, writing correct multi-threaded programs remains a difficult challenge to most of developers in practice, due to the lack of debugging and testing support from tools. Such nondeterminism has seriously hindered the reproduction of concurrency errors, making debugging and testing a concurrent program a difficult task in practice.
Although the primary tool for fixing a bug is a debugger, debugging support for multi-threaded program is poorly provided by existing debuggers. On the other hand, solutions provided by previous researches often suffer from different kinds of assumptions and limitations. These limitations and assumptions are, O.S., high-level programming language, virtual machine dependency, or the programming language dependency for costly static analysis
In this paper, a flexible debugging and testing tool is proposed. First of all, This tool helps programmers on testing and debugging concurrency errors by providing the capability of reproducing and generating arbitrary interleavings. Where interleaving space can be reduced by heuristics, including bounding the locations of context switches and using thread pairwise testing. In addition, assertions for two common synchronization intentions, atomicity and order, are provided to help developers detecting concurrency errors from a different perspective, which offer an additional opportunity to make debugging easier by reducing the distance between the execution of the concurrency error and its manifestation. Finally, this approach is protentially easy to port to other debuggers to support more programming languages.
[1] S. Lu, S. Park, E. Seo, and Y. Zhou, "Learning from mistakes: a comprehensive study on real world concurrency bug characteristics," SIGARCH Comput. Archit. News, vol. 36, pp. 329-339, 2008.
[2] Java Path Finder (JPF). Available: http://babelfish.arc.nasa.gov/trac/jpf/wiki/projects/start
[3] "Checkthread - a static analysis tool for catching java concurrency bugs."
[4] S. Bindal, S. Bansal, and A. Lal, "Variable and thread bounding for systematic testing of multithreaded programs," presented at the Proceedings of the 2013 International Symposium on Software Testing and Analysis, Lugano, Switzerland, 2013.
[5] L. O. Andersen, "Program Analysis and Specialization for the C Programming Language," ed, 1994.
[6] J. Whaley and M. S. Lam, "Cloning-based context-sensitive pointer alias analysis using binary decision diagrams," SIGPLAN Not., vol. 39, pp. 131-144, 2004.
[7] 陳新志, "Korat: An O.S.-independent Capture/Replay Test Automation System," 碩士, 軟體工程研究所, 國立中央大學, 桃園縣, 2014.
[8] 劉冠吟, "建構於JMeter之自動化分散式壓力測試架構," 碩士, 資訊工程學系, 國立中央大學, 桃園縣, 2015.
[9] G. Denaro, A. Margara, M. Pezz, x00E, and M. Vivanti, "Dynamic Data Flow Testing of Object Oriented Systems," in 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, 2015, pp. 947-958.
[10] EclEmma, a free Java code coverage tool for Eclipse, brings code coverage analysis directly into the Eclipse workbench. Available: http://www.eclemma.org/
[11] 王浚懿, "Locating Interested Code by Program Execution Paths with Debugger," 碩士, 軟體工程研究所, 國立中央大學, 桃園縣, 2013.
[12] Valgrind. Available: http://valgrind.org/docs/pubs.html
[13] M. Musuvathi and S. Qadeer, "Iterative context bounding for systematic testing of multithreaded programs," SIGPLAN Not., vol. 42, pp. 446-455, 2007.
[14] J.-D. Choi and H. Srinivasan, "Deterministic replay of Java multithreaded applications," presented at the Proceedings of the SIGMETRICS symposium on Parallel and distributed tools, Welches, Oregon, USA, 1998.
[15] O. Edelstein, E. Farchi, Y. Nir, G. Ratsaby, and S. Ur, "Multithreaded Java program test generation," IBM Systems Journal, vol. 41, pp. 111-125, 2002.
[16] S. Park, S. Lu, and Y. Zhou, "CTrigger: exposing atomicity violation bugs from their hiding places," SIGPLAN Not., vol. 44, pp. 25-36, 2009.
[17] S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson, "Eraser: a dynamic data race detector for multithreaded programs," ACM Trans. Comput. Syst., vol. 15, pp. 391-411, 1997.
[18] A. Bron, E. Farchi, Y. Magid, Y. Nir, and S. Ur, "Applications of synchronization coverage," presented at the Proceedings of the tenth ACM SIGPLAN symposium on Principles and practice of parallel programming, Chicago, IL, USA, 2005.
[19] W. Pugh and N. Ayewah, "Unit testing concurrent software," presented at the Proceedings of the twenty-second IEEE/ACM international conference on Automated software engineering, Atlanta, Georgia, USA, 2007.