{%hackmd @themes/orangeheart %} # CST 104 Lec 5 ## Software Engineering - engineering discipline that is concerned with all aspects of software production - using approriate theories and methods to solve problems - technical process of developement, project management, etc to support software production ## Software Products ### Generic vs Customized | Types | Target | Examples | Software Changes | | - | - | - | - | | Generic | any customer | project management tools, CAD, etc | by the developer only | Customized | specific customer | embedded control systems, etc | under customer request ## Software Costs Software development often costs way more than hardware, this is due to frequent maintenance issues that require massive resources to resolve in the long term. Hence, **implementing a cost-effective software development is crucial to build softwares that run cheaper in the long run.** ## Software Engineering Process The formal process of developing large projects is facilitated through a clear 5 step approach: ```mermaid flowchart LR; Requirements --> Design --> Implementation --> Verification --> Maintenance ``` It requires collaboration and efficient management, where this principle is applied through **Softwaree Development Life Cycle (SDLC).** ## Software Development Life Cycle (SDLC) Life cycles exist to maintain large-scale softwares: ### Before Implementation **Feasibility Study** - assess costs and benefits - consider if the project is cost-effective - consider alternatives - create something from another way **Problem Specification** - statement of problems to be solved - documentation of problems specified - consider all scenarios **Program Design Phase** - **divide-and-conquer and decomposition approach** - break into tasks and subtasks - documentation of tasks graphically **Algorithm Selection or Development and Analysis** - design algorithm for each task - analyze it's efficiency - provide pseudocode and efficiency report ### Implementation **Coding** - translate pseudocode to working code **Debugging** Types of errors: - **Syntax Errors: Grammatical errors in code** - **Runtime Errors: illegal operations** - exp: dividing by 0 - **Logic Errors: does not perform as expected** ### After Implementation Testing, verification and benchmarking: - **Emphirical Testing: test suite to check correctness** - **Unit Testing: test each module/subtask** - **Integration Testing: test how modules work together** - **Regression Testing: test when changes are updated** **Program Verification** - Benchmarking: check performance on inputs **Documentation** Document each phase of the project along the process of engineering a software. - **Internal:** comments in code - **External:** everything during the phase before implementation - **Technical:** information for programmers to understand the code - **User:** helps users run programs **Program Maintenance** - add features, fix bugs and improve performance ## Integrated Development Environment (IDE) IDE consists of these features to significantly speed up program development: - program editor: create program - file manager: store program - compiler / interpreter: translate program to machine language - debugger: help locate errors **Rapid Prototyping** GUI: - shown to prospective users during initial stage of development - allows any miscommunication between user and programmer to be resolved quickly Software packages: - track requirements from initial specification through the design process to final code - version control system: track code versions ## Other Software Engineering Methodologies ### Agile Software Development - problem specification doesn't exists - change is expected and resolved in an agile way ## Software Engineering Diversity Software engineering methods and tools **depend on the type of application being developed:** - customer requirements - development team background ## Application Types ### Standalone Software - includes all necessary functionality - can work offline ### Interactive or Online Transcation Processing System (OLTP) - access and execute remotely - web-based or remote systems - exp: e-commerce applications, financial transcation systems ### Embedded Control Systems - control and manage hardware devices ### Batch Processing Systems - non-interactive systems - process large data to create corresponding outputs ### Entertainment Systems - handle graphics, audio, video, etc - based on entertainment purposes ### Modeling and Simulation - model physical process or situations - interactive objects - model and simulate system engineering ### Data Collection Systems - collect data from an environment - using sensors - send data for analysis and processing ### Systems of systems - composed of software systems - collection of task-oriented systems to build a complex system - system of systems engineering ## Software Engineering and The Web **Web-based systems (complex distributed systems) and web services** allow application functionality to be accessed over the web. Fundamental software engineering principles still apply to web-based software **Cloud Computing** ### Web Software Engineering **Software reuse is the main approach to constructing web-based systems:** - assemble from pre-existing software components and systems - impractical to specify all requirements for such system **User interfaces are constrained by the capabilities of web browsers** - **AJAX** (difficult to use) - local scripting are more commonly used ## Software Engineering Ethics ### Honesty and Ethics Ethical behaviour is more than simply upholding the law: - following a set of ethically principles that are morally correct **Intellectual Property Rights** - aware of local laws governing the use of intellectual - ensure that the intellectual property of employers and clients is protected **Computer Misuse** - **must not use their technical skills to do harm** ### Ethical Dilemmas **Red flags:** - disagreement with the policies set by senior management - unethical employer: - releases safety-critical system without finishing tests - participation in development of military weapons and nuclear systems ## ACM/IEEE Code of Ethics **ACM/IEEE-CS Joint Task Force** Professional socities in US cooperated to produce code practice: > Software engineers should be committed to making the *analysis, specification, design, development, testing and maintenance of software a beneficial and respected profession* in accordance to the health, safety and welfare of the public, software engineers shall adhere to the **Eight Principles.** - **PUBLIC - Software engineers shall act consistently with the public interest.** - **CLIENT AND EMPLOYER - Software engineers shall act in a manner that is in the best interests of their client and employer consistent with the public interest.** - **PRODUCT - Software engineers shall ensure that their products and related modifications meet the highest professional standards possible.** - **JUDGEMENT - Software engineers shall maintain integrity and independence in their professional judgment.** - **MANAGEMENT - Software engineering managers and leaders shall subscribe to and promote an ethical approach to the management of software development and maintenance.** - **PROFESSION - Software engineers shall advance the integrity and reputation of the profession consistent with the public interest.** - **COLLEAGUES - Software engineers shall be fair to and supportive of their colleagues.** - **SELF - Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.** ## Case Studies Refer to PPT