ebook img

Mobile Applications: Design, Development and Optimization PDF

669 Pages·2022·16.89 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 Mobile Applications: Design, Development and Optimization

Tejinder S. Randhawa Mobile Applications Design, Development and Optimization Mobile Applications Tejinder S. Randhawa Mobile Applications Design, Development and Optimization Tejinder S. Randhawa Mobile NewMedia Ltd. Surrey, BC, Canada British Columbia Institute of Technology Burnaby, BC, Canada ISBN 978-3-030-02389-8 ISBN 978-3-030-02391-1 (eBook) https://doi.org/10.1007/978-3-030-02391-1 © Springer Nature Switzerland AG 2022 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland Preface To facilitate critical operations anytime and anywhere, from the palm of the user, mobile applications need to maneuver through the resource constraints of the unte- thered handheld personal devices along with the uncertainties of the mobile envi- ronments. From the time a mobile app is incepted and its role for the intended end users envisaged up until it is developed and eventually put to use, a misstep could result in a mobile app costing user a serious setback as opposed to being a user’s indispensable possession. Bridging the study of software engineering with software quality assurance strategies, this book facilitates hands-on training of the design, development, and optimization of mobile applications. Signifying the influence of software process models in molding the mobile app to perfection, Chap. 1 exemplifies behavior-driven development of a mobile appli- cation and demonstrates effectual adoption of accompanying software engineering practices for reference purposes as well as further comparative analysis. Chapter 2 provides the needed technical know-how to transform idea of a mobile application into fully functioning code. Chapter 3 presents the metrics, test-beds, and analytical models to gauge the quality of the developed mobile application and identify areas for improvement. Chapters 4, 5, 6, 7, 8, 9, and 10 follow this up by presenting strate- gies to address deficiencies in the quality of the mobile applications observed and located during their quality assessment. This book is intended for software developers, software QA engineers and stu- dents of computer systems alike. For software developers, in addition to helping exercise and hone their GUI development, database, network, and systems program- ming skills, the book creates an opportunity to practice their programming skills not only in creating feature-rich mobile apps but also in implementing solutions that can withstand scrutiny of their QA teams. For software QA engineers, the book lays the groundwork to establish sound quality evaluation and assurance processes for mobile applications. By shedding light on the implementation details and conduct- ing in-depth analysis of quality assurance solutions, the book guides software QA v vi Preface engineers on where to look for any possible compromises with the quality of the mobile apps. For students of computer systems, the book acts as a manual on how to apply fundamental knowledge of operating systems, database systems, network protocols, UI/UX design, and rich media when creating mobile applications that provide critical functionality for the real world. Burnaby, BC, Canada Tejinder S. Randhawa Contents 1 Software Life Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Process Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Functional Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2.1 User Stories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2.2 UML Use Case Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.2.3 Software Requirements Specifications . . . . . . . . . . . . . . . . 12 1.3 Non-functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.4 Test-Driven Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.4.1 Acceptance Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.4.2 Unit Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 1.5 Continuous Integration and Delivery . . . . . . . . . . . . . . . . . . . . . . . . 43 1.5.1 Software Configuration Management . . . . . . . . . . . . . . . . . 44 1.5.2 Build Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Lab Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2 Development Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.1 Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 2.1.1 GUI Objects and Layouts. . . . . . . . . . . . . . . . . . . . . . . . . . . 58 2.1.2 Event Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 2.1.3 Redirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 2.2 Data Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 2.2.1 Key-Value Pairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 2.2.2 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 2.2.3 Database Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 2.2.4 Personal Data Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 2.3 Data Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 2.3.1 Web Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 2.3.2 Short Message Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 vii viii Contents 2.4 Concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 2.4.1 Threads and Asynchronous Tasks . . . . . . . . . . . . . . . . . . . . 98 2.4.2 Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 2.5 Location and Sensor APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Lab Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 3 Software Quality Assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 3.1 Functional Requirements Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 3.1.1 Equivalence Class Partitioning . . . . . . . . . . . . . . . . . . . . . . 121 3.1.2 Boundary Value Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 3.1.3 Domain Test Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 3.2 Maintainability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 3.2.1 Sub-characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 3.2.2 Maintainability Measures. . . . . . . . . . . . . . . . . . . . . . . . . . . 132 3.3 Usability and Accessibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 3.3.1 Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 3.3.2 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 3.4 Performance Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 3.4.1 Latency Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 3.4.2 GUI Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 3.4.3 Memory Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 3.4.4 Network Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 3.4.5 Battery Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 3.5 Scalability Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 3.5.1 Scalability Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 3.5.2 Load Test Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 3.6 Reliability Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 3.6.1 Growth Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 3.6.2 Fault Injection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 3.6.3 Operational Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 3.6.4 Reliability Test Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 3.7 Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 3.7.1 Availability Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 3.7.2 Stress Test Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 3.8 Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 3.8.1 FMEA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 3.8.2 FTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 3.9 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 3.9.1 Vulnerabilities and Threat Analysis . . . . . . . . . . . . . . . . . . . 166 3.9.2 Security Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 3.10 Static Code Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Contents ix Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Lab Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 4 Maintainability and Multi-platform Development . . . . . . . . . . . . . . . 189 4.1 Software Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 4.1.1 Programming Paradigms . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 4.1.2 Design Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 4.1.3 Architectural Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 4.2 Design Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 4.2.1 Structural . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 4.2.2 Behavioral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 4.3 Multi-platform Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 4.3.1 Native Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 4.3.2 Hybrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 4.3.3 Cross-Platform Development . . . . . . . . . . . . . . . . . . . . . . . . 241 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Lab Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 5 User Interaction Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 5.1 Multimodality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 5.1.1 Touch Gestures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 5.1.2 Motion Gestures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 5.1.3 Verbal Gestures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 5.1.4 Visual Gestures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 5.1.5 Accessibility Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . 283 5.2 Navigation Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 5.3 Dashboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 5.4 Custom GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 5.5 Animated GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 Lab Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 6 Performance Acceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 6.1 Data Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 6.1.1 Lossless Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 6.1.2 Lossy Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 6.2 Data I/O Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 6.2.1 File System I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 6.2.2 Network I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 6.3 Rendering Pipelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 6.3.1 Animation Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 x Contents 6.3.2 Video Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377 6.3.3 Augmented Reality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 6.3.4 Hardware Acceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 6.4 Parallel Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 6.4.1 Thread Priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 6.4.2 Data Parallel Computation . . . . . . . . . . . . . . . . . . . . . . . . . . 390 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 Lab Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 7 Scalability Provisioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 7.1 Scalable Media Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 7.2 Scalable Local Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 7.2.1 Data Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 7.2.2 Data Structures and Query Plan . . . . . . . . . . . . . . . . . . . . . . 427 7.2.3 Location Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 7.3 Scalable Design Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 7.3.1 Data Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 7.3.2 Event Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 7.4 GUI Scalability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 Lab Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 8 Reliability Assurance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 8.1 Thread-Safe Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 8.1.1 Serializing GUI Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 8.1.2 Serializing Shared Memory Access . . . . . . . . . . . . . . . . . . . 461 8.1.3 Thread Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 8.2 Memory Leaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473 8.3 Reliable Persistent Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 8.3.1 Isolation and Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . 477 8.3.2 Atomicity and Durability . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 8.3.3 Sharded Persistent Storage . . . . . . . . . . . . . . . . . . . . . . . . . . 488 8.4 Data Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 8.4.1 Input Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493 8.4.2 Integrity Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 8.5 Stateful Data Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 Lab Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514

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.