9
PVK-HT05 1 Contents Introduction Requirements Engineering Project Management Software Design Detailed Design and Coding Quality Assurance Software Maintenance

Contents

Embed Size (px)

DESCRIPTION

Contents. Introduction Requirements Engineering Project Management Software Design Detailed Design and Coding Quality Assurance Software Maintenance. Detailed Design Activities. Give sufficient information, so that the implementation teams can do a good job. - PowerPoint PPT Presentation

Citation preview

PVK-HT05 1

ContentsIntroduction Requirements Engineering Project Management Software Design Detailed Design and CodingQuality AssuranceSoftware Maintenance

PVK-HT05 2

Detailed Design Activities

Choose specific data structures and algorithmsRefine the components from architectural designDefine HOWComments are NOT enough:

Give sufficient information, so that the implementation teams can do a good job.

procedure replaceText( var text: TextFile; oldWords, newWords: WordList);(* Replace in the text text all occurrences of the i-th word in oldWords by *)(* the i-th word in newWords; oldWords and newWords must have the same *)(* length *)

PVK-HT05 3

Open QuestionsWhat are the word delimiters?o blank, EOL, EOF, TABo `.´, `,´, `;´, `:´, ...`_´, `&´, ...

Is the matching case sensitive?Must replacements have the same length?How to solve conflicts?o Several different replacements for the same old wordo Some words in newWords appear also in oldWordso Assume the following:

text: ... ABC ...; oldWords: AB, BC; newWords: X, Yalternative1: ... XC ...alternative2: ... AY ...

PVK-HT05 4

Approaches to Detailed Design

Informalo Structured English

Semi-formalo Program Design Languages (PDLs)o Diagrammatical techniques

Formalo Formal Specifications (e.g. Z, VDM, ...)o Pre-/postconditions & invariants (sometimes

called programming by contracting)

PVK-HT05 5

Programming by Contracting

Clients and servers of services “sign” contracts, i.e. servers guarantee the effects of their services offered, if and only if clients use these services correctly.

function getPosition( a: array of Element; el: Element) return integer;(* Returns the relative position of el in a *)precondition i [a`First..a`Last]: a[i] = el (* such an element exists *) postcondition a[getPosition( a, el)] = el and a = a.old

(* getPosition really returns the position of el in a and a is unchanged *)

You could even specify that the array must be sorted in ascending order to allow for a faster algorithm by adding the following to the precondition:

and i,j [a`First..a`Last]: i < j a[i] < a[j]

PVK-HT05 6

ImplementationTransform the detailed design into concrete programming language codeEnsure that this code correctly implements the detailed design

OOPS! Many modern programming languages

contain detailed design elements, e.g. Eiffel

PVK-HT05 7

Programming StyleRemember that programs are for people to readChoose good namesComment extensivelyBe consistent regarding layout of codeAvoid duplication of codeAdhere to good object oriented principlesPrefer private as opposed to public

PVK-HT05 8

Programming GuidelinesUse separate files for each module, class, macro, inline, ... definitionUse separate files for the definition/specification and implementation when possibleCall operations only when all preconditions are satisfied (this is the caller´s responsibility)Do not mix user interface code with non-user interface codeo Interact with the user in separate classes

• This makes non-UI classes more reusableAvoid pointers to pointersCommit to effective naming conventions

PVK-HT05 9

Coding StandardsJava coding standards:o The Elements of Java Style; Vermeulen et.al.

SIGS Books.o http://java.sun.com/docs/codeconv/html/

CodeConvTOC.doc.htmlSmalltalk Best Practice Patterns by Kent BeckRecommended C Style and Coding Standards by David KeppelC Programming Guidelines by Thomas Plum Ada Quality and Style: Guidelines for Professional Programmers by Software Product Consort