Docsity

Software Engineering Concepts, Lecture notes of Software Engineering

Partial preview of the text

Download Software Engineering Concepts and more Lecture notes Software Engineering in PDF only on Docsity!

Department Of Computer Science

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

Coding

ā—¼ At the end of the design phase we have: ā—¼ module structure (e.g. structure chart) of the system ā—¼ module specifications:

ā—¼ data structures and algorithms for each module.

ā—¼ 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