21
20 February Detailed Design Implementation

20 February Detailed Design Implementation. Software Engineering Elaborated Steps Concept Requirements Architecture Design Implementation Unit test Integration

  • View
    216

  • Download
    1

Embed Size (px)

Citation preview

20 February

Detailed DesignImplementation

Software Engineering Elaborated Steps

Concept Requirements Architecture Design Implementation Unit test Integration System test Maintenance

What do you think about this design?

Mystery site

Design Principles

Correctness Robustness Flexibility Reusability Efficiency

Correctness Always a goal. Others may be negotiable. Definition: satisfies all of the application’s

requirements How do we know the requirements are correct?

Approaches Inspections

Readable (“I didn’t have time to write a short letter, so I wrote a long one instead.”)

Modular Formal verification

Invariants, pre- and post-conditions Usually used only in critical components

Robustness

Ability to handle anomalous situations

Techniques Verifying input Initialization Parameter checking

Range Constraints Husk and kernel

Importance of Robustness: USS Yorktown (1998) Guided missile cruiser that suffered

widespread system failure off the coast of Virginia

Dead in the water for more than two hours

Crew member mistakenly entered a zero in a data field of an application Divide by zero Buffer overflow Shut down the propulsion system

Flexibility Requirements changes

Adding more of the same function New type of member, account, question or

game Adding new type of function

Printing what was only displayed, withdrawing when only depositing was allowed, creating a new game

Changing function Allowing reverse as well as forward,

overdraft protection

Using XML Design issues

Encapsulating things that may change Late binding Separation of instruction and data

Examples Layout of your interface Description of changeable data

More detail Thursday

Reusability

How to make it reusable Match real world concepts Avoid unnecessary coupling Document

Complete specification (assertions, constraints)

Explanation of function and algorithm Generic names

Efficiency All about trade-offs What do you care about being efficient?

Time Memory usage External storage Download Start-up Shutdown Usage Development

How important? Fundamental requirement Nice enhancement

Software Engineering Elaborated Steps

Concept Requirements Architecture Design Implementation Unit test Integration System test Maintenance

Coding Tips: Class Exercise

Write down your favorite programming tip Not a coding trick A big item that helps across systems

Examples Use meaningful variable names Use indentation and spacing

Start Small

A lesson from agile programming

Don’t design every class that you can think of

Don’t design every feature

Documentation No such thing as a self-documenting program Things that can be generated

helpful but give no insights Explain alternatives not used Explain why you are doing it Same line comments: saying enough to be

useful? Your comments are prose and should read

accordingly

Do you write…

code interspersed with comments?or

prose interspersed with executable lines?

Documentation Example

“Use a string search to find the requested protein.”

“A binary search turned out to be slower than a string-matching algorithm for the most interesting data sets. Despite the need for preprocessing, this more complex Boyer-Moore algorithm is a better choice for finding the requested protein string.”

Error Handling

Black list vs. white list

Should you identify what is good or what is bad?

When is each appropriate? Which is easier to maintain?

Tools

Version Management Build Systems Integrated Development

Environments

Version Management

There is nothing permanent except change.

Heraclitus 500 BCE

Version Management

Both during and after development Both code and documentation Uses

Multi-developer change control Releases Support for different environments

Computers Operating systems