0% found this document useful (0 votes)
11 views18 pages

08 - Coding Process and Convention

The document discusses coding process and conventions. It describes the coding process as having steps like planning, coding library modules, coding functional modules, integrating modules, and creating documentation. It emphasizes the importance of coding conventions for readability and maintainability. Common conventions covered include indentation, line lengths, comments, and naming. The document provides examples of naming conventions and formatting standards for variables, methods, and other programming elements.

Uploaded by

mrjn2p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views18 pages

08 - Coding Process and Convention

The document discusses coding process and conventions. It describes the coding process as having steps like planning, coding library modules, coding functional modules, integrating modules, and creating documentation. It emphasizes the importance of coding conventions for readability and maintainability. Common conventions covered include indentation, line lengths, comments, and naming. The document provides examples of naming conventions and formatting standards for variables, methods, and other programming elements.

Uploaded by

mrjn2p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

502045

Software Engineering
Chapter 07
Lesson 08: Coding Process and Convention

July 30, 2020 502045 - Coding Process and Convention 1


Coding Process and Convention

• Agenda
– Coding Process
– Coding Convention

July 30, 2020 502045 - Coding Process and Convention 2


Coding Process - Where the Coding is?

July 30, 2020 502045 - Coding Process and Convention 3


Coding Process - Coding Workflow

Start Plan

Code Library
Modules

Code Functional
Modules

Integrate Create System


Components Description

Code Functional
Finish
Modules

July 30, 2020 502045 - Coding Process and Convention 4


Coding Process - Code Planning

• Purpose: To plan and prepare for coding


• Steps:
– Study design documents.
– Define and prepare resources and infrastructure for
coding, unit test and integration, if necessary.
– Create coding plan including targets, scope, required
deliverables and acceptance criteria.
– Task and schedule, responsibilities.
– Review and obtain agreement on coding plan.
– Develop/customize coding convention.
– Review & conduct training on coding convention.
– Verify tools support for coding (if any).
July 30, 2020 502045 - Coding Process and Convention 5
Coding Process - Coding Library
Modules

• Purpose: To build, construct and/or


develop library modules
• Steps:
– Create detail design for library modules.
– Review code of library modules.
– Fix defects of library modules.
– Summarize related documents.

July 30, 2020 502045 - Coding Process and Convention 6


Coding Process - Coding
Functional Modules

• Purpose: To build, construct and/or


develop functional modules
• Steps:
– Create detail design for modules and program
units, if required in design documents.
– Code modules and program units.
– Review code.
– Fix defects for modules and program units.
– Summarize and submit result to Team Lead.
July 30, 2020 502045 - Coding Process and Convention 7
Coding Process - Integrate
Software Modules

• Purpose: assemble the software package


from the software modules, ensure that the
software package, as integrated and functions
properly
• Steps:
– Create integration plan (if needed)
– Integrate modules
– Evaluate integration results, conduct cause
analysis, raise change request (if needed)
– Review and approve results of integration
July 30, 2020 502045 - Coding Process and Convention 8
Coding Process - Create System
Description

• Purpose: To develop System Description / User


Manual documents that support in software
operation
• Steps:
– Make overview on system
– Describe sub-systems and main functions
– Describe system requirements
– Describe software structure
– Develop User Manual
– Review and approve System Description/User Manual

July 30, 2020 502045 - Coding Process and Convention 9


Coding Process - Deliver &
Summarize

• Purpose: To deliver software package


• Steps:
– Review, do final inspection [carefully check]
and summarize software products including
documents
– Deliver to test team
– Create coding summary report
– Maintain documents, records

July 30, 2020 502045 - Coding Process and Convention 10


Coding Convention - Introduction

• Be specific to each programming language


• Recommend programming style, practices, and methods
for each aspect of a piece program
• Common conventions may cover the following areas:
– file organization
– naming conventions
– indentation, white space
– comments, declarations, statements
– programming practices, principles, rules of thumb

July 30, 2020 502045 - Coding Process and Convention 11


Coding Convention - Importance

• Code conventions are important to


programmers for a number of reasons:
– 80% lifetime software cost is for maintenance
– People maintain the software may be
changed
– Following coding convention strictly helps:
• Improve the readability of the software
• Allowing engineers to understand new code more
quickly and thoroughly

July 30, 2020 502045 - Coding Process and Convention 12


Coding Convention - Some
Common Standards 1/3
• Tab and Indent
– 4 spaces should be used as the unit of indentation
– Tab characters should be avoided
• Line Length: avoid lines longer than 80 or 120 characters
• Wrapping Lines: When an expression will not fit on a single
line, break it according to below principles:
– Break after a comma
– Break after a logical operator
– Break before an operator
– Prefer higher-level breaks to lower-level breaks
• Comments: beginning, block, single-line, trailing
• Number of declarations per line: same types, different types

July 30, 2020 502045 - Coding Process and Convention 13


Coding Convention - Some
Common Standards 2/3

• Blank Lines improve readability by setting off sections of


code that are logically related
– Two blank lines should always be used:
• Between sections of a source file
• Between class and interface definitions
– One blank line should always be used:
• Between methods
• Between the local variables in a method and its
first statement
• Before a block or single-line comment
• Between logical sections inside a method
July 30, 2020 502045 - Coding Process and Convention 14
Coding Convention - Some
Common Standards 3/3

• Blank spaces should be used in the


following circumstances
– A keyword followed by a parenthesis should
be separated by a space
– A blank space should appear after commas in
argument lists
– All binary operators except . should be
separated from their operands by spaces

July 30, 2020 502045 - Coding Process and Convention 15


Coding Convention - Naming
Conventions 1/2

• General naming rules:


– Should be functionally meaningful, & indicate
identifier’s purpose
– Use terminology applicable to the domain
– Identifiers must be as short as possible (<=20
characters)
– Avoid names that are similar or differ only in
case
– Abbreviations in names should be avoided

July 30, 2020 502045 - Coding Process and Convention 16


Coding Convention - Naming
Conventions 2/2

• Use a noun or noun phrase to name a class or


code module
• Variables names must start with lowercase
• Constants: named in uppercase letters, might
have underscore
• Method names must start with lowercase letter,
usually use “active verb” as the first word of
method name
• Instance /object names follow rules of variable
names
July 30, 2020 502045 - Coding Process and Convention 17
July 30, 2020 502045 - Coding Process and Convention 18

You might also like