Download presentation
Presentation is loading. Please wait.
1
CSE1301 Computer Programming: Lecture 21 Software 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
Components of the Software Development Process: Define the problem clearly Analyse the problem Design an algorithm top-down / bottom-up design Document the system Code (Implement) the algorithm Test the code Recall:
6
Development Approach: Water-Fall Model AnalysisDesignImplementTest Requires that each stage be completed before beginning next stage.
7
Development Approach: Incremental Model AnalysisDesignImplementTest Increments from simplified version with limited functionality to complete system. At each stage: prototype.
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
Example 1 Structure chart with labels showing data coupling inviteToParty ( name, date, venue ) { ringUp ( name ) askToParty (date, venue ) sayGoodbye ( name ) } askToPartysayGoodbyeringUp inviteToParty name date venue name venue control coupling data coupling
14
searchAddrBook ringUp ( name ) { set number to result of searchAddrBook ( name ) pick up the phone dial number say “Hello name, it’s Jim” } Example 2 Structure chart with labels showing data coupling ringUp etc... name number name 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 Not cohesive. contact ( company, message, mode ) { if mode is by fax { sendFax ( company, message) } else if mode is by email { sendEmail ( company, message) } printAddressBook ( ) }
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 Software Engineering topics continued in Lectures 27-29 and Group project. To be continued...
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.