Emulator for Complex Sensor- Based IT System
Total Page:16
File Type:pdf, Size:1020Kb
Degree project Emulator for complex sensor- based IT system Author: Ruslan Gederin and Viktor Mazepa Supervisor: Rüdiger Lincke External Supervisor: Per-Olov Thorén Date: 2013-09-30 Course code: 5DV00E, 30 credits Level: Master Department of Computer Science Acknowledgments First of all we want to express gratitude to our supervisor, Dr. Rüdiger Lincke for an interesting master thesis topic and for great work experience with him and his company Softwerk. We would also like to thank to: • Per-Olov Thorén and Ingela Stålberg for interesting meetings and for the opportunity to work on a real commercial project. • Maksym Ponomarenko and Viktor Kostov for excellent management of our work at our remote period. • Oryna Podoba and Illia Klimov for good collaborations during development. • Our families, relatives and friends for their support during our studying in Sweden. ii Abstract Developing and testing complex information technology (IT) systems is a difficult task. This is even more difficult if parts of the system, no matter if hard- or software, are not available when needed due to delays or other reasons. The architecture and design cannot be evaluated and existing parts cannot be reliably tested. Thus the whole concept of the system cannot be validated before all parts are in place. To solve this problem in an industrial project, where the development of the server- side should be finished and tested (clear for production) while the hardware sensors where designed but not implemented, we developed an emulator (software) for the hardware sensors meeting the exact specification as well as parts of the server solution. This allowed proceeding with the server-side development, testing, and system validation without the hardware sensors in place. Following the exact specification should allow replacing the emulator with the real sensors without complications, once they are available. In the end, being able to develop hard- and software in parallel the project can be in production much earlier than performing the development in sequence. Disclaimer: this paper is written under a non-disclosure agreement. This is why certain details are omitted in the thesis, but available to the project partner. Keywords: emulation, sensor-based IT system, data acquisition, personal alert, Short Message Service (SMS) gateway. iii Contents 1 Introduction ................................................................................................................... 1 1.1 Problem and Motivation......................................................................................... 1 1.2 Goals, Criteria and Constrains................................................................................ 1 1.3 Outline .................................................................................................................... 2 2 Background Knowledge ................................................................................................ 3 2.1 Preliminary Research.............................................................................................. 3 2.2 Choice of Technologies.......................................................................................... 3 2.2.1 Main programming language........................................................................... 3 2.2.2 Technology for building Web User Interface.................................................. 4 2.2.3 RDBMS ........................................................................................................... 4 2.2.4 Application Server........................................................................................... 5 2.2.5 Tool for Automation Build.............................................................................. 5 2.2.6 Framework for Work With SMS..................................................................... 5 2.2.7 High Level Design Pattern for the Web Application ...................................... 5 2.2.8 Development Methodology............................................................................. 6 2.3 System Terminology .............................................................................................. 6 2.3.1 Sensor .............................................................................................................. 6 2.3.2 Alarms ............................................................................................................. 6 2.3.3 Responsible Persons and Messages................................................................. 7 2.3.4 SMS Gateway and 3G/GSM Modem.............................................................. 7 3 Features and Requirements............................................................................................ 8 3.1 Types of Users........................................................................................................ 8 3.2 Messages................................................................................................................. 9 3.2.1 System Messages............................................................................................. 9 3.2.2 Notification Messages ..................................................................................... 9 3.3 Use Cases.............................................................................................................. 10 3.3.1 Data Acquisition............................................................................................ 10 3.3.2 Emergency Situation Detected by Sensor ..................................................... 11 3.3.3 Emergency Situation Detected by Server...................................................... 11 3.3.4 Hardware Problems ....................................................................................... 12 3.4 Requirements for Emulator .................................................................................. 13 4 Architecture ................................................................................................................. 14 4.1 System Architecture and Behavior....................................................................... 14 4.2 Emulator ............................................................................................................... 17 4.2.1 MVP Architecture ......................................................................................... 17 4.2.2 Emulator Behavior......................................................................................... 19 4.3 SMS Gateway....................................................................................................... 21 5 Implementation............................................................................................................ 24 5.1 Converting of Values............................................................................................ 24 5.2 E-mail Sending ..................................................................................................... 24 5.3 Enumeration of Sensor Commands...................................................................... 25 5.4 Handling Client Request to the Server ................................................................. 26 5.5 Custom Widgets ................................................................................................... 27 5.6 UIBinder ............................................................................................................... 28 5.7 SMS Sending........................................................................................................ 28 6 Testing ......................................................................................................................... 30 6.1 Testing Approach ................................................................................................. 30 6.2 Testing of Data Acquisition.................................................................................. 30 6.3 Testing of Emergency Situation Detected by Sensor........................................... 30 iv 6.4 Testing of Emergency Situation Detected by Server............................................ 31 6.5 Testing of Hardware Problems............................................................................. 32 7 Summarize................................................................................................................... 34 7.1 Conclusions .......................................................................................................... 34 7.2 Future works......................................................................................................... 35 References ...................................................................................................................... 36 Appendix A. User Manual for Sensor Emulator .......................................................... A-1 Appendix B. Administrator Manual for Sensor Emulator............................................ B-1 v List of Figures 4.1: General system architecture .................................................................................... 14 4.2: More detailed system architecture........................................................................... 15 4.3: Classic MVP............................................................................................................ 18 4.4: Simplified emulator client side architecture............................................................ 19 4.5: Sending Regular messages from emulator