CS552 Coding and Delievery1 Coding and Delivery. CS552 Coding and Delievery2 Coding Standards...

48
CS552 Coding and Delieve ry 1 Coding and Delivery
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    243
  • download

    1

Transcript of CS552 Coding and Delievery1 Coding and Delivery. CS552 Coding and Delievery2 Coding Standards...

CS552 Coding and Delievery 1

Coding and Delivery

CS552 Coding and Delievery 2

Coding Standards Outline1. Enforcing Standards1. Enforcing Standards2. General Coding Standards2. General Coding Standards

a. Declarationsa. Declarationsb. Parameterb. Parameterc. Functionsc. Functions

d. Trade Offsd. Trade Offs3.3. PHP Coding StandardsPHP Coding Standards4.4. MYSQL Coding StandardsMYSQL Coding Standards5.5. JavaScript StandardsJavaScript Standards6.6. HTML StandardsHTML Standards

Created By: Sean Rutledge

CS552 Coding and Delievery 3

Created By: Sean Rutledge

CS552 Coding and Delievery 4

Created By: Sean Rutledge

CS552 Coding and Delievery 5

Created By: Sean Rutledge

CS552 Coding and Delievery 6

Making a System

ExtendedComputer-Middleware

Components

Compiler

C

C++ and C#

4GL

JAVASOURCE

LIBRARIES

DevelopmentComputer

EXECUTABLELIBRARIES

….DEVELOPERS,

PROGRAM ADMINISTRATORS& SOFTWARE MANUFACTURERS

APPLICATIONDATA BASE

USERS

Libraries

ProductionComputer

Application

Middleware

UNIX/Linux

BUILDING BLOCKS

TOOLLIBRARIES

PRODUCT

CS552 Coding and Delievery 7

Making a System

ExtendedComputer-Middleware

Components

Compiler

C

C++ and C#

4GL

JAVASOURCE

LIBRARIES

DevelopmentComputer

EXECUTABLELIBRARIES

….DEVELOPERS,

PROGRAM ADMINISTRATORS& SOFTWARE MANUFACTURERS

APPLICATIONDATA BASE

USERS

Libraries

ProductionComputer

Application

Middleware

UNIX/Linux

BUILDING BLOCKS

TOOLLIBRARIES

PRODUCT

Modification

Request

CS552 Coding and Delievery 8

Software Factory

DESIGNERS

- CODE- DOCUMENT- FIX BUGS

Configuration & TrackingTools & Process

SourceControl

ChangeManagement

TrackingSystem

SupportPrograms

SourceLibraries

ChangeRequestLibrary

Doc.Library

Release Archives

Build System

ShippingUtilities

ProductLibrariesApplicatio

nFiles

Release ProductsTo TestTeam

Reports

ModificationRequests

Release Products

To SitesMiddleware, Tools and Operating System

nMake

CS552 Coding and Delievery 9

Typical MRSEND TO >>>> R.K. Jonnada <<<<MODIFICATION REQUEST 33203 Date of MR: 11/28APPLICATION: FACS COMPONENT SYSTEM: 1@acsTYPE: 5w RELEASE:3,6,14,7ORIG NAME: T. DALE PHONE:205-320-8340 GROUP:LACDATE: OCCURRED: 11/21

SEVERITY: 2 DATE REQ: 12/10 PRIORITY: MSUBSYSTEM: app TROUBLE AREA: unknownRUN: _________________ MACHINE: ________________ABSTRACT: Change FA Exceeded Maximum time limitDESCRIPTION:

A change FA transaction on 1876 data drive failed due to the maximum processing time limit, This transaction was trying to change the serving terminal from “ 400-500 Chase Park 8” to “1876 Data Drive“ The serving terminal was loaded wrong at conversion and can not be corrected. Refer to: R. K. Jonnada

RELATED MRS:_______________PREREQUISITE: ____________________EXPLANATION:

CS552 Coding and Delievery 10

Development Cycle Circa 1970

Define Requirements

Design Programs, Data Base &

User Documentation

Code andTest Modules

IntegrationTest

SystemTest

InstallSoftware

Verify SystemOperation Live

Operation

TargetSite

CS552 Coding and Delievery 11

Factors Affecting ProductivityCirca 1975

• Quality of people• Level of testing before shipping• Consistency of requirements• Sophistication of programming tools• Modularity of design• Reasonableness of commitments

CS552 Coding and Delievery 12

Development Cycle for Multiple Sites Circa 1975

Define Requirements

Design Programs, Data Base &

User Documentation

Code andTest Modules

IntegrationTest

SystemTest

InstallSoftware

Verify SystemOperation Live

Operation

Site 1

Site Peculiar Tests

InstallSoftware

Verify SystemOperation Live

OperationSite N

.

.

.

.

.

.

.

.

.

CS552 Coding and Delievery 13

Define Requirements

Design Programs, Data Base &

User Documentation

Code andTest

Modules

IntegrationTest

SystemTest

InstallSoftware

Verify SystemOperation Live

OperationSite 1

Site Peculiar Tests

InstallSoftware

Verify SystemOperation Live

OperationSite N

.

.

.

.

.

.

.

.

.

SoftwareManufactureControls & Builds

SoftwareManufactureBuilds and Ships

Development Cycle with Software ManufacturingCirca 1980

CS552 Coding and Delievery 14

Development Cycle with Feedback

DEFINE DESIGN DEVELOP MANUFACTURE& DELIVER

QA, TEST& VERIFY

OPERATE,MAINTAIN &EVALUATE

TO SITES

CS552 Coding and Delievery 15

Development Cycle with Feedback

DEFINE DESIGN DEVELOP MANUFACTURE& DELIVER

QA, TEST& VERIFY

OPERATE,MAINTAIN &EVALUATE

TO SITES

CS552 Coding and Delievery 16

Source Code Management

• Store, update and retrieve all versions of source• Manage code ownership• Control updating privileges• Identify accurate version of retrieved source• Track changes• Maintain build database, tools and machine• Security, authentication and permissions

CS552 Coding and Delievery 17

Release Documents

• Describe features• Describe corrections to troubles• Cross reference software dependencies• Specify limitations or deficiencies• Provide special installation instructions• Provide data conversion instructions• Specify training• Identify new, changed or deleted documents• Maintain software source code• Maintain product lists

CS552 Coding and Delievery 18

Mapping Process to CMMI

ActionItemTracking

FormalReview

DesignControl

ProcessGroup

ComplianceTo Standards

ManagingTo a Plan

ExecutiveReview of Plans & ProcessCompliance

IndependentSoftwareQualityAssurance

ChangeControl

ConfigControl

Formal Costing, Sizing & Scheduling

ErrorStatistics

DEFINED- Level 3

REPEATABLE - Level 2

INITIAL- Hacking with Chaos Potential- Level 1

CS552 Coding and Delievery 19

Mapping Process to CMMIAutomatedDataCollection

ProcessFocus

ErrorPrevention

Error CauseAnalysis

RequiredSoftwareEngineeringTraining

ApplicationOf ReviewStandards

ProcessAssessment

ErrorProjectionAndTracking

Data Analysis

NewTechnologyIntroductionMechanism

OPTIMIZING - Level 5

MANAGED - Level 4

CS552 Coding and Delievery 20

Project Management Tools

PHASE

ACTIVITY

DEFINE DESIGN DEVELOP MANUFACTURE& DELIVER

TESTOPERATE,

MAINTAIN &EVALUATE

--OPERATIONS REVIEWS-- USER GROUP MEETINGS

PILOTINSTALLATION

PLAN

INSTALLATIONGUIDE

TESTPLAN

REVIEW

TESTSPECIFICATIONS

MONTHLY STEERING COMMITTEEBIWEEKLY PROJECT MEETING

Modification REQUESTSTROUBLE REPORTSCHANGE REPORTS

REVIEWSREQUIREMENTS

REVIEWWITH

CUSTOMER

CONTROLDOCUMENTS

REQUIREMENTS

PRODUCTS MODELSDEPLOYMENT

PLANNINGGUILDES

SOFTWARE GENERICS

AND USER DOCUMENTS

CRITICAL DESIGNREVIEW

WORKBOOKSOF DESIGNSPECIFICATIONS

INSPECTIONS QUALITYAUDITS

STATUS REPORTS

Release DOCUMENTS

SOURCE CODE& DOCUMENT

UPDATES

CS552 Coding and Delievery 21

Release Flow

•CODE•PROCEDURES•DOCUMENTATION

DEVELOPMENTSHOPS

SOFTWAREMANUFACTURING

SOFTWAREMANUFACTURING

COOPERATIVETESTING

Release PACKAGES

CHANGE orMODIFICATIONREQUEST(MR)

COMPONENTTEST

SYSTEM INTEG.TEST

SITES

N - 1

N

DEVELOPMENT ENVIRONMENT EXECUTION ENVIRONMENT

MODULE D

MODULE C

MODULE B

MODULE A

CS552 Coding and Delievery 22

Organizational Structure

SYSTEM BASELINEREQUIREMENTS

ALGORITHMS

TRAFFICPROJECTIONS

FEATUREENGINEERING

ARCHITECTUREENGINEERING

TRAFFICENGINEERING

ENGINNERINGREPORTS SUPPORT AND OPERATIONS

- COMPUTER CENTER - DEVELOPMENT MACHINE - TEST MACHINE

SOFTWAREDEVELOPMENT

HUMAN FACTORSDEVELOPMENT

SOFTWAREMANUFACTURING INTEGRATION

TO SITES

CS552 Coding and Delievery 23

Organizational Structure

SYSTEM BASELINEREQUIREMENTS

ALGORITHMS

TRAFFICPROJECTIONS

FEATUREENGINEERING

ARCHITECTUREENGINEERING

TRAFFICENGINEERING

ENGINNERINGREPORTS SUPPORT AND OPERATIONS

- COMPUTER CENTER - DEVELOPMENT MACHINE - TEST MACHINE

AGILE SCRUMTEAMS

HUMAN FACTORSDEVELOPMENT

SOFTWAREMANUFACTURING INTEGRATION

TO SITES

CS552 Coding and Delievery 24

Scrum Summary Feedback Control

Product BacklogsQFD

Daily

Scrum

Standards, Conventions, Guidelines

Sprint Backlog

Sprint

Planning

Meeting

SprintExecutable Product Increment

CS552 Coding and Delievery 25

Agility with Scrum

• Small cross-functional team – Scrum Team– Self organizing and autonomous.

• Daily Scrum– What have you done since the last scrum?– What will you do before the next scrum?– What got in the way? This is not the place to solve problems,

just identify them.• Activity between builds is called a Sprint. • Frequent builds, called increments at end of Sprint• Sprint Review Meetings examine product increment.• sQFD driven, called ‘Product Backlog.’• Scrum Master drives decisions and gets resources• Feedback control Philosophy

CS552 Coding and Delievery 26

Free Open Source Software (FOSS)1. The freedom to run the program, for any purpose2. The freedom to study how the program works, and

adapt it to your needs. Access to the source code is a must.

3. The freedom to redistribute copies so you can help others.

4. The freedom to improve the program, and release your improvements to the public, so that the whole community benefit. Access to the source code is again a must.

CS552 Coding and Delievery 27

FOSS Development Processes

• Requirements as informal web notes - no apriori spec• Version Control and incremental releases- ‘committer’• Zero Maintenance- evolutionary redevelopment• Layered Meritocracy with virtual project manager

having source control and assignments• Explicit Software Technology Transfer

as reported by Walt Scacchi

CS552 Coding and Delievery 28

Open Source Code

• The developer must be a user and there are:– No royalties– Accessible source code – Modifications and derivations are encouraged– No person, group or field of endeavor can be denied

access to the program – The rights attached to the program must not depend on

the program's being part of a particular software distribution

– The licensed software cannot place restrictions on other software that is distributed with it.

CS552 Coding and Delievery 29

Heisenbugs

Latent faults causing gradual deterioration a software process with respect to the use of some resource resulting in a crash.

CS552 Coding and Delievery 30

Case Study: Pluto Express

Boot

Failure

Robust Operation

Vulnerable

Operation

CS552 Coding and Delievery 31

Case Study: Pluto Express Rejuvenation is periodically restoring a system

to a defined and well-tested initial state

System Reliability with Rejuvenation is 100 times more Reliable in the flight to Pluto than without Rejuvenation.

CS552 Coding and Delievery 32

Non-error prompt code Vs Error Prompt code

If (cond A) If (cond A)Execute process A Execute Process A

If (cond B) If (cond B)Execute process B Execute Process B

else If (cond C)Execute process C Execute Process C

else "check dispatch parameter"

CS552 Coding and Delievery 33

What is the value of k in a Processconsisting of thread A & thread B?

initialize k=4

thread A: thread B:

1A. load k into T 1B. load k into T

2A. ADD 1 to T 2B. ADD 2 to T

3A. store T into k 3B store T into k

CS552 Coding and Delievery 34

Fault Density = f(t)

Testing Time (t)

Faultsper1000NCSLOC

EK/NCLOC

CS552 Coding and Delievery 35

CS552 Coding and Delievery 36

Extreme Programming XP

• Test before Coding• Pair Programming• On-Site Customers • Ad hoc functionality• Evolutionary Development• Continuous Integration• Short Cycles with Feedback• Incremental Development

CS552 Coding and Delievery 37

Bob Allen

CS552 Coding and Delievery 38

Defect DensitiesSource Language Error/

NCkSLOCFormalMethods?

DevelopmentStatus

Operating System

Assembler 6-15 N Release

LanguageParser

C 20-100 N Dev

Scientific Fortran 3 N Release

Air TrafficControl

C 1.25 Y Release

IBM Cleanroom Various 3.4 Y/N Release

IBM Transaction

Various 30 N Release

Apollo Ada & C 0.8 Y Release

A (200 kSLOC) C 0.72 N Release 14

B (50 kSLOC) C++ 1.14 N Release 3

Puerto Rico ProvisioningOne million L OC

C 0.6 N AcceptanceTest

CS552 Coding and Delievery 39

Defect Densities Today

• After Release, count all defects and use asymptotic values,

The current state of the art for Reliable systems 0.5-1 defects / NCSKLOC,

A reasonable commercial system

3-6 defects / NCSKLOC, A poor system is likely to have

> 15 defects / NCSKLOC .

CS552 Coding and Delievery 40

The Hatton Defect Density U curve

Defects perKLOC

Average component complexity

For Ada, assembler, C, C++, Cobol, Fortran, Pascal, and PL/M systems:

CS552 Coding and Delievery 41

Data-Driven Defect Isolation Truncation

Exploiting the U-curve:

Inspect components at the high end and low end preferentially over the medium-sized ones, (i.e. those near the middle of the U-curve).

CS552 Coding and Delievery 42

The Defect Density U curve - Truncation

Defects perNCSKLOC

Size of components of ‘average’ complexity

CS552 Coding and Delievery 43

Defect Isolation

Exploiting the U-curve:

Forbid the appearance of components at the high end by static enforcement of size limits, and forestall and inspect small modules.

CS552 Coding and Delievery 44

The defect density U curve – Eliminate nano-modules

Defects perNCKLOC

Size of component with ‘average’ component complexity

CS552 Coding and Delievery 45

Inspections

Probably the most significant step forward in defect removal prior to delivery is Code Inspection

1. The evidence suggests that they are 5-10 times more efficient than any other form of defect removal.

2. The technology is mature, (some 20 years old), and in trained hands, exceptionally effective.

3. Gurus hate enforced Code Inspections because too often they become perfunctory.

CS552 Coding and Delievery 46

Code Inspection Solution

1. Inspect code of newcomers.

2. Inspect code if bugs are found in system test.

3. Inspect code where there is a long history of change.

4. Measure Complexity and Code Inspect the outliers.

5. Ask all programmers to have their code read by someone else.

CS552 Coding and Delievery 47

Tools

• Development Tools• Production Tools• Documentation Tools• Configuration Management Tools• Problem Tracking Tools

CS552 Coding and Delievery 48

Ethical Conduct• Understand the problem, don’t just accepting the

customer’s solution• Humanize tasks • Develop Trustworthy Systems• Identify, manage and celebrate risks• Read the literature• Respect property rights and privacy• Write bug-free code; Ship systems that work• Advocate ethical behavior- Stand up and be counted.