Client-Centered Software Development the CO-FOSS Approach
Total Page:16
File Type:pdf, Size:1020Kb
Client-Centered Software Development The CO-FOSS Approach Client-Centered Software Development The CO-FOSS Approach Allen B. Tucker CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 ⃝c 2019 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Printed on acid-free paper International Standard Book Number-13: 978-1-138-58384-9 (Hardback) This book contains information obtained from authentic and highly regarded sources. Rea- sonable efforts have been made to publish reliable data and information, but the authorand publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permis- sion to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, re- produced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Cen- ter, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not- for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trade- marks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging-in-Publication Data Names: Tucker, Allen B., author. Title: Client-centered software development : the CO-FOSS approach / Allen B. Tucker. Description: Boca Raton, FL : CRC Press/Taylor & Francis Group, [2019] j Includes index. Identifiers: LCCN 2019010378j ISBN 9781138583849 (hardback : acid-free paper) j ISBN 9780429506468 (ebook) Subjects: LCSH: Application software--Development. j Computer software industry--Customer services. j Consumer satisfaction. Classification: LCC QA76.76.D47 T839 2019 j DDC 005.3--dc23 LC record available at https://lccn.loc.gov/2019010378 Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com To Meg, my inspiration and lifelong partner Contents List of Figures xvii List of Tables xxiii Foreword xxv Preface xxix Acknowledgments xxxv About the Author xxxvii Chapter 1 ■ The Journey 1 1.1 SOFTWARE 1 1.2 SOFTWARE DEVELOPMENT MODELS 3 1.2.1 Serial Development 3 1.2.2 Agile Development 4 1.2.3 CO-FOSS Development 5 1.2.4 Software Customization: A Continuum 7 Custom Software 7 Off-the-Shelf Software 8 Custom Software with Off-the-Shelf Components 9 1.3 SOFTWARE LICENSING 9 1.3.1 Proprietary Licensing 9 1.3.2 Open Source Licensing 10 1.3.3 FOSS Origins and Impact 13 FOSS Worldwide 16 Terminology: OSS, FOSS, FLOSS, H/FOSS, and CO-FOSS 18 vii viii ■ Contents 1.4 SOFTWARE ARCHITECTURES 19 1.4.1 Software Frameworks 19 1.4.2 Web Servers and Bundles 21 1.5 NEW VS MATURE OPEN SOURCE PROJECTS 22 1.5.1 Maturity Assessment 23 1.5.2 Incubation 24 Community 25 Bug Tracking 27 1.6 INTO THE WEEDS 28 1.6.1 To the Instructor 29 1.6.2 To the Student 31 1.6.3 To the Client 32 1.6.4 To the Developer 33 1.7 SUMMARY 33 1.8 MILESTONE 1 34 Section I Organization Stage Chapter 2 ■ Finding a Client and a Project 37 2.1 CLIENT ACTIVITIES AND SOFTWARE NEEDS 39 2.1.1 The Current Process and Existing Software 41 2.1.2 New Software to Fit a New Need 44 2.2 DOMAIN ANALYSIS 45 2.2.1 Requirements Gathering 48 2.2.2 User Stories 49 2.2.3 Use Cases 50 Unified Modeling Language 52 Writing an Effective Use Case 53 2.3 SOFTWARE DESIGN 55 2.3.1 System and Performance Requirements 55 2.3.2 Software Architecture 57 Layering, Cohesion, and Coupling 57 Domain Class Layer 61 Database Layer 61 User Interface Layer 63 2.3.3 Software Security 63 2.3.4 Encouraging Code Reuse 65 Contents ■ ix 2.4 THE DESIGN DOCUMENT 66 2.4.1 Overall Structure 67 2.4.2 Variations 68 2.5 THE SANDBOX 69 2.6 SUMMARY 70 2.7 MILESTONE 2 70 Chapter 3 ■ Defining the Course 71 3.1 SOFTWARE PROJECT ELEMENTS 71 3.1.1 Collaboration Tools 72 3.1.2 Development Platform 73 3.1.3 Project Hosting 74 3.1.4 The Version Control System 75 3.1.5 Sandbox and Live Versions 77 3.1.6 Reading, Writing, and Documenting Code 79 3.1.7 Unit Testing 82 Unit Testing Tools 84 3.1.8 User Help 85 3.2 THE COURSE 86 3.2.1 The Classroom 87 3.2.2 Team Formation and Dynamics 88 3.2.3 Scheduling and Milestones 90 3.2.4 Ensuring Progress 92 3.2.5 The Syllabus 93 3.2.6 Assignments and Grading 95 3.2.7 Alternatives: The Two-Semester Software Projects Course 97 3.3 SUMMARY 98 3.4 MILESTONE 3 98 Section II Development Stage Chapter 4 ■ Project Launch 101 4.1 THE TEAM 101 4.1.1 Team Dynamics 103 x ■ Contents 4.1.2 Asynchronous Communication 105 Aside: Mature FOSS Projects 106 4.1.3 Synchronous Communication 107 4.1.4 Shared Documents 108 4.2 THE DEVELOPMENT TOOLS 109 4.2.1 Programming Languages 109 JavaScript 110 Python 110 Java 111 Ruby 111 PHP 111 HTML and CSS 111 Other Languages 112 4.2.2 Software Platforms 112 The Apache/MySQL/PHP Server 113 Server-Side Java 114 Python 114 Ruby 114 4.2.3 IDEs for Development 114 Eclipse IDE 115 Python IDEs 116 Ruby IDEs 116 Java IDEs 116 Choosing and Installing an IDE 117 4.2.4 Working with the VCS 117 4.3 THE PRODUCT 122 4.3.1 Reading the Design Document 122 Identify Classes and Modules 124 Identify Instance Variables 124 Identify Methods and Functions 124 4.3.2 Reading the Code 126 Start from the Top 126 Look for Classes with Unique Keys 127 Avoid the Temptation to Edit the Code 128 4.3.3 Reading and Writing Code 129 4.3.4 Code Reuse 130 4.3.5 Licensing 131 Contents ■ xi 4.4 SUMMARY 132 4.5 MILESTONE 4 132 Chapter 5 ■ Domain Class Development 133 5.1 CODING THE DOMAIN CLASSES 134 5.1.1 Reusing External Legacy Code 134 5.1.2 Reusing Internal Legacy Code 136 5.1.3 Coding a Domain Class from Scratch 137 5.1.4 Adding Functionality: Constructor and Getters 138 5.2 SOFTWARE TESTING 139 5.2.1 Test Case Design 141 5.2.2 Unit Testing Frameworks 142 5.2.3 Unit Testing the Homeroom Domain Classes 146 5.2.4 Unit Testing the Homebase Domain Classes 147 5.2.5 Code Synchronization and Integration Testing 151 5.3 DEBUGGING AND REFACTORING 154 5.3.1 Debugging 154 5.3.2 Identifying Bad Smells 156 Aside: Using Software Metrics 158 5.3.3 Refactoring 159 5.4 CLIENT REVIEW AND ISSUE TRACKING 162 5.4.1 Client Review 162 5.4.2 Issue Tracking 163 5.5 SUMMARY 164 5.6 MILESTONE 5 165 Chapter 6 ■ Database Development 167 6.1 DATABASE PRINCIPLES 168 6.1.1 Relations and Tables 169 Table Naming Conventions 170 6.1.2 Queries 172 6.1.3 Normalization 173 6.1.4 Keys 175 6.1.5 Concurrency Control 176 xii ■ Contents 6.2 DATABASE ACCESS 177 6.2.1 Connecting the Program to the Database 178 6.2.2 Table Creation and Dropping 179 6.2.3 CRUD Functions 181 Create: Inserting Rows into a Table 182 Retrieving Rows from a Table 182 Update: Altering Rows in a Table 184 Delete: Removing Rows from a Table 185 6.2.4 Database Security 185 6.2.5 Database Integrity 187 6.2.6 Adding a Database Abstraction Layer 190 6.3 DATABASE TESTING 191 6.3.1 Testing the dbShifts.php Module 191 6.3.2 Testing the dbPersons.php Module 193 6.3.3 Testing the dbBookings.php Module 195 6.3.4 Testing the dbRooms.php Module 196 6.3.5 Integration Testing: Persons, Bookings, and Rooms 197 6.4 CLIENT REVIEW AND ISSUE TRACKING 200 6.4.1 Client Review 200 6.4.2 Issue Tracking 201 6.5 SUMMARY 205 6.6 MILESTONE 6 205 Chapter 7 ■ User Interface Development 207 7.1 PRINCIPLES 208 7.1.1 Model-View-Controller Pattern 209 MVC Example 1: Editing a Shift in Homebase 211 MVC Example 2: Editing a Person in Homeroom 212 MVC Example 3: Editing a Stop in Homeplate 213 7.1.2 Linkages among MVC triples 214 7.1.3 User-Level Security 216 User Login and Password Encryption 216 User Access Levels 218 Enforcement of Access Levels 218 Contents ■ xiii 7.1.4 Protection against Outside Attacks 219 Avoiding SQL Injection Attacks 219 Avoiding Cross-Site Scripting Attacks 220 7.2 PRACTICE 221 7.2.1 Sessions, Query Strings, and Global Variables 221 7.2.2 Working with Scripts and HTML 223 Scripting Example 1: Editing a Shift 224 Scripting Example 2: Managing a Sub Call List 226 7.2.3 Reading Deeply 227 7.2.4 Using JavaScript and jQuery UI to Improve the User Interface 231 7.2.5 Responsive User Interfaces 234 Responsive user interface design 236 7.3 TESTING, DEBUGGING, AND REFACTORING 238 7.3.1 Testing a User Interface 240 Organizing the Testing Process 243 7.3.2 Refactoring: Removing a Layering Violation 243 7.4 ADDING A NEW FEATURE: ALL LAYERS IMPACTED 246 Changing the Edit Person MVC Triple 247 Changing the Search for Persons MVC Triple 248 Changing the Schedule Person MVC Triple 249 Changing the Edit Shift MVC Triple 250 Changing the Sub Call List MVC Triple 251 7.5 CLIENT REVIEW AND ISSUE TRACKING 252 7.5.1 A User Interface Bug 253 7.5.2 A Multi-Layer Bug 256 7.6 SUMMARY 258 7.7 MILESTONE 7 259 Chapter 8