Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecturer: Dr. AJ Bieszczad Chapter 76-1 Software engineering standards Standards for you Standards for others Matching design with implementation.

Similar presentations


Presentation on theme: "Lecturer: Dr. AJ Bieszczad Chapter 76-1 Software engineering standards Standards for you Standards for others Matching design with implementation."— Presentation transcript:

1 Lecturer: Dr. AJ Bieszczad Chapter 76-1 Software engineering standards Standards for you Standards for others Matching design with implementation

2 Lecturer: Dr. AJ Bieszczad Chapter 76-2 Algorithms Efficiency may have hidden costs –cost to write the code faster –cost to test the code –cost to understand the code –cost to modify the code

3 Lecturer: Dr. AJ Bieszczad Chapter 76-3 General guidelines Localize input and output Include pseudocode Revise and rewrite, rather than patch Reuse

4 Lecturer: Dr. AJ Bieszczad Chapter 76-4 Exception handling try { // code to try } catch (Exception e) { // exception handler } finally { // code executed under any circumstances }

5 Lecturer: Dr. AJ Bieszczad Chapter 76-5 Assertions In Java code: assert n > 0;// first form assert n > 0 : “n is zero!” // second form int i = k / n; Compiling:  javac –source 1.4 Enabling and disabling assertions:  java command line parameters -ea[:...|: ] -enableassertions[:...|: ] -da[:...|: ] -disableassertions[:...|: ] -esa | -enablesystemassertions -dsa | -disablesystemassertions Error throws if condition not satisfied:  Exception in thread “main” java.lang.AssertionError: n is zero!

6 Lecturer: Dr. AJ Bieszczad Chapter 76-6 Documentation Internal documentation –header comment block –other program comments –meaningful variable names and statement labels –format to enhance understanding –document data External documentation –describe the problem –describe the algorithm –describe the data

7 Lecturer: Dr. AJ Bieszczad Chapter 76-7 Class Header /** * * Note that there are two stars starting the comment. This makes the comments * eligible for processing with JavaDoc. * * HTML can be used in here; e.g., * This program... explain whatever it does, under what assumptions, what is the input and what is * the output, etc. * * annually, * monthly, and * daily. * * * "@author" is a control statement for JavaDoc * You can generate documentation using JavaDoc * * @author My Name * */ // Here you start your class...

8 Lecturer: Dr. AJ Bieszczad Chapter 76-8 Method header /** * * Note that there are two stars starting the comment. * This makes the comments eligible for processing * with JavaDoc. * * Describe what the method does. You can use HTML. * * @param parameterName parameter explanantion * @param hour provides an integer representation * of the hour to set * * @return explain what is returned from the method * (only if this is a typed function!) */ // now start your method code...


Download ppt "Lecturer: Dr. AJ Bieszczad Chapter 76-1 Software engineering standards Standards for you Standards for others Matching design with implementation."

Similar presentations


Ads by Google