SlideShare une entreprise Scribd logo
1  sur  33
B. Computer Sci. (SE) (Hons.)

CSEB233: Fundamentals of
Software Engineering
Software Implementation
& Coding
Objectives
 Explain

what is software construction and why it is
important
 Describe good programming principles/practices
 Explain the concept of ‗defensive programming‘
 Describe software inspection as a static method to
discover defects, errors or problems
 Explain the concepts, benefits and problems of
software reuse
What is Software Construction?
 ‗Construction‘ refers

to the hands-on part of creating

something
 Include implementation/coding and debugging; and
verification and validation
 Generally focus at coding, debugging, some
detailed design and some testing (esp. unit testing)
 Quality of construction substantially affects the
quality of the software
What is Software Construction?


According to McConnell (1993), construction may
involve:
Verifying that the groundwork has been laid so that
construction can proceed successfully
 Designing and writing routines and modules
 Selecting and creating data types and naming identifiers
 Selecting control structures and organizing blocks of
statements
 Finding and fixing errors

What is Software Construction?
 According

involve:

to McConnell (1993), construction may

Reviewing other team members‘ design and code and
having them review yours
 Polishing the code – formatting and writing comments
(i.e. internal documentation)
 Integrating software components (if built separately)
 Tuning the code – make it more efficient, smaller and
faster

Why is Software Construction
Important?


Depending on the size of project, construction may take
30% - 80% of the total project time


The larger the time spent, the bigger the work affect the
success of the project

Construction is the pivotal activity in software
development
 With a focus on construction, there is a great potential
for the average programmer‘s productivity to improve
(McConnel, 1993)

Why is Software Construction
Important?
Requirements document and design documents can go
out of date, but construction‘s by product, the source
code, is always up to date
 Ideally software project goes through requirements
engineering and modeling activities before construction
begins




Construction is the only activity that‘s guaranteed to be done!

(McConnel, 1993)
Coding Principles
 Coding

principles and concepts are closely aligned
programming style, programming languages, and
programming methods
 Before you write one line of code, be sure you:
Understand of the problem you‘re trying to solve
 Understand basic design principles and concepts

Coding Principles
 Before

you write one line of code, be sure you:

Pick a programming language that meets the needs of
the software to be built and the environment in which it
will operate
 Select a programming environment that provides tools
that will make your work easier
 Create a set of unit tests that will be applied once the
component you code is completed

Coding Principles
 As

you begin writing code, be sure you:

Constrain your algorithms by following structured
programming practice
 Consider the use of pair programming
 Select data structures that will meet the needs of the
design
 Understand the software architecture and create
interfaces that are consistent with it
 Keep conditional logic as simple as possible

Coding Principles
 As

you begin writing code, be sure you:

Create nested loops in a way that makes them easily
testable
 Select meaningful variable names and follow other local
coding standards
 Write code that is self-documenting
 Create a visual layout (e.g., indentation and blank lines)
that aids understanding

Coding Principles
 After

you‘ve completed your first coding pass, be
sure to:
Conduct a code walkthrough when appropriate
 Perform unit tests and correct errors you‘ve uncovered
 Refactor the code


■

reorganization technique that simplifies the code without
changing its function or behaviour
Good Programming Practices


Start with a good design.





The program under development should be functioning at all
times




Update the design documents regularly
Create additional design documents before adding new major
features or functionality
The development process consists of adding new functionality
without breaking existing functionality

Work has to be divided into small incremental steps that can
be typically accomplished and code-reviewed in one day.


Even large-scale rewrites should be made incremental
Good Programming Practices


Every line of code written or modified undergoes peer review




The smallest team must contain at least two programmers so that
they can code-review each other's changes

Always attempt to work top-down in:




Design—start with high level objects
Implementation—create top-level objects using low-level stubs
Modification—change the top-level objects and the overall flow of
control first. If necessary, use stubs, or fake new functionality
using old implementation
(Source: http://relisoft.com/practice.html)
Good Programming Practices
 Be

consistent with formatting
 Be consistent with naming conventions
 Use global [identifiers] sparingly
 Don‘t assume output formats
 Add comment to your code – explain what and why
(Source: Kim Moser at http://relisoft.com/practice.html )
Good Programming Practices
 Provide

useful error messages
 Recover (or fail) gracefully
 Push interface up and implementation down
 Know what you don't know – prepare for changes
(Source: Kim Moser at http://relisoft.com/practice.html )
Defensive Progamming
 Defensive

programming is when the programmer
makes necessary assumptions and creates code
that anticipates potential problems and specification
changes
 A good defensive programmer is sufficiently
confident in his/her abilities to ignore the traditional
belief that ―If it isn‘t broke, don‘t fix it.‖
Defensive Progamming


Defensive programming involves:
finding problems in the existing code by identifying code
inconsistencies and understanding typical uses of the
software
 anticipating – and preempting – both potential problems with
the existing specifications as well as likely changes in user
behavior and design specifications, and
 streamlining the code to aid readability and simplify
maintainability
(Mehta, 2009)

Software Inspections
 An

‗old school‘ approach
 A process to review, analyze and check static
system representations such as requirements
document, design document, and program source
code to look for errors and problems


Static – need not run the software on a computer

 Generally,

focus at source code
Software Inspections
 Sometime

also known as peer reviews or program
/code inspections
 Inspections can check conformance with a specification but not conformance with the customer‘s real
requirements
 But, inspections cannot check non-functional characteristics such as performance, usability, etc.
Program/Code Inspection Process
 Focus

at detecting defects - logical errors and
anomalies in the code
 Program inspections are very effective in
discovering defects
 A formal process that involve team of several
members


Fagan originally developed this method at IBM in the
1970s with four suggested roles – author, reader, tester
and moderator
Advantages of Inspection over
Testing
A

single inspection session can discover many
errors


During program testing, errors can mask (hide) other
errors

 Incomplete

versions of a software can be inspected
without additional costs


To test an incomplete program, specialized test is
needed to test the parts that are available
(Sommerville, 2004)
Advantages of Inspection over
Testing
 Inspections

can search for program defects and
other quality attributes of a program


e.g., compliance to standard, maintainability, portability,
efficiency, etc.
(Sommerville, 2004)
Drawbacks/Issues related to
Inspections
Difficult to introduce formal inspections into software
development organizations
 Software engineers (programmers) with experience are
sometimes reluctant to accept that inspections can be
more effective for detecting defects (errors) than testing
 Managers may be sceptical as inspections require
extra costs during modelling and construction
 Inspections may take time to arrange and appear to
slow down the development process

Software Reuse
In most engineering disciplines, systems are designed
by composing existing components that have been
used in other systems
 Software engineering has been more focused on
original development
 It is now recognised that to achieve better software
quickly at lower cost, we need to adopt a design
process that is based on systematic reuse rather than
ad-hoc reuse


(Sommerville, 2004)
Reuse-based Software Engineering


Application system reuse




Component reuse




The whole of an application system may be reused either by
incorporating it without change into other systems (COTS
reuse) or by developing application families
Components of an application from sub-systems to single
objects may be reused

Object and function reuse


Software components that implement a single well-defined
function may be reused
Requirements for Reuse
 It

must be possible to find appropriate reusable
components
 The reuser of the component must be confident that
the components will be reliable and will behave as
specified
 The components must be documented so that they
can be understood and, where appropriate,
modified.
Benefits of Reuse


Increased dependability
Software/components/functions have been tried and tested
in working systems
 They should be more dependable than new software




Reduced process risk




Less uncertainty in development costs especially if large
software components are reused

Effective use of specialists
Reuse components instead of people
 The specialist can create reusable components

Benefits of Reuse
 Standards


compliance

Standards such as UI standard (e.g., drop-down menu)
can be implemented as reusable components to
improve dependability as users are less likely to make
mistake

 Accelerated


development

Avoid original development, speed-up production and
hence able to market product early
Reuse Problems
 Increased

costs

in understanding whether the application/component/
function is suitable for reuse
 in testing it to ensure its dependability and in maintaining
the reused item


 Lack

of CASE tool support
 Maintaining a component library can be expensive
Reuse Problems
 Not-invented-here


syndrome

Some software engineers may think that writing original
software is seen as more challenging than reusing other
people‘s software.

 Finding

and adapting reusable components
Summary
 You

have been introduced to:

good programming principles/practices
 the concept of ‗defensive programming‘
 software inspection as a static method to discover
defects, errors or problems
 the concepts, benefits and problems of software reuse

THE END
Copyright © 2013 Mohd. Sharifuddin Ahmad, PhD

College of Information Technology

Contenu connexe

Tendances

Process and Project Metrics-1
Process and Project Metrics-1Process and Project Metrics-1
Process and Project Metrics-1Saqib Raza
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software EngineeringZahoor Khan
 
Software engineering principles in system software design
Software engineering principles in system software designSoftware engineering principles in system software design
Software engineering principles in system software designTech_MX
 
software engineering models
software engineering models software engineering models
software engineering models mansab MIRZA
 
Process model in SE
Process model in SEProcess model in SE
Process model in SEsuranisaunak
 
Improving software economics
Improving software economicsImproving software economics
Improving software economicsdeep sharma
 
Software engineering note
Software engineering noteSoftware engineering note
Software engineering noteNeelamani Samal
 
Software systems engineering PRINCIPLES
Software systems engineering PRINCIPLESSoftware systems engineering PRINCIPLES
Software systems engineering PRINCIPLESIvano Malavolta
 
A generic view of software engineering
A generic view of software engineeringA generic view of software engineering
A generic view of software engineeringInocentshuja Ahmad
 
process models- software engineering
process models- software engineeringprocess models- software engineering
process models- software engineeringArun Nair
 
Software Engineering concept
Software Engineering concept Software Engineering concept
Software Engineering concept Atamjitsingh92
 

Tendances (20)

Slides chapter 1
Slides chapter 1Slides chapter 1
Slides chapter 1
 
SECh123
SECh123SECh123
SECh123
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 
Process and Project Metrics-1
Process and Project Metrics-1Process and Project Metrics-1
Process and Project Metrics-1
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Software engineering principles in system software design
Software engineering principles in system software designSoftware engineering principles in system software design
Software engineering principles in system software design
 
Slides chapters 21-23
Slides chapters 21-23Slides chapters 21-23
Slides chapters 21-23
 
software engineering models
software engineering models software engineering models
software engineering models
 
Process model in SE
Process model in SEProcess model in SE
Process model in SE
 
Improving software economics
Improving software economicsImproving software economics
Improving software economics
 
Software engineering note
Software engineering noteSoftware engineering note
Software engineering note
 
SOFTWARE ENGINEERING
SOFTWARE ENGINEERINGSOFTWARE ENGINEERING
SOFTWARE ENGINEERING
 
Software systems engineering PRINCIPLES
Software systems engineering PRINCIPLESSoftware systems engineering PRINCIPLES
Software systems engineering PRINCIPLES
 
Software Engineering by Pankaj Jalote
Software Engineering by Pankaj JaloteSoftware Engineering by Pankaj Jalote
Software Engineering by Pankaj Jalote
 
Slides chapters 24-25
Slides chapters 24-25Slides chapters 24-25
Slides chapters 24-25
 
Software engineering
Software engineering Software engineering
Software engineering
 
A generic view of software engineering
A generic view of software engineeringA generic view of software engineering
A generic view of software engineering
 
process models- software engineering
process models- software engineeringprocess models- software engineering
process models- software engineering
 
Software Engineering concept
Software Engineering concept Software Engineering concept
Software Engineering concept
 

En vedette

04 fse understandingrequirements
04 fse understandingrequirements04 fse understandingrequirements
04 fse understandingrequirementsMohesh Chandran
 
01 fse software&sw-engineering
01 fse software&sw-engineering01 fse software&sw-engineering
01 fse software&sw-engineeringMohesh Chandran
 
09 fse qualitymanagement
09 fse qualitymanagement09 fse qualitymanagement
09 fse qualitymanagementMohesh Chandran
 
05 fse requirementsengineering
05 fse requirementsengineering05 fse requirementsengineering
05 fse requirementsengineeringMohesh Chandran
 
Software Engineering Fundamentals - Svetlin Nakov
Software Engineering Fundamentals - Svetlin NakovSoftware Engineering Fundamentals - Svetlin Nakov
Software Engineering Fundamentals - Svetlin NakovSvetlin Nakov
 

En vedette (10)

04 fse understandingrequirements
04 fse understandingrequirements04 fse understandingrequirements
04 fse understandingrequirements
 
08 fse verification
08 fse verification08 fse verification
08 fse verification
 
01 fse software&sw-engineering
01 fse software&sw-engineering01 fse software&sw-engineering
01 fse software&sw-engineering
 
06 fse design
06 fse design06 fse design
06 fse design
 
02 fse processmodels
02 fse processmodels02 fse processmodels
02 fse processmodels
 
09 fse qualitymanagement
09 fse qualitymanagement09 fse qualitymanagement
09 fse qualitymanagement
 
05 fse requirementsengineering
05 fse requirementsengineering05 fse requirementsengineering
05 fse requirementsengineering
 
03 fse agiledevelopment
03 fse agiledevelopment03 fse agiledevelopment
03 fse agiledevelopment
 
Software Engineering Fundamentals - Svetlin Nakov
Software Engineering Fundamentals - Svetlin NakovSoftware Engineering Fundamentals - Svetlin Nakov
Software Engineering Fundamentals - Svetlin Nakov
 
Software design methodologies
Software design methodologiesSoftware design methodologies
Software design methodologies
 

Similaire à CSEB233 Software Engineering Fundamentals Construction Coding Principles

7a Good Programming Practice.pptx
7a Good Programming Practice.pptx7a Good Programming Practice.pptx
7a Good Programming Practice.pptxDylanTilbury1
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure rupeshchanchal
 
Mi0033 software engineering
Mi0033  software engineeringMi0033  software engineering
Mi0033 software engineeringsmumbahelp
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering Huda Alameen
 
Software engineering introduction
Software engineering introductionSoftware engineering introduction
Software engineering introductionVishal Singh
 
Elementary Probability theory Chapter 2.pptx
Elementary Probability theory Chapter 2.pptxElementary Probability theory Chapter 2.pptx
Elementary Probability theory Chapter 2.pptxethiouniverse
 
Software design.edited (1)
Software design.edited (1)Software design.edited (1)
Software design.edited (1)FarjanaAhmed3
 
Software engineering lecture notes
Software engineering   lecture notesSoftware engineering   lecture notes
Software engineering lecture notesGarima Singh
 
Software Engineering Fundamentals Svetlin Nakov
Software Engineering Fundamentals Svetlin NakovSoftware Engineering Fundamentals Svetlin Nakov
Software Engineering Fundamentals Svetlin Nakovnazeer pasha
 
Software engineering lecture notes
Software engineering   lecture notesSoftware engineering   lecture notes
Software engineering lecture notesAmmar Shafiq
 
term paper for cbd models
term paper for cbd modelsterm paper for cbd models
term paper for cbd modelsSukhdeep Singh
 
Software engineering
Software engineeringSoftware engineering
Software engineeringStella526835
 

Similaire à CSEB233 Software Engineering Fundamentals Construction Coding Principles (20)

Ch05
Ch05Ch05
Ch05
 
7a Good Programming Practice.pptx
7a Good Programming Practice.pptx7a Good Programming Practice.pptx
7a Good Programming Practice.pptx
 
Slides chapter 5
Slides chapter 5Slides chapter 5
Slides chapter 5
 
SE chapter 5
SE chapter 5SE chapter 5
SE chapter 5
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
 
Unit iv
Unit ivUnit iv
Unit iv
 
Software coding and testing
Software coding and testingSoftware coding and testing
Software coding and testing
 
Mi0033 software engineering
Mi0033  software engineeringMi0033  software engineering
Mi0033 software engineering
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering
 
Se lec 3
Se lec 3Se lec 3
Se lec 3
 
Software engineering introduction
Software engineering introductionSoftware engineering introduction
Software engineering introduction
 
Sd Revision
Sd RevisionSd Revision
Sd Revision
 
Elementary Probability theory Chapter 2.pptx
Elementary Probability theory Chapter 2.pptxElementary Probability theory Chapter 2.pptx
Elementary Probability theory Chapter 2.pptx
 
Software design.edited (1)
Software design.edited (1)Software design.edited (1)
Software design.edited (1)
 
Software engineering lecture notes
Software engineering   lecture notesSoftware engineering   lecture notes
Software engineering lecture notes
 
Software Engineering Fundamentals Svetlin Nakov
Software Engineering Fundamentals Svetlin NakovSoftware Engineering Fundamentals Svetlin Nakov
Software Engineering Fundamentals Svetlin Nakov
 
Software engineering lecture notes
Software engineering   lecture notesSoftware engineering   lecture notes
Software engineering lecture notes
 
SE-Unit I.pptx
SE-Unit I.pptxSE-Unit I.pptx
SE-Unit I.pptx
 
term paper for cbd models
term paper for cbd modelsterm paper for cbd models
term paper for cbd models
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 

Dernier

ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 

Dernier (20)

ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 

CSEB233 Software Engineering Fundamentals Construction Coding Principles

  • 1. B. Computer Sci. (SE) (Hons.) CSEB233: Fundamentals of Software Engineering Software Implementation & Coding
  • 2. Objectives  Explain what is software construction and why it is important  Describe good programming principles/practices  Explain the concept of ‗defensive programming‘  Describe software inspection as a static method to discover defects, errors or problems  Explain the concepts, benefits and problems of software reuse
  • 3. What is Software Construction?  ‗Construction‘ refers to the hands-on part of creating something  Include implementation/coding and debugging; and verification and validation  Generally focus at coding, debugging, some detailed design and some testing (esp. unit testing)  Quality of construction substantially affects the quality of the software
  • 4. What is Software Construction?  According to McConnell (1993), construction may involve: Verifying that the groundwork has been laid so that construction can proceed successfully  Designing and writing routines and modules  Selecting and creating data types and naming identifiers  Selecting control structures and organizing blocks of statements  Finding and fixing errors 
  • 5. What is Software Construction?  According involve: to McConnell (1993), construction may Reviewing other team members‘ design and code and having them review yours  Polishing the code – formatting and writing comments (i.e. internal documentation)  Integrating software components (if built separately)  Tuning the code – make it more efficient, smaller and faster 
  • 6. Why is Software Construction Important?  Depending on the size of project, construction may take 30% - 80% of the total project time  The larger the time spent, the bigger the work affect the success of the project Construction is the pivotal activity in software development  With a focus on construction, there is a great potential for the average programmer‘s productivity to improve (McConnel, 1993) 
  • 7. Why is Software Construction Important? Requirements document and design documents can go out of date, but construction‘s by product, the source code, is always up to date  Ideally software project goes through requirements engineering and modeling activities before construction begins   Construction is the only activity that‘s guaranteed to be done! (McConnel, 1993)
  • 8. Coding Principles  Coding principles and concepts are closely aligned programming style, programming languages, and programming methods  Before you write one line of code, be sure you: Understand of the problem you‘re trying to solve  Understand basic design principles and concepts 
  • 9. Coding Principles  Before you write one line of code, be sure you: Pick a programming language that meets the needs of the software to be built and the environment in which it will operate  Select a programming environment that provides tools that will make your work easier  Create a set of unit tests that will be applied once the component you code is completed 
  • 10. Coding Principles  As you begin writing code, be sure you: Constrain your algorithms by following structured programming practice  Consider the use of pair programming  Select data structures that will meet the needs of the design  Understand the software architecture and create interfaces that are consistent with it  Keep conditional logic as simple as possible 
  • 11. Coding Principles  As you begin writing code, be sure you: Create nested loops in a way that makes them easily testable  Select meaningful variable names and follow other local coding standards  Write code that is self-documenting  Create a visual layout (e.g., indentation and blank lines) that aids understanding 
  • 12. Coding Principles  After you‘ve completed your first coding pass, be sure to: Conduct a code walkthrough when appropriate  Perform unit tests and correct errors you‘ve uncovered  Refactor the code  ■ reorganization technique that simplifies the code without changing its function or behaviour
  • 13. Good Programming Practices  Start with a good design.    The program under development should be functioning at all times   Update the design documents regularly Create additional design documents before adding new major features or functionality The development process consists of adding new functionality without breaking existing functionality Work has to be divided into small incremental steps that can be typically accomplished and code-reviewed in one day.  Even large-scale rewrites should be made incremental
  • 14. Good Programming Practices  Every line of code written or modified undergoes peer review   The smallest team must contain at least two programmers so that they can code-review each other's changes Always attempt to work top-down in:    Design—start with high level objects Implementation—create top-level objects using low-level stubs Modification—change the top-level objects and the overall flow of control first. If necessary, use stubs, or fake new functionality using old implementation (Source: http://relisoft.com/practice.html)
  • 15. Good Programming Practices  Be consistent with formatting  Be consistent with naming conventions  Use global [identifiers] sparingly  Don‘t assume output formats  Add comment to your code – explain what and why (Source: Kim Moser at http://relisoft.com/practice.html )
  • 16. Good Programming Practices  Provide useful error messages  Recover (or fail) gracefully  Push interface up and implementation down  Know what you don't know – prepare for changes (Source: Kim Moser at http://relisoft.com/practice.html )
  • 17. Defensive Progamming  Defensive programming is when the programmer makes necessary assumptions and creates code that anticipates potential problems and specification changes  A good defensive programmer is sufficiently confident in his/her abilities to ignore the traditional belief that ―If it isn‘t broke, don‘t fix it.‖
  • 18. Defensive Progamming  Defensive programming involves: finding problems in the existing code by identifying code inconsistencies and understanding typical uses of the software  anticipating – and preempting – both potential problems with the existing specifications as well as likely changes in user behavior and design specifications, and  streamlining the code to aid readability and simplify maintainability (Mehta, 2009) 
  • 19. Software Inspections  An ‗old school‘ approach  A process to review, analyze and check static system representations such as requirements document, design document, and program source code to look for errors and problems  Static – need not run the software on a computer  Generally, focus at source code
  • 20. Software Inspections  Sometime also known as peer reviews or program /code inspections  Inspections can check conformance with a specification but not conformance with the customer‘s real requirements  But, inspections cannot check non-functional characteristics such as performance, usability, etc.
  • 21. Program/Code Inspection Process  Focus at detecting defects - logical errors and anomalies in the code  Program inspections are very effective in discovering defects  A formal process that involve team of several members  Fagan originally developed this method at IBM in the 1970s with four suggested roles – author, reader, tester and moderator
  • 22. Advantages of Inspection over Testing A single inspection session can discover many errors  During program testing, errors can mask (hide) other errors  Incomplete versions of a software can be inspected without additional costs  To test an incomplete program, specialized test is needed to test the parts that are available (Sommerville, 2004)
  • 23. Advantages of Inspection over Testing  Inspections can search for program defects and other quality attributes of a program  e.g., compliance to standard, maintainability, portability, efficiency, etc. (Sommerville, 2004)
  • 24. Drawbacks/Issues related to Inspections Difficult to introduce formal inspections into software development organizations  Software engineers (programmers) with experience are sometimes reluctant to accept that inspections can be more effective for detecting defects (errors) than testing  Managers may be sceptical as inspections require extra costs during modelling and construction  Inspections may take time to arrange and appear to slow down the development process 
  • 25. Software Reuse In most engineering disciplines, systems are designed by composing existing components that have been used in other systems  Software engineering has been more focused on original development  It is now recognised that to achieve better software quickly at lower cost, we need to adopt a design process that is based on systematic reuse rather than ad-hoc reuse  (Sommerville, 2004)
  • 26. Reuse-based Software Engineering  Application system reuse   Component reuse   The whole of an application system may be reused either by incorporating it without change into other systems (COTS reuse) or by developing application families Components of an application from sub-systems to single objects may be reused Object and function reuse  Software components that implement a single well-defined function may be reused
  • 27. Requirements for Reuse  It must be possible to find appropriate reusable components  The reuser of the component must be confident that the components will be reliable and will behave as specified  The components must be documented so that they can be understood and, where appropriate, modified.
  • 28. Benefits of Reuse  Increased dependability Software/components/functions have been tried and tested in working systems  They should be more dependable than new software   Reduced process risk   Less uncertainty in development costs especially if large software components are reused Effective use of specialists Reuse components instead of people  The specialist can create reusable components 
  • 29. Benefits of Reuse  Standards  compliance Standards such as UI standard (e.g., drop-down menu) can be implemented as reusable components to improve dependability as users are less likely to make mistake  Accelerated  development Avoid original development, speed-up production and hence able to market product early
  • 30. Reuse Problems  Increased costs in understanding whether the application/component/ function is suitable for reuse  in testing it to ensure its dependability and in maintaining the reused item   Lack of CASE tool support  Maintaining a component library can be expensive
  • 31. Reuse Problems  Not-invented-here  syndrome Some software engineers may think that writing original software is seen as more challenging than reusing other people‘s software.  Finding and adapting reusable components
  • 32. Summary  You have been introduced to: good programming principles/practices  the concept of ‗defensive programming‘  software inspection as a static method to discover defects, errors or problems  the concepts, benefits and problems of software reuse 
  • 33. THE END Copyright © 2013 Mohd. Sharifuddin Ahmad, PhD College of Information Technology