1 / 22

CSE1301 Computer Programming: Lecture 21 Software Engineering

CSE1301 Computer Programming: Lecture 21 Software Engineering. Topics. Software Engineering tools and techniques Prototyping Structure Charts Coupling Control coupling Data coupling Reading: Brookshear 6-2, 6-3. Software Engineering. Structured development of software systems

wynonna
Télécharger la présentation

CSE1301 Computer Programming: Lecture 21 Software Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE1301 Computer Programming: Lecture 21Software Engineering

  2. Topics • Software Engineering tools and techniques • Prototyping • Structure Charts • Coupling • Control coupling • Data coupling Reading: Brookshear 6-2, 6-3

  3. Software Engineering • Structured development of software systems • Examples:software for banking, stock exchange, space probe control, toll charge, operating system, games • Tools and Techniques • Structured process rather than trial-and-error. • Important goal: eliminate errors. • “Engineering” • Zero tolerance to error. • Pre-fabricated components. • Re-usable components.

  4. Software Engineering • Tasks • project planning (cost, schedule, personnel) • project management • documentation • prototyping and simulation • interface design • programming • testing • Computer-Aided Software Engineering (CASE) Tools

  5. Recall: Components of the Software Development Process: • Define the problem clearly • Analyse the problem • Design an algorithm • top-down / bottom-up design • Code (Implement) the algorithm • Test the code • Document the system

  6. Development Approach:Water-Fall Model • Requires that each stage be completed before beginning next stage. Analysis Design Implement Test

  7. Development Approach:Incremental Model • Increments from simplified version with limited functionality to complete system. • At each stage: prototype. Analysis Design Implement Test

  8. Prototyping • Construction of simplified version of parts of the proposed system that can be analyzed before further development. • Types of items that can be prototyped: • screen and report format, database and file structures, system protocols. • Types of prototyping • throwaway, evolutionary

  9. Modularity • Top-down analysis and design. • Break problem down into manageable sub-problems.

  10. Modularity • Top-down analysis and design. • Break problem down into manageable sub-problems.

  11. Structure Chart • Pictorial representation of a modular structure • each module represented by a rectangle • arrows represent dependencies between modules

  12. Coupling • Links and dependencies between modules • Control coupling: • when one module passes control to another • Examples: function call, return • Data coupling: • sharing of data between modules. • Examples: function parameters, return values

  13. name name name venue venue date inviteToParty name ringUp askToParty sayGoodbye Example 1 Structure chart with labels showing data coupling inviteToParty ( name,date , venue ) { ringUp ( name) askToParty (date , venue ) sayGoodbye ( name ) } control coupling data coupling

  14. name etc... ringUp name number searchAddrBook Example 2 Structure chart with labels showing data coupling ringUp ( name) { set number to result of searchAddrBook ( name ) pick up the phone dial number say “Hello name, it’s Jim” } return value

  15. Notes on Coupling • Aim: maximize module independence = minimize coupling. • Use of global variables is a form of implicit data coupling: dangerous! • It is NOT recommended to have global variables in your program.

  16. Notes on Coupling • How is control coupling represented in code? • Function call: When a function is called, control is passed to that function. • Function return: When the code in a function has been executed, control is returned to the code that called the function. • How is data coupling represented in code? • Parameters: Data sent to a function via parameters. • Return Values: Data returned from function using "return".

  17. Cohesion • Internal binding within function. • Logical cohesion (weaker) • Internal elements perform activities that are logically similar. • Example: I/O function • Functional cohesion (stronger) • all parts are geared towards single activity • Aim: high intra-module cohesion

  18. Example 1 contact ( company , message, mode ) { if mode is by fax { sendFax ( company , message) } else if mode is by email { sendEmail ( company , message) } } Cohesive.

  19. Example 2 contact ( company , message, mode ) { if mode is by fax { sendFax ( company , message) } else if mode is by email { sendEmail ( company , message) } printAddressBook ( ) } Not cohesive.

  20. Structure Chart Examples: • MaxAndMin • IsPalindrome • ContinuingFraction • Factorial

  21. Function interactions • Some systems are not hierarchical in nature. • Two functions interacting as equals. • Superior function relies on subordinates to perform its task. • Recursive functions are not well represented --- need to have loops.

  22. Summary • Modularity is crucial for developing large software projects • Structure charts represent functions and the dependencies between them To be continued ... • Software Engineering topics continued in Lectures 27-29 and Group project.

More Related