Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 23 Instructor Paulo Alencar.

Similar presentations


Presentation on theme: "1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 23 Instructor Paulo Alencar."— Presentation transcript:

1 1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 23 Instructor Paulo Alencar

2 2 Overview  Software Quality Metrics  Black Box Metrics  White Box Metrics  Development Estimates  Maintenance Estimates

3 3 White Box Metrics –Linguistic: LOC Halstead’s Software Science –Structural: McCabe’s Cyclomatic Complexity Information Flow Metric –Hybrid: Syntactic Interconnection

4 4 –Linguistic Metrics: measuring the properties of program/specification text without interpretation or ordering of the components. –Structural Metrics: based on structural relations between objects in program; usually based on properties of control/data flowgraphs [e.g. number of nodes, links, nesting depth], fan-ins and fan-outs of procedures, etc. –Hybrid Metrics: based on combination (or on a function) of linguistic and structural properties of a program. Types of White Box Metrics

5 5 Linguistic Metrics Lines of code/statements (LOC) perhaps the simplest: –count the number of lines of code (LOC) and use as a measure of program complexity. –Simple to use: if errors occur at 2% per line, a 5000 line program should have about 100 errors. If it required 30 tests to find an error, then could infer the expected number of tests needed per line of code.

6 6 Examples of use include: –productivity KLOC/person-month –qualityfaults/KLOC –cost$$/KLOC –documentationdoc_pages/KLOC LOC

7 7 Various studies indicate: –error rates ranging from 0.04% to 7% when measured against statement counts; –LOC is as good as other metrics for small programs –LOC is optimistic for bigger programs. –LOC appears to be rather linear for small programs (<100 lines), – but increases non-linearity with program size. –Correlates well with maintenance costs –Usually better than simple guesses or nothing at all. LOC

8 8 One study: a rough estimate of the average LOC to build one function point (FP): LanguageLOC/FP (average) Assembly300 COBOL100 FORTRAN100 Pascal90 Ada70 00 Language30 4GL20 Code Generator15 LOC

9 9 Halstead's Software Science Metrics Halstead [1977] based his "software science" on: –common sense, –information theory and –psychology. –His 'theory' is still a matter of much controversy. A basic overview:

10 10 Based on two easily obtained program parameters: – the number of distinct operators in program – the number of distinct operands in program Paired operators such as: "begin...end", "repeat...until" are usually treated as a single operator. Other examples: =, do, if, goto, etc. Operands: primitive variables, array variables the program length is defined by: define the following: –N 1 = total count of all operators in program. –N 2 = total count of all operands in program. Halstead's Software Science Metrics

11 11 then the actual Halstead length is given as: – [usually accepted as more appropriate] –which is basically a static count of the number of tokens in program. the vocabulary of a program is defined as the sum of the number distinct operands and operators : Halstead's Software Science Metrics

12 12 Various other measures can also be obtained, for example: –program volume: varies with the language and represents the information (in bits) to specify the program. –potential volume: V * is the volume of the most succinct program in which the algorithm can be coded. Consider where Halstead's Software Science Metrics

13 13 program level: –which is a measure of the abstraction of the formulation of the algorithm. –also given as : program effort: –the number of mental discriminations needed to implement the program (the implementation effort) –correlates with the effort needed for maintenance for small programs. Halstead's Software Science Metrics

14 14 –A motivated programmer who is fluent in a language, the time to generate the preconceived program is where S is a constant (Stroud). Letting n 1 * = 2 and substituting for L and V we get: Use of Halstead’s Metrics

15 15 Known weaknesses: –Call depth not taken into account a program with a sequence 10 successive calls more complex than one with 10 nested calls –An if-then-else sequence given same weight as a loop structure. –Added complexity issues of nesting if-then-else or loops not taken into account, etc. Use of Halstead’s Metrics

16 16

17 17


Download ppt "1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 23 Instructor Paulo Alencar."

Similar presentations


Ads by Google