ebook img

Automatically Documenting Software Artifacts Boyang Li Jinan, Shandong, China Master of ... PDF

172 Pages·2017·1.33 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Automatically Documenting Software Artifacts Boyang Li Jinan, Shandong, China Master of ...

Automatically Documenting Software Artifacts Boyang Li Jinan, Shandong, China Master of Science, Miami University, 2011 Bachelor of Science, Shandong Normal University, 2007 A Dissertation presented to the Graduate Faculty of The College of William & Mary in Candidacy for the Degree of Doctor of Philosophy Department of Computer Science College of William & Mary January 2018 © Copyright by Boyang Li 2017 APPROVAL PAGE This Dissertation is submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy Boyang Li Approved by the Committee, September 2017 Committee Chair Associate Professor Denys Poshyvanyk, Computer Science College of William & Mary Professor Weizhen Mao, Computer Science College of William & Mary Assistant Professor Xu Liu, Computer Science College of William & Mary Professor Peter Kemper, Computer Science College of William & Mary Lead Principal Scientist Nicholas A. Kraft, ABB Corporate Research COMPLIANCE PAGE Research approved by Protection of Human Subject Committee Protocol number(s): PHSC-2014-12-04-9995-dposhyvanyk Date(s) of approval: 12/15/2014 ABSTRACT Software artifacts, such as database schema and unit test cases, constantly change during evolution and maintenance of software systems. Co-evolution of code and DB schemas in Database-Centric Applications (DCAs) often leads to two types of challenging scenarios for developers, where (i) changes to the DB schema need to be incorporated in the source code, and (ii) maintenance of a DCAs code requires understanding of how the features are implemented by relying on DB operations and corresponding schema constraints. On the other hand, the number of unit test cases often grows as new functionality is introduced into the system, and maintaining these unit tests is important to reduce the introduction of regression bugs due to outdated unit tests. Therefore, one critical artifact that developers need to be able to maintain during evolution and maintenance of software systems is up-to-date and complete documentation. In order to understand developer practices regarding documenting and maintaining these software artifacts, we designed two empirical studies both composed of (i) an online survey of contributors of open source projects and (ii) a mining-based analysis of method comments in these projects. We observed that documenting methods with database accesses and unit test cases is not a common practice. Further, motivated by the findings of the studies, we proposed three novel approaches: (i) DBScribe is an approach for automatically documenting database usages and schema constraints, (ii) UnitTestScribe is an approach for automatically documenting test cases, and (iii) TeStereo tags stereotypes for unit tests and generates html reports to improve the comprehension and browsing of unit tests in a large test suite. We evaluated our tools in the case studies with industrial developers and graduate students. In general, developers indicated that descriptions generated by the tools are complete, concise, and easy to read. The reports are useful for source code comprehension tasks as well as other tasks, such as code smell detection and source code navigation. TABLE OF CONTENTS Acknowledgments vi Dedication vii List of Tables viii List of Figures x 1 Introduction 2 1.1 Contribution 2 1.2 Dissertation Overview 3 2 Documenting Database-Centric Applications 7 2.1 An Empirical Study on Documenting DCAs 10 2.1.1 Research Questions 10 2.1.2 Data Collection 12 2.1.3 Results 14 2.1.4 Discussion 20 2.1.5 Threats to Validity 22 i 2.2 DBScribe: Documenting Database Usages and Schema Constraints 22 2.2.1 Detecting SQL-Statements 26 2.2.2 Propagating Constraints and SQL-Statements through the Call Graph 29 2.2.3 Generating Contextualized Natural Language Descriptions 31 2.3 DBScribe: Empirical Study Design 32 2.3.1 Research Questions: 34 2.3.2 Data Collection 34 2.3.3 Threats to Validity 37 2.4 DBScribe: Empirical Study Results 38 2.5 Related Works on Documenting DCAs 46 2.5.1 Studies on Co-evolution of Schema and Code 46 2.5.2 Extracting Database Information 47 2.5.3 On Documenting Software Artifacts 47 2.6 Conclusion 49 2.7 Bibliographical Notes 50 3 Documenting Unit Test Cases 51 3.1 An Empirical Study on Documenting Unit Tests 54 ii 3.1.1 Research Questions 54 3.1.2 Data Collection 55 3.1.3 Results 58 3.1.4 Threats to Validity 64 3.2 UnitTestScribe: Documenting Unit Tests 65 3.2.1 UnitTestScribe Architecture 68 3.2.2 Unit Test Detector 70 3.2.3 Method Stereotype Analyzer 70 3.2.4 Focal Method Detector 72 3.2.5 General Description Extractor 73 3.2.6 Slicing Path Analyzer 74 3.2.7 Description Generator 74 3.3 UnitTestScribe: Empirical Study Design 76 3.3.1 Data Collection 76 3.3.2 Research Questions 78 3.3.3 Analysis Method 79 3.3.4 Threats to Validity 80 3.4 UnitTestScribe: Empirical Study Results 80 3.4.1 Demographic Background 82 3.4.2 Completeness (RQ4) 83 3.4.3 Conciseness (RQ5) 84 iii 3.4.4 Expressiveness (RQ6) 85 3.4.5 User Preferences (RQ7 - RQ8) 85 3.4.6 Participants’ Feedback 87 3.5 Related Works on Documenting Unit Tests 88 3.5.1 Approaches and studies on unit test cases 88 3.5.2 Studies on classifying stereotypes 89 3.6 Conclusion 89 3.7 Bibliographical Notes 90 4 Stereotype-based Tagging of Unit Test Cases 92 4.1 Unit Test Case Stereotypes 95 4.1.1 JUnit API-based Stereotypes 99 4.1.2 Data-/Control-flow Based Stereotypes 101 4.2 Documenting Unit Test Cases with TeStereo 102 4.3 Empirical Study 104 4.3.1 Research Questions 105 4.3.2 Context Selection 107 4.3.3 Experimental Design 112 4.4 Empirical Results 114 4.4.1 What is accuracy for identifying stereotypes? 115 iv 4.4.2 Do the proposed stereotypes improve comprehension of tests cases (i.e., methods in test units)? 117 4.4.3 What are the developers perspectives of the TeStereo-based reports for systems in which they contributed? 121 4.4.4 Threats to Validity 127 4.5 Related Work 128 4.5.1 Stereotypes Definition and Detection 128 4.5.2 Utilizing Stereotypes for Automatic Documentation 129 4.5.3 Automatic Documentation of Unit Test Cases 130 4.6 Conclusion 130 4.7 Bibliographical Notes 131 5 Conclusion 132 v

Description:
and preposition phrases that are useful when constructing NL descriptions of .. XUnit family [9, 13, 44] or Mock-based APIs such as Mockito [11] and
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.