
















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Coding Standards for software engineers
Typology: Lecture notes
1 / 56
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