Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Engineering Modern Approaches Eric Braude and Michael Bernstein 1.

Similar presentations


Presentation on theme: "Software Engineering Modern Approaches Eric Braude and Michael Bernstein 1."— Presentation transcript:

1 Software Engineering Modern Approaches Eric Braude and Michael Bernstein 1

2 © 2010 John Wiley & Sons Ltd. Chapter 23: 23 Quality and Metrics in Implementation 2

3 Learning Goals of This Chapter How do you assess the degree of sufficiency of an implementation? How do measure the degree of robustness? What metrics are there for flexibility? Reusability? Efficiency? Reliability? Scalability? How does one assess the degree of security of an implementation? How do code inspections improve code quality? Code reviews? How does pair programming improve code quality? Requirements analysis Design Implementation Testing Maintenance Planning The Software Development Lifecycle Phase most relevant to this chapter is shown in bold Table 1: Rough measures of quality of an implementation © 2010 John Wiley & Sons Ltd. 3

4 Rough Measures of Quality of an Implementation Degree ofRough metric … 0 …10 (maximum score) sufficiency Fails to implement the corresponding design specification Satisfies all of the design specifications for this element robustness Will cause crash on any anomalous event Recovers from all anomalous events as well as can be expected flexibility Will have to be replaced entirely if the design or requirements change As easily adaptable to reasonable changes as can be expected reusability Cannot be used in other applications Usable in all reasonably related applications without modification efficiency Fails to satisfy speed or data storage requirement Satisfies speed or data storage requirement with reasonable margin reliability Obviously won’t achieve required mean time between failure Obviously will achieve required mean time between failure scalability Can’t be used as the basis of a larger version Is an outstanding basis for a version with much larger scope security Security not accounted for at all No known manner of breaching security is known © 2010 John Wiley & Sons Ltd. 4

5 Supporting and Competing Implementation Qualities scalability robustness reusability efficiency reliability flexibility security usually supports: Key : usually competes: © 2010 John Wiley & Sons Ltd. 5

6 Assessing the Robustness of a Method 1.Assess input to the method a.Anomalous parameter values b.Anomalous global variables c.Anomalous event variables 2.Assess dependent methods Measure extent of compromise 6

7 © 2010 John Wiley & Sons Ltd. A Robustness Metric for Classes Scale: 0 TO 1  (degree of method’s robustness on scale of 0 to 1) Number of methods all methods A metric for each method: No robustness = 0, some = 0.5, complete = 1. A metric for classes 7

8 © 2010 John Wiley & Sons Ltd. Implementation Factors Which Increase Flexibility 1 1.Document precisely and thoroughly – Reason: cannot adapt code that you don’t understand 2.Name constants – Reason: understandability 3.Hide where possible – Variables and methods – Reason: reducing complexity increases understanding 4.Collect common code – As helper methods and classes – Reason: reduce complexity 8

9 © 2010 John Wiley & Sons Ltd. Implementation Factors Which Increase Flexibility 2 5.Reduce dependency on global variables -- and on any variables external to the method – Parameterize methods – Reason: allows method to be used in other contexts 6.Program at a general level – Reason: applies to more situations 7.Use understandable variable and function names 9

10 Naming Variables and Constants Poor Dose mDD Better dailyDosage Best maxDailyDosage minDailyDosage commonDailyDosage © 2010 John Wiley & Sons Ltd. 10

11 Metrics for Various Attributes of An Implementation AttributeMetric 1. Degree of documentation a)Percentage of comment lines b)Percentage of commented lines 2. Extent of named constantsPercentage of numerals with names (see Note 1) 3. Hide where possible a)Standard deviation of class size (see Note 2) b)Standard deviation of method size 4. Degree to which common code is collected Percentage of repeated code paragraphs (see Note 3) 5. Degree of dependency on global variables a)Percentage of public fields b)Percentage of protected fields c)Percentage of unlabeled fields 6. Degree of generic programming Percentage of generic classes 7. Use understandable variable and function names Percentage of names clearly difficult to understand © 2010 John Wiley & Sons Ltd. 11

12 © 2010 John Wiley & Sons Ltd. Security Challenges for Simple Login Store ID’s and passwords without allowing unauthorized access Ensure that data goes only to authorized requesters Design so that security is easily maintained as application evolves – Isolate security-affecting classes? 12

13 © 2010 John Wiley & Sons Ltd. Security Metrics Confidentiality: Measure by degree of difficulty... gaining disallowed access to information Nonrepudiation:... repudiating agreement Integrity:... altering data in transit, undetected Authentication:... verifying identity Authorization:... gaining disallowed access to a location 0=easy; 1=not easy but conceivable; 2=not conceivable 13


Download ppt "Software Engineering Modern Approaches Eric Braude and Michael Bernstein 1."

Similar presentations


Ads by Google