Download presentation
Presentation is loading. Please wait.
Published byLinette Booth Modified over 9 years ago
1
Ch 031 Software Engineering Principles
2
Ch 032 Outline Principles form the basis of methods, techniques, methodologies and tools Seven important principles that may be used in all phases of software development Modularity is the cornerstone principle supporting software design Case studies
3
Ch 033 Some definitions Methods: –General guidelines that govern the execution of some activity; methods are rigorous, systematic, and disciplined approaches. Technique: –Techniques and methods are used interchangeably. –Techniques are more technical and mechanical than methods; often they also have more restricted applicability. –Methods and techniques are packaged to form methodology. Methodology: –used to promote a certain approach to solving a problem by pre-selecting the methods and techniques to be used. Tools: –Developed to support the application of techniques, methods, and methodologies.
4
Ch 034 A visual representation Principles apply to process and product Principles become practice through methods and techniques
5
Ch 035 Key principles Rigor and formality Separation of concerns Modularity Abstraction Anticipation of change Generality Incrementality
6
Ch 036 Rigor and formality Software engineering is a creative design activity, BUT It must be practiced systematically Rigor is a necessary complement to creativity that increases our confidence in our developments Formality is rigor at the highest degree –software process driven and evaluated by mathematical laws
7
Ch 037 Examples: product Mathematical (formal) analysis of program correctness –By specifying the program using a formal specification (Z, B-method, Temporal logic,..) and check specific properties. Systematic (rigorous) test data derivation: –Test data that covers most significant cases.
8
Ch 038 Example: process Rigorous documentation of development steps helps project management and assessment of timeliness
9
Ch 039 Separation of concerns Tackles with the complexity of large systems, by separating different issues to concentrate on one at a time (Divide & Conquer) Supports parallelization of efforts and separation of responsibilities. Separation of concern at functional and non- functional activities: –Functional (views): function, data, network, deployment, process, etc. –Non-functional (qualities): correctness, efficiency, reliability, etc.
10
Ch 0310 Example: process / product Process: go through phases one after the other (as in waterfall) –Applies separation of concerns by separating activities with respect to time Product: keep product requirements separate –functionality –performance –user interface and usability
11
Ch 0311 Modularity A complex system may be divided into simpler pieces called modules A system that is composed of modules is called modular Supports application of separation of concerns –when dealing with a module we can ignore details of other modules
12
Ch 0312 Cohesion and coupling Each module should be highly cohesive –module must be understandable as a meaningful unit (i.e., it provides a single functionality) –Elements (i.e., functions) of a module are closely related to one another, in terms of sharing similar attributes. Modules should exhibit low coupling –modules have low interactions with others –understandable separately –More maintainable, low change propagation
13
Ch 0313 A visual representation high coupling low coupling
14
Ch 0314 Abstraction Identify the important aspects of a phenomenon and ignore its details Special case of separation of concerns The type of abstraction to apply depends on purpose Example : the user interface of a watch (its buttons) abstracts from the watch's internals for the purpose of setting time; other abstractions needed to support repair
15
Ch 0315 Abstraction ignores details Example: equations describing complex circuit (e.g., amplifier) allows designer to reason about signal amplification Equations may approximate description, ignoring details that yield negligible effects (e.g., connectors assumed to be ideal)
16
Ch 0316 Abstraction yields models For example, when requirements are analyzed we produce a model of the proposed application The model can be a formal or semiformal description It is then possible to reason about the system by reasoning about the model
17
Ch 0317 An example Programming language grammar described through an abstract syntax (e.g., statement, expression, term) ignores details of different programs that can be generated by the same grammar. –abstraction ignores details such as precision of number representation or addressing mechanisms
18
Ch 0318 Abstraction in process When we do cost estimation we only take some key factors into account We reuse the results of previous similar cases for the new cost estimation, and ignore the differences among similar cases.
19
Ch 0319 Anticipation of change A basis for software evolution that requires anticipating potential future changes Examples: –Set up a configuration management environment for the project to take care of different changes in future (vs. having a fix system configuration). –Anticipate the expansion of a company by considering reserve fields for the attributes of different stakehoders in the company. –In desinging MicroProcessors, several registered are reserved for future expansions (versions) of the processor.
20
Ch 0320 Generality While solving a problem, try to discover if it is an instance of a more general problem whose solution can be reused in other cases Carefully balance generality against performance and cost Sometimes a general problem is easier to solve than a special case E.g., defining a general tree traversal algorithm that receives a tree and a method of traversal (pre-order, in-order, post-order) to traverse every tree. As opposed to define three different methods. Even more general, to desing an Iterator algorithm.
21
Ch 0321 Incrementality Process proceeds in a stepwise fashion (increments) Examples (process) –deliver subsets of a system early to get early feedback from expected users, then add new features incrementally –deal first with functionality, then turn to performance and other (non-functional) qualities. –deliver a first prototype and then incrementally add effort to turn prototype into product
22
Ch 0322 Case study: compiler Compiler construction is an area where systematic (formal) design methods have been developed –e.g., BNF for formal description of language syntax Case Study: Compiler
23
Ch 0323 Separation of concerns: examples Functional qualities: –When designing different components of a compiler, you concentrate on one at a time. For example, in designing lexical scanner to tokenize program’s text, you don’t consider the method of parsing (e.g., LR, LL, or LALR parser). Non-functional qualities: –When designing optimal register allocation algorithms (runtime efficiency) no need to worry about runtime diagnostic messages (user friendliness) Case Study: Compiler
24
Ch 0324 Modularity example Compilation process decomposed into phases –Lexical analysis –Syntax analysis (parsing) –Code generation Phases can be associated with modules Case Study: Compiler
25
Ch 0325 Representation of modular structure Boxes represent modules, and arrows represent flow of data Case Study: Compiler Language grammar
26
Ch 0326 Module decomposition may be iterated further modularization of code-generation module Case Study: Compiler
27
Ch 0327 Abstraction Applied in many cases –abstract syntax to neglect syntactic details such as begin…end vs. {…} to bracket statement sequences –intermediate machine code (e.g., Java Bytecode) for code portability Case Study: Compiler
28
Ch 0328 Anticipation of change Consider possible changes of: –source language (due to standardization committees) –target processor –I/O devices Case Study: Compiler
29
Ch 0329 Generality Parameterize with respect to target machine (by defining intermediate code) Develop compiler generating tools (compiler compilers) instead of just one compiler: –Given a language Grammar the tool produces a language to parse Case Study: Compiler
30
Ch 0330 Incrementality Incremental development –deliver first a kernel version for a subset of the source language, then increasingly larger subsets –deliver compiler with little or no diagnostics/optimizations, then add diagnostics/optimizations Case Study: Compiler
31
Ch 0331 Case study (system engineering): elevator system In many cases, the "software engineering" phase starts after understanding and analyzing the "systems engineering” issues The elevator case study illustrates the point Case Study: Elevator
32
Ch 0332 Rigor & formality (1) Quite relevant: it is a safety critical system – Define requirements must be able to carry up to 400 Kg. (safety alarm and no operation if overloaded) emergency brakes must be able to stop elevator within 1 m. and 2 sec. in case of cable failures –Later, verify their fulfillment Case Study: Elevator
33
Ch 0333 Separation of concerns Try to separate –safety –performance –usability (e.g, button illumination) –Cost Although some are strongly related –cost reduction by using cheap material can make solution unsafe Case Study: Elevator
34
Ch 0334 A modular structure Elevator Control apparatus B3 B2 B1 buttons at floor i Case Study: Elevator
35
Ch 0335 Module decomposition may be iterated Elevator Engine Brakes Cabin Internal Buttons Control apparatus Case Study: Elevator
36
Ch 0336 Abstraction The modular view we provided does not specify the behavior of the mechanical and electrical components –they are abstracted away Case Study: Elevator
37
Ch 0337 Anticipation of change, generality Make the project parametric with respect to the number of elevators (and floor buttons) El eva tors C ontr o l appa ra t u s F loor butt ons Case Study: Elevator
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.