
















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















































Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi 1
Lecture - 10 CODING Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi (^2)
Important design considerations ā¼ Support multiple skill levels ā¼ Minimize memorization ā¼ Design based on metaphors ā¼ Most common operations should be organized such that: ā¼ these are fastest to detect and use. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
Coding Phase ā¼ Coding is undertaken once design phase is complete. ā¼ During coding phase: ā¼ every module identified in the design document is coded and unit tested. ā¼ Unit testing (aka module testing): ā¼ testing of different modules (aka units) of a system in isolation. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
ā¼ At the end of the design phase we have: ā¼ module structure (e.g. structure chart) of the system ā¼ module specifications:
ā¼ Objective of coding phase: ā¼ transform design into code ā¼ unit test the code. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
Coding Standards ā¼ Good software development organizations require their programmers to: ā¼ adhere to some standard style of coding ā¼ called coding standards. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
Coding Standards ā¼ Advantage of adhering to a standard style of coding: ā¼ it gives a uniform appearance to the codes written by different engineers, ā¼ it enhances code understanding, ā¼ encourages good programming practices. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
Coding Standards ā¼ A coding standard ā¼ sets out standard ways of doing several things: ā¼ the way variables are named, ā¼ code is laid out, ā¼ maximum number of source lines allowed per function, etc. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
Code inspection and code walk throughs ā¼ After a module has been coded, ā¼ code inspection and code walk through are carried out ā¼ ensures that coding standards are followed ā¼ helps detect as many errors as possible before testing. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
ā¼ Detect as many errors as possible during inspection and walkthrough: ā¼ detected errors require less effort for correction ā¼ much higher effort needed if errors were to be detected during integration or system testing. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi Code inspection and code walk throughs
Representative Coding Standards ā¼ Rules for limiting the use of globals: ā¼ what types of data can be declared global and what can not. ā¼ Naming conventions for ā¼ global variables, ā¼ local variables, and ā¼ constant identifiers. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
Representative Coding Standards ā¼ Contents of headers for different modules: ā¼ The headers of different modules should be standard for an organization. ā¼ The exact format for header information is usually specified. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
Representative Coding Standards ā¼ Error return conventions and exception handling mechanisms. ā¼ the way error and exception conditions are handled should be standard within an organization. ā¼ For example, when different functions encounter error conditions ā¼ should either return a 0 or 1 consistently. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi
Representative Coding Guidelines ā¼ Do not use too clever and difficult to understand coding style. ā¼ Code should be easy to understand. ā¼ Many inexperienced engineers actually take pride: ā¼ in writing cryptic and incomprehensible code. Software Engineering Concepts-CSC291-Fall- 2018 Mr. Tehseen Riaz Abbasi