簡易檢索 / 詳目顯示

研究生: 鄭可莉
Cheng, Ko-Li
論文名稱: 利用程式樣式偵測軟體錯誤
Software Fault Detection using Program Patterns
指導教授: 朱治平
Chu, Chih-Ping
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊工程學系
Department of Computer Science and Information Engineering
論文出版年: 2011
畢業學年度: 99
語文別: 英文
論文頁數: 83
中文關鍵詞: 預測錯誤程式片段程式樣式關聯式規則探勘
外文關鍵詞: Fault Prediction, Program segement, Program pattern, Association Rule Mining
相關次數: 點閱:124下載:2
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 在軟體開發流程中,偵測程式碼錯誤是一個重要的活動。偵測程式碼錯誤的困難在於精確地找出程式碼錯誤位置並正確的修正。利用測試個案(Test cases)來測試軟體錯誤是最常見的方法,本文以程式樣式(pattern)的角度去偵測程式碼中的邏輯錯誤(logic error)。
    在本論文中,我們提出一個利用程式樣式(pattern)去偵測邏輯錯誤(logic error)的方法,並使用關聯式規則探勘(Association Rule Mining)去找出常犯錯的樣式(pattern)。在本文中,樣式(pattern)由關鍵字(keywords)、類別(class)、函式(function)和類別方法(class method)所組成。樣式(pattern)可以是大眾化樣式(general patterns)或個人化樣式(personal patterns)。大眾化樣式(general patterns)為大眾常犯錯的程式樣式(pattern);個人化樣式(personal patterns) 為適性化的程式樣式(pattern)。
    利用本研究提出的方法和本研究開發的工具,可以標示可能有問題的程式片段,程式設計師可以修正錯誤,進一步增加軟體品質。最後根據研究結果顯示,由本研究所提出的方法,大約有60%以上的準確率。

    Detecting source code fault is an important activity in software development process. The difficulty of detecting source code fault is to find program errors precisely and then to correct them. Using test cases to test the software is the most common method to find software faults. In this thesis, we propose using program patterns to detect logic error from source code.
    We developed an approach that applies program patterns to detect logic errors. Program patterns, which are composed of keywords, class, function and method, are determined by association rule mining. Program patterns can be either general patterns or personal patterns. General patterns stand for general mistakes of program segments, while personal patterns are adaptive errors made by individual programmers.
    Fault-prone code segments can be marked by using the proposed approach. So programmer can fix bug and increase software quality further. In the experiment of our approach, the results show approximately above 60% accuracy.

    摘要 III ABSTRACT IV 致謝 V LIST OF FIGURES VIII LIST OF TABLES X CHAPTER1 INTRODUCTION 1 1.1. MOTIVATION 1 1.2. CONTRIBUTION 6 1.3. ORGANIZATION 6 CHAPTER2 BACKGROUNDS AND RELATED WORK 7 2.1. SOFTWARE DEFECT 7 2.2. SOFTWARE COMPLEXITY MEASUREMENT 7 2.3 QUALITY EVALUATION 9 2.4 MODELING TECHNIQUES 10 2.5 PROGRAM SEGMENT 11 2.6 SOFTWARE QUALITY PREDICTION 12 2.7 CAUSAL ANALYSIS 13 2.8 ECLIPSE 14 2.9 ANTLR AND BBCDT 16 CHAPTER3 PROGRAM PATTERN IDENTIFICATION 19 3.1 CREATE SIMPLIFIED ABSTRACT SYNTAX TREES 20 3.2 RETRIEVE CODE SEGMENTS 28 3.3 PROGRAM PATTERN IDENTIFICATION 30 3.3.1 Phase One 33 3.3.2 Phase Two 34 3.3.3 Phase Three 38 CHAPTER4 EXPERIMENTAL RESULTS AND DISCUSSIONS 39 4.1. AN EXAMPLE - CREATING SIMPLIFIED ABSTRACT SYNTAX TREE 39 4.2. AN EXAMPLE – PHASES ONE TO THREE 41 4.2.1. Phase One 41 4.2.2. Phase Two 42 4.2.3. Phase Three 44 4.3. EXPERIMENT 44 4.3.1. GUI Tool 44 4.3.2. Experimental Environment 47 4.3.3. Experimental Planning 48 4.3.4. Analytical Results 62 4.4. DISCUSSION 66 CHAPTER5 CONCLUSIONS AND FUTURE WORK 67 REFERENCES 69 APPENDIX 73 1. THE ALGORITHM OF GENERATING RAW DATA IN TREE VIEW 73 2. THE ALGORITHM OF GENERATING PATTERN 74 3. THE ALGORITHM OF GENERATING ALL KEYWORDS LOCATION 75 4. THE ALGORITHM OF DETECTING FAULT FOR WHOLE SOURCE CODE 76 5. TESTING QUESTIONS- GUI OF CALCULATOR 77 6. TESTING QUESTION - MATRIX 80 7. TESTING QUESTION- DETERMING LEAP YEAR 81 8. TESTING QUESTION- SORTING OF POKER 82 著作目錄 83

    [1] Wohlin, C. and P. Runeson, Defect content estimations from review data, in Proceedings of the 20th international conference on Software engineering. 1998, IEEE Computer Society: Kyoto, Japan. p. 400-409.
    [2] Boehm, B.W., software engineering economic Vol. Ch. 4 Prentice Hall Upper Saddle River NJ. 1981.
    [3] Jones, C., Applied Software Measurement- Assuring Productivity and Quality, ed. n. edn. 1996, McGraw-Hill, New York.
    [4] Pressman , R.S., Software Enginnering- A Practitioner's Approach. 5th edn, ed. E.a.b. D.Ince. 2000, McGraw-Hill International , London.
    [5] Myers, G.J., The Art of Software Testing, ed. Wiley-Interscience. 2004.
    [6] Shinji, K., et al., Experimental Evaluation of Program Slicing for Fault Localization. Empirical Softw. Engg. %@ 1382-3256, 2002. 7(1): p. 49-76.
    [7] Apt, K.R.a.O., E.R., Introduction to program verification.
    [8] Software bug. Available from: http://en.wikipedia.org/wiki/Software_bug.
    [9] McCabe, T.J., A Complexity Measure. IEEE Transactions on Software Engineering, 1976. 2: p. 308-320.
    [10] Henry, S. and D. Kafura, Software Structure Metrics Based on Information Flow. Software Engineering, IEEE Transactions on, 1981. SE-7(5): p. 510-518.
    [11] Qinbao, S., et al., Software defect association mining and defect correction effort prediction. Software Engineering, IEEE Transactions on, 2006. 32(2): p. 69-82.
    [12] Frank, P., Using Machine Learning for Estimating the Defect Content After an Inspection. IEEE Transactions on Software Engineering, 2004. 30: p. 17-28.
    [13] Briand, L.C., et al., A comprehensive evaluation of capture-recapture models for estimating software defect content. Software Engineering, IEEE Transactions on, 2000. 26(6): p. 518-540.
    [14] Barbacci, M., Quality Attributes. Technical Report CMU/SEI-95-TR-021, ESC-TR-95-021, 1995.
    [15] Paola Caliman, Q.C., Software Product Quality Evaluation and Certification:
    the Qseal Consortium Methodology. 1996. ESSI-SCOPE project 21.694.
    [16] Rosqvist, T., M. Koskela, and H. Harju, Software Quality Evaluation Based on Expert Judgement. Software Quality Control, 2003. 11(1): p. 39-55.
    [17] Fitzpatrick, J., Applying the ABC metric to C, C++, and Java, in More C++ gems. 2000, Cambridge University Press. p. 245-264.
    [18] Chang, C.-P., J.-L. Lv, and C.-P. Chu, A Defect Estimation Approach for Sequential Inspection Using a Modified Capture-Recapture Model, in Proceedings of the 29th Annual International Computer Software and Applications Conference - Volume 01. 2005, IEEE Computer Society. p. 41-46.
    [19] IV, R.G.P. and H. Gomaa, Analyzing Behavior of Concurrent Software Designs for Embedded Systems, in Proceedings of the 10th IEEE International Symposium on Object and Component-Oriented Real-Time Distributed Computing. 2007, IEEE Computer Society. p. 124-132.
    [20] Han, J., Data mining techniques. SIGMOD Rec., 1996. 25(2): p. 545.
    [21] Yang, T., Computational verb decision trees. INTERNATIONAL JOURNAL OF COMPUTATIONAL COGNITION (HTTP://WWW. IJCC. US), 2006. 4(4).
    [22] Han, J. and M. Kamber, Data mining: concepts and techniques. 2006: Morgan Kaufmann.
    [23] Howarth, N., Abstract syntax tree design. 1955, Tech. rep., Architecture Projects Management Limited.
    [24] Hellendoorn, H. and C. Thomas, On Quality Defuzzification-Theory and an Application Example. THEORY AND DECISION LIBRARY SERIES D, 1995: p. 167-176.
    [25] Singh, Y., P.K. Bhatia, and O. Sangwan, Predicting software maintenance using fuzzy model. SIGSOFT Softw. Eng. Notes, 2009. 34(4): p. 1-6.
    [26] Weiser, M., Program slicing, in Proceedings of the 5th international conference on Software engineering. 1981, IEEE Press: San Diego, California, United States. p. 439-449.
    [27] Ottenstein, K.J. and L.M. Ottenstein, The program dependence graph in a software development environment. SIGSOFT Softw. Eng. Notes, 1984. 9(3): p. 177-184.
    [28] Bieman, J.M. and L.M. Ott, Measuring Functional Cohesion. IEEE Trans. Softw. Eng., 1994. 20(8): p. 644-657.
    [29] Gallagher, K.B. and J.R. Lyle, Using Program Slicing in Software Maintenance. IEEE Trans. Softw. Eng., 1991. 17(8): p. 751-761.
    [30] Shahmehri, N., Generalized algorithmic debugging. 1991: Linkoping University, Dept. of Computer and Information Science.
    [31] Beck, J. and D. Eichmann, Program and interface slicing for reverse engineering, in Proceedings of the 15th international conference on Software Engineering. 1993, IEEE Computer Society Press: Baltimore, Maryland, United States. p. 509-518.
    [32] Tip, F., A survey of program slicing techniques. Journal of programming languages, 1995. 3(3): p. 121-189.
    [33] Yang, B., L. Yao, and H.-Z. Huang, Early Software Quality Prediction Based on a Fuzzy Neural Network Model, in Proceedings of the Third International Conference on Natural Computation - Volume 01. 2007, IEEE Computer Society. p. 760-764.
    [34] Khoshgoftaar, T.M., et al., Early Quality Prediction: A Case Study in Telecommunications. IEEE Softw., 1996. 13(1): p. 65-71.
    [35] Khoshgoftaar, T.M., et al., Using Process History to Predict Software Quality. Computer, 1998. 31(4): p. 66-72.
    [36] Xing, F., P. Guo, and M.R. Lyu, A Novel Method for Early Software Quality Prediction Based on Support Vector Machine, in Proceedings of the 16th IEEE International Symposium on Software Reliability Engineering. 2005, IEEE Computer Society. p. 213-222.
    [37] Card, D.N., Defect-causal analysis drives down error rates. Software, IEEE, 1993. 10(4): p. 98-99.
    [38] Card, D.N., Learning from our mistakes with defect causal analysis. Software, IEEE, 1998. 15(1): p. 56-63.
    [39] Yu, W., A software fault prevention approach in coding and root cause analysis. Bell Labs Technical Journal, 1998. 3(2): p. 3-21.
    [40] Collofello, J.S. and B.P. Gosalia, An application of causal analysis to the software modification process. Software: Practice and Experience, 1993. 23(10): p. 1095-1105.
    [41] Eclipse Platform Technical Overview. Available from: http://www.eclipse.org/articles/Whitepaper-Platform-3.1/eclipse-platform-whitepaper.html.
    [42] ANTLR. Available from: http://en.wikipedia.org/wiki/ANTLR.
    [43] Building a CDT-based editor. Available from: http://www.ibm.com/developerworks/library/os-ecl-cdt1/index.html.
    [44] Paul, S. and A. Prakash, A Framework for Source Code Search Using Program Patterns. IEEE Trans. Softw. Eng., 1994. 20(6): p. 463-475.
    [45] Hovemeyer, D. and W. Pugh, Finding bugs is easy. SIGPLAN Not., 2004. 39(12): p. 92-106.
    [46] Schleimer, S., D.S. Wilkerson, and A. Aiken, Winnowing: local algorithms for document fingerprinting, in Proceedings of the 2003 ACM SIGMOD international conference on Management of data. 2003, ACM: San Diego, California. p. 76-85.
    [47] Heintze, N., Scalable document fingerprinting, in Proc. Second USENIX Workshop on Electronic Commerce, USENIX, Oakland, CA,. 1996. p. pp. 191-200.
    [48] Rutar, N., C.B. Almazan, and J.S. Foster, A Comparison of Bug Finding Tools for Java, in Proceedings of the 15th International Symposium on Software Reliability Engineering. 2004, IEEE Computer Society. p. 245-256.
    [49] Erich Gamma, R.H., Ralph Johnson, John Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software. 1995. Addison-Wesley,Reading, MA.
    [50] Kurian, S. and M.J. Pont, The maintenance and evolution of resource-constrained embedded systems created using design patterns. J. Syst. Softw., 2007. 80(1): p. 32-41.
    [51] antlr java grammar. Available from: http://www.antlr.org/grammar/1152141644268/Java.g.

    下載圖示 校內:立即公開
    校外:立即公開
    QR CODE