ebook img

Constraint-Based Design Recovery for Software Reengineering: Theory and Experiments PDF

204 Pages·1998·4.228 MB·English
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 Constraint-Based Design Recovery for Software Reengineering: Theory and Experiments

CONSTRAINT-BASED DESIGN RECOVERY FOR SOFTWARE REENGINEERING: Theory and Experiments THE KLUWER INTERNATIONAL SERIES IN SOFTWARE ENGINEERING Series Editor Victor R. Basili University ofM aryland College Park, MD 20742 Also in the Series: . FORMAL SPECIFICA nON TECHNIQUES FOR ENGINEERING MODULAR C PROGRAMS by TAN Yang Meng ISBN: 0-7923-9653-7 TOOLS AND ENVIRONMENTS FOR PARALLEL AND DISTRIBUTED SYSTEMS by Amr Zaky and Ted Lewis ISBN: 0-7923-9675-8 The Kluwer International Series in Software Engineering addresses the following goals: • To coherently and consistently present important research topics and their application(s). • To present evolved concepts in one place as a coherent whole, updating early versions of the ideas and notations. • To provide publications which will be used as the ultimate reference on the topic by experts in the area. With the dynamic growth evident in this field and the need to communicate findings, this series provides a forum for information targeted toward Software Engineers. CONSTRAINT- BASED DESIGN RECOVERY FOR SOFTWARE REENGINEERING: Theory and Experiments by Steven G. Woods Carnegie Mellon University Pittsburgh, PA, USA Alexander E. Quilici University ofH awaii at Manoa Honolulu, Hawaii, USA Qiang Yang Simon Fraser University Burnaby, British Columbia, CANADA SPRINGER-SCIENCE+BUSINESS MEDIA, LLC ISBN 978-1-4613-7494-7 ISBN 978-1-4615-5461-5 (eBook) DOI 10.1007/978-1-4615-5461-5 Library of Congress Cataloging-in-Publication Data A C.I.P. Catalogue record for this book is available from the Library of Congress. Copyright © 1998 by Springer Science+Business Media New York Originally published by Kluwer Academic Publishers in 1998 Softcover reprint of the hardcover 1s t edition 1998 All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, mechanical, photo copying, recording, or otherwise, without the prior written permission of the publisher, Springer-Science+Business Media, LLC. Printed on acid-free paper. This book is dedicated to our family and friends. CONTENTS LIST OF FIGURES XI PREFACE xv ACKNOWLEDGMENTS XXI 1. INTRODUCTION 1 1.1 PROGRAM UNDERSTANDING 1 Why Program Understanding Is So Important 2 Why Program Understanding Is Difficult 7 1.2 THE STATE OF THE PRACTICE 9 Tools For Forming And Accessing An Information Store 9 Tools That Apply The Information Store 11 1.3 CONCEPTUAL PROGRAM UNDERSTANDING 12 How People Understand Programs 12 Automated Program Understanding 13 Assisted Program Understanding 14 Interactive Progra m Understanding 16 1.4 THE REMAINDER OF THIS BOOK 17 2. PLAN-BASED PROGRAM UNDERSTANDING 19 2.1 OVERVIEW 19 2.2 AST-BASED APPROACHES 23 The Concept Recognizer: A Library-Driven Approach 23 DECODE: An Indexed, Code-Driven Approach 26 2.3 GRAPH-BASED APPROACHES 32 GRASPR: An Approach Based On Graph Parsing 32 Unprog: An Approach Based On Graph-Matching 36 2.4 ANALYSIS OF PREVIOUS APPROACHES 40 Scalability Issues 40 Comparing Approaches 41 Vll Vlll CONSTRAINT-BASED DESIGN RECOVERY FOR SOFTWARE REENGINEERING Summary: The State Of The Field 41 3. PROGRAM UNDERSTANDING AND CONSTRAINT SATISFACTION 43 3.1 INTRODUCTION 43 3.2 CONSTRAINT SATISFACTION PROBLEMS 44 Consistency Propagation 47 Backtrack-Based Search Algorithms 50 Other Methods 52 3.3 PROGRAM UNDERSTANDING AS CONSTRAINT-SATISFACTION 54 An Example Of Plan Matching 54 Plan Matching As MAP-CSP 54 Plan Ordering Through Layered MAP-CSP 59 3.4 MODELING EXISTING PROGRAM UNDERSTANDING ALGORITHMS 61 The Concept Recognizer 61 DECODE 63 Modeling Program Understanding As A Single CSP 64 4. INITIAL EXPERIMENTS WITH CONCEPT RECOVERY 67 4.1 INTRODUCTION 67 4.2 EXPERIMENTAL FRAMEWORK 68 The Actual Plan Representation 68 Generating Test Programs 69 Experimental Output 71 Measuring Efficiency 71 4.3 EXPERIMENTS WITH CSP SOLVERS 72 Exploring Different Strategies 73 Exploring Larger, More Complex Programs 77 Exploring Different Statement Distributions 79 Exploring Larger Plans 81 4.4 COMPARING EXISTING APPROACHES 83 The Concept Recognizer 83 DECODE 84 Experimental Methodology 85 Experimental Results 85 Experimental Analysis 86 4.5 SUMMARY OF RESULTS 88 5. ADDITIONAL EXPERIMENTS WITH CONCEPT RECOVERY 91 5.1 INTRODUCTION 91 5.2 EXPERIMENTAL FRAMEWORK 92 The Actual Plan Representation 92 Constructing Test Programs 93 5.3 SOME EXPERIMENTS WITH "REAL" PROGRAMS 94 CONTENTS IX Real-World Versus Artificial Programs 95 Scaling And Plan Size 98 5.4 EXPERIMENTS WITH DOMAIN-VALUE PRE-FILTERING 99 An Initial Experiment 101 Scaling With Plan Size 102 Hierarchical Decomposition 103 Constraint Ordering 106 5.5 EXPERIMENTS WITH A NEW CONSTRAINT-BASED ALGORITHM 108 Redoing Our Earlier Experiments 110 Recognizing A Year 2000 Plan 111 5.6 SUMMARY 115 6. PROGRAM UNDERSTANDING AND AI PLAN RECOGNITION 117 6.1 INTRODUCTION 117 6.2 AN AI APPROACH TO PLAN RECOGNITION 118 An Action Hierarchy 119 Using The Action Hierarchy 119 A Detailed Example 121 6.3 PROBLEMS WITH APPLYING AI PLAN RECOGNITION 124 Incorrect Plan Recognition 127 Inefficient Plan Recognition 129 6.4 LAYERED MAP-CSP VERSUS THE AI APPROACH 131 7. IMPROVING OUR CONSTRAINT-BASED APPROACH 133 7.1 INTRODUCTION 133 Improving Scalability With Library Size 134 Performing Imprecise Program Understanding 134 Interaction With The User 135 7.2 ADDRESSING PROBLEMS WITH LAYERED MAP-CSP 135 The Library Scalability Problem 135 Tackling Imprecise Program Understanding 137 Supporting User Interaction 137 An Extended Layered MAP-CSP Algorithm 138 7.3 INTEGRATED UNDERSTANDING: PU-CSP 140 The Elements Of A PU-CSP 140 Forming A PU-CSP 140 Structural Versus Knowledge Constraints 142 How PU-CSP Uses Constraint Propagation 144 The Computational Complexity Of PU-CSP 147 7.4 SOLVING STRATEGIES FOR PU-CSP 148 An Interactive Bottom-Up Algorithm 148 Using PU-CSP As A Top-Down Algorithm 149 Hierarchical Arc-Consistency 151 x CONSTRAINT-BASED DESIGN RECOVERY FOR SOFTWARE REENGINEERING Key Differences From Discrete Arc-Consistency 151 Examples Of Hierarchical Consistency Propagation 153 7.5 PU-CSP VERSUS LAYERED MAP-CSP 156 8. CONCLUSIONS 159 8.1 SUMMARY 159 8.2 FUTURE EXPERIMENTS 161 Experiments With MAP-CSP And Plan-Size 161 Experiments With MAP-CSP And Real-World Programs 161 Experiments With MAP-CSP And Generated Programs 162 Experiments With Layered MAP-CSP 163 Experiments With PU-CSP 164 8.3 FUTURE MODELING AND ALGORITHM DEVELOPMENT 164 Improving Our Models Of Existing Algorithms 164 Forming Models Of Other Program Understanding Algorithms 165 Improving Our Algorithms 166 Design Pattern Recognition 167 8.4 FUTURE TOOL DEVELOPMENT 168 Improving Program Understanding Environments 168 Locating Code By Example 169 8.5 APPLYING PLAN RECOGNITION TO THE YEAR 2000 PROBLEM 170 Pattern-Based Tech niq ues 171 Rule-Based Techniques 171 A Year 2000 Plan Library 172 Benefits Of Integrating Plan Recognition 173 8.6 CONTRIBUTIONS TO ARTIFICIAL INTElliGENCE 173 A New Plan Recognition Algorithm 174 A New Domain For Constraint Satisfaction Research 174 8.7 FINAL REMARKS 175 REFERENCES 177 INDEX 185 LIST OF FIGURES 1.1 An example incorrect, leap-year related, COBOL code fragment. 3 1.2 A fixed version of the incorrect leap-year related COBOL code fragment. 4 l.3 A C language source code fragment that displays a two-digit date. 5 1.4 A revised version of the earlier C code that now displays a four digit date. 5 1.5 Some imperative C code that manipulates strings. 6 1.6 Our imperative C code translated to object-oriented C++. 6 1.7 The role of program understanding in software maintenance and reengineering. 10 1.8 The architecture of most state-of-the-practice environments for soft- ware maintenance and reengineering. 11 1.9 How programmers understand source code. 13 1.10 Our approach to automated program understanding. 15 1.11 An illustration of assisted program understanding. 16 2.1 The common architecture of plan recognition systems. 20 2.2 An example hierarchical code understanding. 21 2.3 An example of the Concept Recognizer's representation for plans. 24 2.4 An example of the DECODE's plan representation. 28 2.5 DECODE's plan recognition algorithm. 31 2.6 A Lisp function to test whether the three input sides form a right triangle. 33 2.7 An attributed flow graph for the RIGHTP function. 34 2.8 An example flowgraph representation of one rule for recognizing the Negate-If-Negative design concept. 35 2.9 GRASPR's chart-parsing plan recognition algorithm. 36 2.10 An example COBOL code fragment. 37 Xl

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.