20 February Detailed Design Implementation Software Engineering Elaborated
20 February Detailed Design Implementation
Software Engineering Elaborated Steps n Concept Requirements Architecture n Design n n n Implementation Unit test Integration System test Maintenance
What do you think about this design? n Mystery site
Design Principles n n n Correctness Robustness Flexibility Reusability Efficiency
Correctness n n Always a goal. Others may be negotiable. Definition: satisfies all of the application’s requirements n n How do we know the requirements are correct? Approaches n Inspections n n n Readable (“I didn’t have time to write a short letter, so I wrote a long one instead. ”) Modular Formal verification n n Invariants, pre- and post-conditions Usually used only in critical components
Robustness n n Ability to handle anomalous situations Techniques n n n Verifying input Initialization Parameter checking n n n Range Constraints Husk and kernel
Importance of Robustness: USS Yorktown (1998) n n n 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 n Divide by zero n Buffer overflow n Shut down the propulsion system
Flexibility n Requirements changes n Adding more of the same function n n Adding new type of function n n New type of member, account, question or game Printing what was only displayed, withdrawing when only depositing was allowed, creating a new game Changing function n Allowing reverse as well as forward, overdraft protection
Using XML n Design issues n n Examples n n n Encapsulating things that may change Late binding Separation of instruction and data Layout of your interface Description of changeable data More detail Thursday
Reusability n How to make it reusable n n n Match real world concepts Avoid unnecessary coupling Document n n n Complete specification (assertions, constraints) Explanation of function and algorithm Generic names
Efficiency n n All about trade-offs What do you care about being efficient? n n n n n Time Memory usage External storage Download Start-up Shutdown Usage Development How important? n n Fundamental requirement Nice enhancement
Software Engineering Elaborated Steps n Concept Requirements Architecture Design n Implementation n n n Unit test Integration System test Maintenance
Coding Tips: Class Exercise n Write down your favorite programming tip n n n Not a coding trick A big item that helps across systems Examples n n Use meaningful variable names Use indentation and spacing
Start Small n n n A lesson from agile programming Don’t design every class that you can think of Don’t design every feature
Documentation n n No such thing as a self-documenting program Things that can be generated n n n 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 n n 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 n n n Version Management Build Systems Integrated Development Environments
Version Management There is nothing permanent except change. Heraclitus 500 BCE
Version Management n n n Both during and after development Both code and documentation Uses n n n Multi-developer change control Releases Support for different environments n n Computers Operating systems
- Slides: 21