software engineering principles
play

Software Engineering Principles Ch 03 1 Outline Principles form - PowerPoint PPT Presentation

Software Engineering Principles Ch 03 1 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


  1. Software Engineering Principles Ch 03 1

  2. 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 Ch 03 2

  3. 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. Ch 03 3

  4. A visual representation Tools Methodologies Methodologies Methods and techniques Principles Principles • Principles apply to process and product • Principles become practice through methods and techniques Ch 03 4

  5. Key principles • Rigor and formality • Separation of concerns • Modularity • Abstraction • Anticipation of change • Generality • Incrementality Ch 03 5

  6. 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 Ch 03 6

  7. 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. Ch 03 7

  8. Example: process • Rigorous documentation of development steps helps project management and assessment of timeliness Ch 03 8

  9. 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. Ch 03 9

  10. 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 Ch 03 10

  11. 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 Ch 03 11

  12. 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 Ch 03 12

  13. A visual representation (a)(b) high coupling low coupling Ch 03 13

  14. 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 Ch 03 14

  15. 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) Ch 03 15

  16. 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 Ch 03 16

  17. 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 Ch 03 17

  18. 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. Ch 03 18

  19. 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. Ch 03 19

  20. 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. Ch 03 20

  21. 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 Ch 03 21

  22. Case study: compiler • Compiler construction is an area where Case Study: Compiler systematic (formal) design methods have been developed – e.g., BNF for formal description of language syntax Ch 03 22

  23. Separation of concerns: examples • Functional qualities: – When designing different components of a compiler, you concentrate on one at a time. For Case Study: Compiler 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 ) Ch 03 23

  24. Modularity example • Compilation process decomposed into Case Study: Compiler phases – Lexical analysis – Syntax analysis (parsing) – Code generation • Phases can be associated with modules Ch 03 24

  25. Representation of modular structure Lexical Case Study: Compiler Symbol Language diagnostic table grammar s Lexical Source Object analysis Parsing Code code code generation Parse tree “Tokenized” code Syntax diagnostics Boxes represent modules, and Ch 03 25 arrows represent flow of data

  26. Module decomposition may be iterated further modularization of code-generation module Case Study: Compiler Symbol table Code genration Object Intermediate code code Intermediate Machine code Parse code generation generation tree Ch 03 26

  27. Abstraction • Applied in many cases Case Study: Compiler – 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 Ch 03 27

  28. Anticipation of change • Consider possible changes of: Case Study: Compiler – source language (due to standardization committees) – target processor – I/O devices Ch 03 28

  29. Generality • Parameterize with respect to target Case Study: Compiler 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 Ch 03 29

  30. Incrementality • Incremental development Case Study: Compiler – 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 Ch 03 30

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend