SlideShare una empresa de Scribd logo
1 de 16
Algorithm Example
For the following task:
Use the random module to write a number guessing game.
The number the computer chooses should change each time you
run the program.
Repeatedly ask the user for a number. If the number is different
from the computer's let the user know if they guessed too high
or too low. If the number matches the computer's, the user wins.
Keep track of the number of tries it takes the user to guess it.
An appropriate algorithm might be:
Import the random module
Display a welcome message to the user
Choose a random number between 1 and 100
Get a guess from the user
Set a number of tries to 0
As long as their guess isn’t the number
Check if guess is lower than computer
If so, print a lower message.
Otherwise, is it higher?
If so, print a higher message.
Get another guess
Increment the tries
Repeat
When they guess the computer's number, display the number
and their tries count
Notice that each line in the algorithm corresponds to roughly a
line of code in Python, but there is no coding itself in the
algorithm. Rather the algorithm lays out what needs to happen
step by step to achieve the program.
Software Quality Metrics for Object-Oriented Environments
AUTHORS:
Dr. Linda H. Rosenberg Lawrence E. Hyatt
Unisys Government Systems Software Assurance Technology
Center
Goddard Space Flight Center Goddard Space Flight Center
Bld 6 Code 300.1 Bld 6 Code 302
Greenbelt, MD 20771 USA Greenbelt, MD 20771 USA
I. INTRODUCTION
Object-oriented design and development are popular concepts in
today’s software development
environment. They are often heralded as the silver bullet for
solving software problems. While
in reality there is no silver bullet, object-oriented development
has proved its value for systems
that must be maintained and modified. Object-oriented software
development requires a
different approach from more traditional functional
decomposition and data flow development
methods. This includes the software metrics used to evaluate
object-oriented software.
The concepts of software metrics are well established, and many
metrics relating to product
quality have been developed and used. With object-oriented
analysis and design methodologies
gaining popularity, it is time to start investigating object-
oriented metrics with respect to
software quality. We are interested in the answer to the
following questions:
• What concepts and structures in object-oriented design affect
the quality of the
software?
• Can traditional metrics measure the critical object-oriented
structures?
• If so, are the threshold values for the metrics the same for
object-oriented designs as for
functional/data designs?
• Which of the many new metrics found in the literature are
useful to measure the critical
concepts of object-oriented structures?
II. METRIC EVALUATION CRITERIA
While metrics for the traditional functional decomposition and
data analysis design approach
measure the design structure and/or data structure
independently, object-oriented metrics must be
able to focus on the combination of function and data as an
integrated object [1]. The evaluation
of the utility of a metric as a quantitative measure of software
quality was based on the
measurement of a software quality attribute. The metrics
selected, however, are useful in a wide
range of models. The object-oriented metric criteria, therefore,
are to be used to evaluate the
following attributes:
• Efficiency - Are the constructs efficiently designed?
• Complexity - Could the constructs be used more effectively to
decrease the architectural
complexity?
• Understandability - Does the design increase the psychological
complexity?
• Reusability - Does the design quality support possible reuse?
• Testability/Maintainability - Does the structure support ease
of testing and changes?
page 1
Whether a metric is “traditional” or “new”, it must be effective
in measuring one or more of
these attributes. As each metric is presented, we will briefly
discuss its applicability.
The SATC’s approach to identifying a set of object-oriented
metrics was to focus on the primary,
critical constructs of object-oriented design and to select
metrics that apply to those areas. The
suggested metrics are supported by most literature and some
object-oriented tools. The metrics
evaluate the object-oriented concepts: methods, classes,
coupling, and inheritance. The metrics
focus on internal object structure, external measures of the
interactions among entities, measures
of the efficiency of an algorithm and the use of machine
resources, as well as psychological
measures that affect the ability of a programmer to create,
comprehend, modify, and maintain
software.
We support the use of three traditional metrics and present six
additional metrics specifically for
object-oriented systems. The SATC has found that there is
considerable disagreement in the
field about software quality metrics for object-oriented systems
[1,4]. Some researchers and
practitioners contend traditional metrics are inappropriate for
object-oriented systems. There are
valid reasons for applying traditional metrics, however, if it can
be done. The traditional metrics
have been widely used, they are well understood by researchers
and practitioners, and their
relationships to software quality attributes have been validated
[1,4,8,9] Preceding each metric, a
brief description of the object-oriented structure is given. Each
metric is then described,
interpretation guidelines given, and the applicable quality
attributes listed.
III. TRADITIONAL METRICS
A. Methods
In an object-oriented system, traditional metrics are generally
applied to the methods that
comprise the operations of a class. A method is a component of
an object that operates on data
in response to a message and is defined as part of the
declaration of a class. Methods reflect
how a problem is broken into segments and the capabilities
other classes expect of a given class.
Two traditional metrics are discussed here: cyclomatic
complexity and size (line counts).
• METRIC 1: Cyclomatic Complexity (CC)
Cyclomatic complexity (McCabe) is used to evaluate the
complexity of an algorithm in
a method. A method with a low cyclomatic complexity is
generally better, although it
may mean that decisions are deferred through message passing,
not that the method is
not complex. Cyclomatic complexity cannot be used to measure
the complexity of a
class because of inheritance, but the cyclomatic complexity of
individual methods can
be combined with other measures to evaluate the complexity of
the class. In general, the
cyclomatic complexity for a method should be below ten,
indicating decisions are
deferred through message passing. Although this metric is
specifically applicable to the
evaluation of quality attribute Complexity, it also is related to
all of the other attributes
[2,3,4,5,8].
• METRIC 2: Size
page 2
page 3
Size of a method is used to evaluate the ease of
understandability of the code by
developers and maintainers. Size can be measured in a variety
of ways. These include
counting all physical lines of code, the number of statements,
and the number of blank
lines. Thresholds for evaluating the size measures vary
depending on the coding
language used and the complexity of the method. However,
since size affects ease of
understanding, routines of large size will always pose a higher
risk in the attributes of
Understandability, Reusability, and Maintainability. [2,4,5,8]
• METRIC 3: Comment Percentage
The line counts done to compute the Size metric can be
expanded to include a count of
the number of comments, both on-line (with code) and stand-
alone. The comment
percentage is calculated by the total number of comments
divided by the total lines of
code less the number of blank lines. The SATC has found a
comment percentage of
about 30% is most effective. Since comments assist developers
and maintainers, this
metric is used to evaluate the attributes of Understandability,
Reusability, and
Maintainability [6].
IV. OBJECT-ORIENTED SPECIFIC METRICS
As discussed, many different metrics have been proposed for
object-oriented systems. The
object-oriented metrics that were chosen by the SATC measure
principle structures that, if
improperly designed, negatively affect the design and code
quality attributes.
The selected object-oriented metrics are primarily applied to the
concepts of classes, coupling,
and inheritance. For some of the object-oriented metrics
discussed here, multiple definitions are
given, since researchers and practitioners have not reached a
common definition or counting
methodology. In some cases, the counting method for a metric
is determined by the software
analysis package being used to collect the metrics.
A Class
A class is a template from which objects can be created. This
set of objects share a common
structure and a common behavior manifested by the set of
methods. Three class metrics
described here measure the complexity of a class using the
class’s methods, messages and
cohesion.
A.1 Method
A method is an operation upon an object and is defined in the
class declaration.
• METRIC 4: Weighted Methods per Class (WMC)
The WMC is a count of the methods implemented within a class
or the sum of the
complexities of the methods (method complexity is measured by
cyclomatic
complexity). The second measurement is difficult to implement
since not all methods
are accessible within the class hierarchy due to inheritance.
The number of methods
and the complexity of the methods involved is a predictor of
how much time and effort
is required to develop and maintain the class. The larger the
number of methods in a
class, the greater the potential impact on children since children
inherit all of the
page 4
methods defined in a class. Classes with large numbers of
methods are likely to be
more application specific, limiting the possibility of reuse.
This metric measures
Understandability, Maintainability, and Reusability [1,4,5,7].
A.2 Message
A message is a request that an object makes of another object to
perform an operation. The
operation executed as a result of receiving a message is called a
method. The next metric looks
at methods and messages within a class.
• METRIC 5: Response for a Class (RFC)
The RFC is the carnality of the set of all methods that can be
invoked in response to a
message to an object of the class or by some method in the
class. This includes all
methods accessible within the class hierarchy. This metric
looks at the combination of
the complexity of a class through the number of methods and
the amount of
communication with other classes. The larger the number of
methods that can be
invoked from a class through messages, the greater the
complexity of the class. If a
large number of methods can be invoked in response to a
message, the testing and
debugging of the class becomes complicated since it requires a
greater level of
understanding on the part of the tester. A worst case value for
possible responses will
assist in the appropriate allocation of testing time. This metric
evaluates
Understandability, Maintainability, and Testability [1,4,5,7].
A.3 Cohesion
Cohesion is the degree to which methods within a class are
related to one another and work
together to provide well-bounded behavior. Effective object-
oriented designs maximize
cohesion since it promotes encapsulation. The third class
metrics investigates cohesion.
• METRIC 6: Lack of Cohesion of Methods (LCOM)
LCOM measures the degree of similarity of methods by data
input variables or
attributes (structural properties of classes. Any measure of
separateness of methods
helps identify flaws in the design of classes. There are at least
two different ways of
measuring cohesion:
1. Calculate for each data field in a class what percentage of the
methods use that data
field. Average the percentages then subtract from 100%.
Lower percentages mean
greater cohesion of data and methods in the class.
2. Methods are more similar if they operate on the same
attributes. Count the number
of disjoint sets produced from the intersection of the sets of
attributes used by the
methods.
High cohesion indicates good class subdivision. Lack of
cohesion or low cohesion increases
complexity, thereby increasing the likelihood of errors during
the development process. Classes
with low cohesion could probably be subdivided into two or
more subclasses with increased
cohesion. This metric evaluates Efficiency and Reusability
[1,2,4,5,7].
page 5
A.4 Coupling
Coupling is a measure of the strength of association established
by a connection from one entity
to another. Classes (objects) are coupled three ways:
1. When a message is passed between objects, the objects are
said to be coupled.
2. Classes are coupled when methods declared in one class use
methods or attributes of the
other classes.
3. Inheritance introduces significant tight coupling between
superclasses and their
subclasses.
Since good object-oriented design requires a balance between
coupling and inheritance,
coupling measures focus on non-inheritance coupling. The next
object-oriented metric measures
coupling strength.
• METRIC 7: Coupling Between Object Classes (CBO)
CBO is a count of the number of other classes to which a class
is coupled. It is
measured by counting the number of distinct non-inheritance
related class hierarchies
on which a class depends. Excessive coupling is detrimental to
modular design and
prevents reuse. The more independent a class is, the easier it is
reuse in another
application. The larger the number of couples, the higher the
sensitivity to changes in
other parts of the design and therefore maintenance is more
difficult. Strong coupling
complicates a system since a module is harder to understand,
change or correct by itself
if it is interrelated with other modules. Complexity can be
reduced by designing
systems with the weakest possible coupling between modules.
This improves
modularity and promotes encapsulation. CBO evaluates
Efficiency and Reusability
[1,2,3,4,5,7].
B Inheritance
Another design abstraction in object-oriented systems is the use
of inheritance. Inheritance is a
type of relationship among classes that enables programmers to
reuse previously defined objects
including variables and operators. Inheritance decreases
complexity by reducing the number of
operations and operators, but this abstraction of objects can
make maintenance and design
difficult. The two metrics used to measure the amount of
inheritance are the depth and breadth
of the inheritance hierarchy.
• METRIC 8: Depth of Inheritance Tree (DIT)
The depth of a class within the inheritance hierarchy is the
maximum length from the
class node to the root of the tree and is measured by the number
of ancestor classes.
The deeper a class is within the hierarchy, the greater the
number methods it is likely to
inherit making it more complex to predict its behavior. Deeper
trees constitute greater
design complexity, since more methods and classes are
involved, but the greater the
potential for reuse of inherited methods. A support metric for
DIT is the number of
page 6
methods inherited (NMI). This metric primarily evaluates
Efficiency and Reuse but
also relates to Understandability and Testability [1,2,4,5,7].
• METRIC 9: Number of Children (NOC)
The number of children is the number of immediate subclasses
subordinate to a class in
the hierarchy. It is an indicator of the potential influence a
class can have on the design
and on the system. The greater the number of children, the
greater the likelihood of
improper abstraction of the parent and may be a case of misuse
of subclassing. But the
greater the number of children, the greater the reusability since
inheritance is a form of
reuse. If a class has a large number of children, it may require
more testing of the
methods of that class, thus increase the testing time. NOC,
therefore, primarily
evaluates Efficiency, Reusability, and Testability [1,4,5,7].
V. SUMMARY
Product Quality for code and design has five attributes. These
are Efficiency, Complexity,
Understandability, Reusability, and Testability/Maintainability.
The SATC has proposed nine
metrics for object-oriented systems. They cover the key
concepts for object-oriented designs:
methods, classes (cohesion), coupling, and inheritance. For each
metric, threshold values can be
adopted, depending on the applicable quality attributes and the
application objectives. Future
work will be to define criteria for the metrics. That is,
acceptable ranges for each metric will
have to developed, based on the effect of the metric on
desirable software qualities.
REFERENCES
1. Chidamber, Shyam and Kemerer, Chris, “A Metrics Suite for
Object-Oriented Design”,
IEEE Transactions on Software Engineering, June, 1994, pp.
476-492.
2. Hudli, R., Hoskins, C., Hudli, A., “Software Metrics for
Object-oriented Designs”,
IEEE, 1994.
3. Lee, Y., Liang, B., Wang, F., “Some Complexity Metrics for
Object-Oriented Programs
Based on Information Flow”, Proceedings: CompEuro, March,
1993, pp. 302-310.
4. Lorenz, Mark and Kidd, Jeff, Object-Oriented Software
Metrics, Prentice Hall
Publishing, 1994.
5. McCabe & Associates, McCabe Object-Oriented Tool User’s
Instructions, 1994.
6. Set Laboratories, UX Metrics, 1994.
7. Sharble, Robert, and Cohen, Samuel, “The Object-Oriented
Brewery: A Comparison of
Two Object-Oriented Development Methods”, Software
Engineering Notes, Vol 18, No
2., April 1993, pp 60 -73.
8. Tegarden, D., Sheetz, S., Monarchi, D., “Effectiveness of
Traditional Software Metrics
for Object-Oriented Systems”, Proceedings: 25th Hawaii
International Conference on
System Sciences, January, 1992, pp. 359-368.
9. Williams, John D., “Metrics for Object-Oriented Projects”,
Proceedings:
ObjectExpoEuro Conference, July, 1993, pp. 13-18.
I.INTRODUCTIONII.METRIC EVALUATION CRITERIAIII.
TRADITIONAL METRICSA. MethodsIV.OBJECT-ORIENTED
SPECIFIC METRICSA ClassA.1 MethodA.2 MessageA.3
CohesionA.4 CouplingB
InheritanceV.SUMMARYREFERENCES

Más contenido relacionado

Similar a Algorithm ExampleFor the following taskUse the random module .docx

Identification, Analysis & Empirical Validation (IAV) of Object Oriented Desi...
Identification, Analysis & Empirical Validation (IAV) of Object Oriented Desi...Identification, Analysis & Empirical Validation (IAV) of Object Oriented Desi...
Identification, Analysis & Empirical Validation (IAV) of Object Oriented Desi...rahulmonikasharma
 
Thesis Part II EMGT 699
Thesis Part II EMGT 699Thesis Part II EMGT 699
Thesis Part II EMGT 699Karthik Murali
 
Framework for a Software Quality Rating System
Framework for a Software Quality Rating SystemFramework for a Software Quality Rating System
Framework for a Software Quality Rating SystemKarthik Murali
 
Sentiment Analysis on Twitter Data
Sentiment Analysis on Twitter DataSentiment Analysis on Twitter Data
Sentiment Analysis on Twitter DataIRJET Journal
 
Class quality evaluation using class quality scorecards
Class quality evaluation using class quality scorecardsClass quality evaluation using class quality scorecards
Class quality evaluation using class quality scorecardsIAEME Publication
 
Class quality evaluation using class quality
Class quality evaluation using class qualityClass quality evaluation using class quality
Class quality evaluation using class qualityIAEME Publication
 
SOFTWARE MEASUREMENT A PROCESS MODEL
SOFTWARE MEASUREMENT A PROCESS MODELSOFTWARE MEASUREMENT A PROCESS MODEL
SOFTWARE MEASUREMENT A PROCESS MODELAmin Bandeali
 
Gqm paper
Gqm paperGqm paper
Gqm paperinandhu
 
Evolvea Frameworkfor SelectingPrime Software DevelopmentProcess
Evolvea Frameworkfor SelectingPrime Software DevelopmentProcessEvolvea Frameworkfor SelectingPrime Software DevelopmentProcess
Evolvea Frameworkfor SelectingPrime Software DevelopmentProcessIJMER
 
Argument Papers (5-7 pages in length)1. Do schools perpe.docx
Argument Papers (5-7 pages in length)1. Do schools perpe.docxArgument Papers (5-7 pages in length)1. Do schools perpe.docx
Argument Papers (5-7 pages in length)1. Do schools perpe.docxfredharris32
 
A STRUCTURAL APPROACH TO IMPROVE SOFTWARE DESIGN REUSABILITY
A STRUCTURAL APPROACH TO IMPROVE SOFTWARE DESIGN REUSABILITYA STRUCTURAL APPROACH TO IMPROVE SOFTWARE DESIGN REUSABILITY
A STRUCTURAL APPROACH TO IMPROVE SOFTWARE DESIGN REUSABILITYcscpconf
 
SOFTWARE CODE MAINTAINABILITY: A LITERATURE REVIEW
SOFTWARE CODE MAINTAINABILITY: A LITERATURE REVIEWSOFTWARE CODE MAINTAINABILITY: A LITERATURE REVIEW
SOFTWARE CODE MAINTAINABILITY: A LITERATURE REVIEWijseajournal
 
Enhanced Feature Analysis Framework for Comparative Analysis & Evaluation of ...
Enhanced Feature Analysis Framework for Comparative Analysis & Evaluation of ...Enhanced Feature Analysis Framework for Comparative Analysis & Evaluation of ...
Enhanced Feature Analysis Framework for Comparative Analysis & Evaluation of ...IJCSIS Research Publications
 
International Journal on Web Service Computing (IJWSC)
International Journal on Web Service Computing (IJWSC)International Journal on Web Service Computing (IJWSC)
International Journal on Web Service Computing (IJWSC)ijwscjournal
 

Similar a Algorithm ExampleFor the following taskUse the random module .docx (20)

Identification, Analysis & Empirical Validation (IAV) of Object Oriented Desi...
Identification, Analysis & Empirical Validation (IAV) of Object Oriented Desi...Identification, Analysis & Empirical Validation (IAV) of Object Oriented Desi...
Identification, Analysis & Empirical Validation (IAV) of Object Oriented Desi...
 
Thesis Part II EMGT 699
Thesis Part II EMGT 699Thesis Part II EMGT 699
Thesis Part II EMGT 699
 
Framework for a Software Quality Rating System
Framework for a Software Quality Rating SystemFramework for a Software Quality Rating System
Framework for a Software Quality Rating System
 
Sentiment Analysis on Twitter Data
Sentiment Analysis on Twitter DataSentiment Analysis on Twitter Data
Sentiment Analysis on Twitter Data
 
DEVELOPMENT OF A MULTIAGENT BASED METHODOLOGY FOR COMPLEX SYSTEMS
DEVELOPMENT OF A MULTIAGENT BASED METHODOLOGY FOR COMPLEX SYSTEMSDEVELOPMENT OF A MULTIAGENT BASED METHODOLOGY FOR COMPLEX SYSTEMS
DEVELOPMENT OF A MULTIAGENT BASED METHODOLOGY FOR COMPLEX SYSTEMS
 
Class quality evaluation using class quality scorecards
Class quality evaluation using class quality scorecardsClass quality evaluation using class quality scorecards
Class quality evaluation using class quality scorecards
 
Class quality evaluation using class quality
Class quality evaluation using class qualityClass quality evaluation using class quality
Class quality evaluation using class quality
 
SOFTWARE MEASUREMENT A PROCESS MODEL
SOFTWARE MEASUREMENT A PROCESS MODELSOFTWARE MEASUREMENT A PROCESS MODEL
SOFTWARE MEASUREMENT A PROCESS MODEL
 
55 sample chapter
55 sample chapter55 sample chapter
55 sample chapter
 
55 sample chapter
55 sample chapter55 sample chapter
55 sample chapter
 
1811 1815
1811 18151811 1815
1811 1815
 
1811 1815
1811 18151811 1815
1811 1815
 
Object oriented analysis and design unit- i
Object oriented analysis and design unit- iObject oriented analysis and design unit- i
Object oriented analysis and design unit- i
 
Gqm paper
Gqm paperGqm paper
Gqm paper
 
Evolvea Frameworkfor SelectingPrime Software DevelopmentProcess
Evolvea Frameworkfor SelectingPrime Software DevelopmentProcessEvolvea Frameworkfor SelectingPrime Software DevelopmentProcess
Evolvea Frameworkfor SelectingPrime Software DevelopmentProcess
 
Argument Papers (5-7 pages in length)1. Do schools perpe.docx
Argument Papers (5-7 pages in length)1. Do schools perpe.docxArgument Papers (5-7 pages in length)1. Do schools perpe.docx
Argument Papers (5-7 pages in length)1. Do schools perpe.docx
 
A STRUCTURAL APPROACH TO IMPROVE SOFTWARE DESIGN REUSABILITY
A STRUCTURAL APPROACH TO IMPROVE SOFTWARE DESIGN REUSABILITYA STRUCTURAL APPROACH TO IMPROVE SOFTWARE DESIGN REUSABILITY
A STRUCTURAL APPROACH TO IMPROVE SOFTWARE DESIGN REUSABILITY
 
SOFTWARE CODE MAINTAINABILITY: A LITERATURE REVIEW
SOFTWARE CODE MAINTAINABILITY: A LITERATURE REVIEWSOFTWARE CODE MAINTAINABILITY: A LITERATURE REVIEW
SOFTWARE CODE MAINTAINABILITY: A LITERATURE REVIEW
 
Enhanced Feature Analysis Framework for Comparative Analysis & Evaluation of ...
Enhanced Feature Analysis Framework for Comparative Analysis & Evaluation of ...Enhanced Feature Analysis Framework for Comparative Analysis & Evaluation of ...
Enhanced Feature Analysis Framework for Comparative Analysis & Evaluation of ...
 
International Journal on Web Service Computing (IJWSC)
International Journal on Web Service Computing (IJWSC)International Journal on Web Service Computing (IJWSC)
International Journal on Web Service Computing (IJWSC)
 

Más de daniahendric

Variables in a Research Study and Data CollectionIn this assignmen.docx
Variables in a Research Study and Data CollectionIn this assignmen.docxVariables in a Research Study and Data CollectionIn this assignmen.docx
Variables in a Research Study and Data CollectionIn this assignmen.docxdaniahendric
 
Variation exists in virtually all parts of our lives. We often see v.docx
Variation exists in virtually all parts of our lives. We often see v.docxVariation exists in virtually all parts of our lives. We often see v.docx
Variation exists in virtually all parts of our lives. We often see v.docxdaniahendric
 
Valerie Matsumotos Desperately Seeking Deirde  Gender Roles, Mu.docx
Valerie Matsumotos Desperately Seeking Deirde  Gender Roles, Mu.docxValerie Matsumotos Desperately Seeking Deirde  Gender Roles, Mu.docx
Valerie Matsumotos Desperately Seeking Deirde  Gender Roles, Mu.docxdaniahendric
 
valerie is a 15 year old girl who has recently had signs of a high f.docx
valerie is a 15 year old girl who has recently had signs of a high f.docxvalerie is a 15 year old girl who has recently had signs of a high f.docx
valerie is a 15 year old girl who has recently had signs of a high f.docxdaniahendric
 
Utilizing the Statement of Financial Position on page 196 of the Acc.docx
Utilizing the Statement of Financial Position on page 196 of the Acc.docxUtilizing the Statement of Financial Position on page 196 of the Acc.docx
Utilizing the Statement of Financial Position on page 196 of the Acc.docxdaniahendric
 
Utech Company has income before irregular items of $307,500 for the .docx
Utech Company has income before irregular items of $307,500 for the .docxUtech Company has income before irregular items of $307,500 for the .docx
Utech Company has income before irregular items of $307,500 for the .docxdaniahendric
 
Using your work experience in the public and nonprofit sector, and t.docx
Using your work experience in the public and nonprofit sector, and t.docxUsing your work experience in the public and nonprofit sector, and t.docx
Using your work experience in the public and nonprofit sector, and t.docxdaniahendric
 
Using your textbook, provide a detailed and specific definition to.docx
Using your textbook, provide a detailed and specific definition to.docxUsing your textbook, provide a detailed and specific definition to.docx
Using your textbook, provide a detailed and specific definition to.docxdaniahendric
 
Using your text and at least one scholarly source, prepare a two to .docx
Using your text and at least one scholarly source, prepare a two to .docxUsing your text and at least one scholarly source, prepare a two to .docx
Using your text and at least one scholarly source, prepare a two to .docxdaniahendric
 
Using Walgreen Company as the target organization complete the.docx
Using Walgreen Company as the target organization complete the.docxUsing Walgreen Company as the target organization complete the.docx
Using Walgreen Company as the target organization complete the.docxdaniahendric
 
Using the text book and power point on Interest Groups, please ans.docx
Using the text book and power point on Interest Groups, please ans.docxUsing the text book and power point on Interest Groups, please ans.docx
Using the text book and power point on Interest Groups, please ans.docxdaniahendric
 
Using the template provided in attachment create your own layout.R.docx
Using the template provided in attachment create your own layout.R.docxUsing the template provided in attachment create your own layout.R.docx
Using the template provided in attachment create your own layout.R.docxdaniahendric
 
Using the simplified OOD methodologyWrite down a detailed descrip.docx
Using the simplified OOD methodologyWrite down a detailed descrip.docxUsing the simplified OOD methodologyWrite down a detailed descrip.docx
Using the simplified OOD methodologyWrite down a detailed descrip.docxdaniahendric
 
Using the text, Cognitive Psychology 5 edition (Galotti, 2014), .docx
Using the text, Cognitive Psychology 5 edition (Galotti, 2014), .docxUsing the text, Cognitive Psychology 5 edition (Galotti, 2014), .docx
Using the text, Cognitive Psychology 5 edition (Galotti, 2014), .docxdaniahendric
 
Using the Tana Basin in Kenya,1.Discuss the water sources and .docx
Using the Tana Basin in Kenya,1.Discuss the water sources and .docxUsing the Tana Basin in Kenya,1.Discuss the water sources and .docx
Using the Tana Basin in Kenya,1.Discuss the water sources and .docxdaniahendric
 
Using the template provided in a separate file, create your own la.docx
Using the template provided in a separate file, create your own la.docxUsing the template provided in a separate file, create your own la.docx
Using the template provided in a separate file, create your own la.docxdaniahendric
 
Using the template provided in attachment create your own layo.docx
Using the template provided in attachment create your own layo.docxUsing the template provided in attachment create your own layo.docx
Using the template provided in attachment create your own layo.docxdaniahendric
 
Using the Sex(abled) video, the sexuality section in the Falvo text.docx
Using the Sex(abled) video, the sexuality section in the Falvo text.docxUsing the Sex(abled) video, the sexuality section in the Falvo text.docx
Using the Sex(abled) video, the sexuality section in the Falvo text.docxdaniahendric
 
Using the required and recommended resources from this week and last.docx
Using the required and recommended resources from this week and last.docxUsing the required and recommended resources from this week and last.docx
Using the required and recommended resources from this week and last.docxdaniahendric
 
Using the Internet, textbook or related resources, research the crea.docx
Using the Internet, textbook or related resources, research the crea.docxUsing the Internet, textbook or related resources, research the crea.docx
Using the Internet, textbook or related resources, research the crea.docxdaniahendric
 

Más de daniahendric (20)

Variables in a Research Study and Data CollectionIn this assignmen.docx
Variables in a Research Study and Data CollectionIn this assignmen.docxVariables in a Research Study and Data CollectionIn this assignmen.docx
Variables in a Research Study and Data CollectionIn this assignmen.docx
 
Variation exists in virtually all parts of our lives. We often see v.docx
Variation exists in virtually all parts of our lives. We often see v.docxVariation exists in virtually all parts of our lives. We often see v.docx
Variation exists in virtually all parts of our lives. We often see v.docx
 
Valerie Matsumotos Desperately Seeking Deirde  Gender Roles, Mu.docx
Valerie Matsumotos Desperately Seeking Deirde  Gender Roles, Mu.docxValerie Matsumotos Desperately Seeking Deirde  Gender Roles, Mu.docx
Valerie Matsumotos Desperately Seeking Deirde  Gender Roles, Mu.docx
 
valerie is a 15 year old girl who has recently had signs of a high f.docx
valerie is a 15 year old girl who has recently had signs of a high f.docxvalerie is a 15 year old girl who has recently had signs of a high f.docx
valerie is a 15 year old girl who has recently had signs of a high f.docx
 
Utilizing the Statement of Financial Position on page 196 of the Acc.docx
Utilizing the Statement of Financial Position on page 196 of the Acc.docxUtilizing the Statement of Financial Position on page 196 of the Acc.docx
Utilizing the Statement of Financial Position on page 196 of the Acc.docx
 
Utech Company has income before irregular items of $307,500 for the .docx
Utech Company has income before irregular items of $307,500 for the .docxUtech Company has income before irregular items of $307,500 for the .docx
Utech Company has income before irregular items of $307,500 for the .docx
 
Using your work experience in the public and nonprofit sector, and t.docx
Using your work experience in the public and nonprofit sector, and t.docxUsing your work experience in the public and nonprofit sector, and t.docx
Using your work experience in the public and nonprofit sector, and t.docx
 
Using your textbook, provide a detailed and specific definition to.docx
Using your textbook, provide a detailed and specific definition to.docxUsing your textbook, provide a detailed and specific definition to.docx
Using your textbook, provide a detailed and specific definition to.docx
 
Using your text and at least one scholarly source, prepare a two to .docx
Using your text and at least one scholarly source, prepare a two to .docxUsing your text and at least one scholarly source, prepare a two to .docx
Using your text and at least one scholarly source, prepare a two to .docx
 
Using Walgreen Company as the target organization complete the.docx
Using Walgreen Company as the target organization complete the.docxUsing Walgreen Company as the target organization complete the.docx
Using Walgreen Company as the target organization complete the.docx
 
Using the text book and power point on Interest Groups, please ans.docx
Using the text book and power point on Interest Groups, please ans.docxUsing the text book and power point on Interest Groups, please ans.docx
Using the text book and power point on Interest Groups, please ans.docx
 
Using the template provided in attachment create your own layout.R.docx
Using the template provided in attachment create your own layout.R.docxUsing the template provided in attachment create your own layout.R.docx
Using the template provided in attachment create your own layout.R.docx
 
Using the simplified OOD methodologyWrite down a detailed descrip.docx
Using the simplified OOD methodologyWrite down a detailed descrip.docxUsing the simplified OOD methodologyWrite down a detailed descrip.docx
Using the simplified OOD methodologyWrite down a detailed descrip.docx
 
Using the text, Cognitive Psychology 5 edition (Galotti, 2014), .docx
Using the text, Cognitive Psychology 5 edition (Galotti, 2014), .docxUsing the text, Cognitive Psychology 5 edition (Galotti, 2014), .docx
Using the text, Cognitive Psychology 5 edition (Galotti, 2014), .docx
 
Using the Tana Basin in Kenya,1.Discuss the water sources and .docx
Using the Tana Basin in Kenya,1.Discuss the water sources and .docxUsing the Tana Basin in Kenya,1.Discuss the water sources and .docx
Using the Tana Basin in Kenya,1.Discuss the water sources and .docx
 
Using the template provided in a separate file, create your own la.docx
Using the template provided in a separate file, create your own la.docxUsing the template provided in a separate file, create your own la.docx
Using the template provided in a separate file, create your own la.docx
 
Using the template provided in attachment create your own layo.docx
Using the template provided in attachment create your own layo.docxUsing the template provided in attachment create your own layo.docx
Using the template provided in attachment create your own layo.docx
 
Using the Sex(abled) video, the sexuality section in the Falvo text.docx
Using the Sex(abled) video, the sexuality section in the Falvo text.docxUsing the Sex(abled) video, the sexuality section in the Falvo text.docx
Using the Sex(abled) video, the sexuality section in the Falvo text.docx
 
Using the required and recommended resources from this week and last.docx
Using the required and recommended resources from this week and last.docxUsing the required and recommended resources from this week and last.docx
Using the required and recommended resources from this week and last.docx
 
Using the Internet, textbook or related resources, research the crea.docx
Using the Internet, textbook or related resources, research the crea.docxUsing the Internet, textbook or related resources, research the crea.docx
Using the Internet, textbook or related resources, research the crea.docx
 

Último

Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 

Último (20)

Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 

Algorithm ExampleFor the following taskUse the random module .docx

  • 1. Algorithm Example For the following task: Use the random module to write a number guessing game. The number the computer chooses should change each time you run the program. Repeatedly ask the user for a number. If the number is different from the computer's let the user know if they guessed too high or too low. If the number matches the computer's, the user wins. Keep track of the number of tries it takes the user to guess it. An appropriate algorithm might be: Import the random module Display a welcome message to the user Choose a random number between 1 and 100 Get a guess from the user Set a number of tries to 0 As long as their guess isn’t the number Check if guess is lower than computer If so, print a lower message. Otherwise, is it higher? If so, print a higher message. Get another guess Increment the tries Repeat When they guess the computer's number, display the number and their tries count Notice that each line in the algorithm corresponds to roughly a
  • 2. line of code in Python, but there is no coding itself in the algorithm. Rather the algorithm lays out what needs to happen step by step to achieve the program. Software Quality Metrics for Object-Oriented Environments AUTHORS: Dr. Linda H. Rosenberg Lawrence E. Hyatt Unisys Government Systems Software Assurance Technology Center Goddard Space Flight Center Goddard Space Flight Center Bld 6 Code 300.1 Bld 6 Code 302 Greenbelt, MD 20771 USA Greenbelt, MD 20771 USA I. INTRODUCTION Object-oriented design and development are popular concepts in today’s software development environment. They are often heralded as the silver bullet for solving software problems. While in reality there is no silver bullet, object-oriented development has proved its value for systems that must be maintained and modified. Object-oriented software development requires a different approach from more traditional functional decomposition and data flow development methods. This includes the software metrics used to evaluate object-oriented software. The concepts of software metrics are well established, and many metrics relating to product quality have been developed and used. With object-oriented analysis and design methodologies
  • 3. gaining popularity, it is time to start investigating object- oriented metrics with respect to software quality. We are interested in the answer to the following questions: • What concepts and structures in object-oriented design affect the quality of the software? • Can traditional metrics measure the critical object-oriented structures? • If so, are the threshold values for the metrics the same for object-oriented designs as for functional/data designs? • Which of the many new metrics found in the literature are useful to measure the critical concepts of object-oriented structures? II. METRIC EVALUATION CRITERIA While metrics for the traditional functional decomposition and data analysis design approach measure the design structure and/or data structure independently, object-oriented metrics must be able to focus on the combination of function and data as an integrated object [1]. The evaluation of the utility of a metric as a quantitative measure of software quality was based on the measurement of a software quality attribute. The metrics selected, however, are useful in a wide range of models. The object-oriented metric criteria, therefore, are to be used to evaluate the following attributes: • Efficiency - Are the constructs efficiently designed?
  • 4. • Complexity - Could the constructs be used more effectively to decrease the architectural complexity? • Understandability - Does the design increase the psychological complexity? • Reusability - Does the design quality support possible reuse? • Testability/Maintainability - Does the structure support ease of testing and changes? page 1 Whether a metric is “traditional” or “new”, it must be effective in measuring one or more of these attributes. As each metric is presented, we will briefly discuss its applicability. The SATC’s approach to identifying a set of object-oriented metrics was to focus on the primary, critical constructs of object-oriented design and to select metrics that apply to those areas. The suggested metrics are supported by most literature and some object-oriented tools. The metrics evaluate the object-oriented concepts: methods, classes, coupling, and inheritance. The metrics focus on internal object structure, external measures of the interactions among entities, measures of the efficiency of an algorithm and the use of machine resources, as well as psychological measures that affect the ability of a programmer to create, comprehend, modify, and maintain software.
  • 5. We support the use of three traditional metrics and present six additional metrics specifically for object-oriented systems. The SATC has found that there is considerable disagreement in the field about software quality metrics for object-oriented systems [1,4]. Some researchers and practitioners contend traditional metrics are inappropriate for object-oriented systems. There are valid reasons for applying traditional metrics, however, if it can be done. The traditional metrics have been widely used, they are well understood by researchers and practitioners, and their relationships to software quality attributes have been validated [1,4,8,9] Preceding each metric, a brief description of the object-oriented structure is given. Each metric is then described, interpretation guidelines given, and the applicable quality attributes listed. III. TRADITIONAL METRICS A. Methods In an object-oriented system, traditional metrics are generally applied to the methods that comprise the operations of a class. A method is a component of an object that operates on data in response to a message and is defined as part of the declaration of a class. Methods reflect how a problem is broken into segments and the capabilities other classes expect of a given class. Two traditional metrics are discussed here: cyclomatic complexity and size (line counts). • METRIC 1: Cyclomatic Complexity (CC)
  • 6. Cyclomatic complexity (McCabe) is used to evaluate the complexity of an algorithm in a method. A method with a low cyclomatic complexity is generally better, although it may mean that decisions are deferred through message passing, not that the method is not complex. Cyclomatic complexity cannot be used to measure the complexity of a class because of inheritance, but the cyclomatic complexity of individual methods can be combined with other measures to evaluate the complexity of the class. In general, the cyclomatic complexity for a method should be below ten, indicating decisions are deferred through message passing. Although this metric is specifically applicable to the evaluation of quality attribute Complexity, it also is related to all of the other attributes [2,3,4,5,8]. • METRIC 2: Size page 2 page 3 Size of a method is used to evaluate the ease of understandability of the code by developers and maintainers. Size can be measured in a variety of ways. These include counting all physical lines of code, the number of statements, and the number of blank lines. Thresholds for evaluating the size measures vary
  • 7. depending on the coding language used and the complexity of the method. However, since size affects ease of understanding, routines of large size will always pose a higher risk in the attributes of Understandability, Reusability, and Maintainability. [2,4,5,8] • METRIC 3: Comment Percentage The line counts done to compute the Size metric can be expanded to include a count of the number of comments, both on-line (with code) and stand- alone. The comment percentage is calculated by the total number of comments divided by the total lines of code less the number of blank lines. The SATC has found a comment percentage of about 30% is most effective. Since comments assist developers and maintainers, this metric is used to evaluate the attributes of Understandability, Reusability, and Maintainability [6]. IV. OBJECT-ORIENTED SPECIFIC METRICS As discussed, many different metrics have been proposed for object-oriented systems. The object-oriented metrics that were chosen by the SATC measure principle structures that, if improperly designed, negatively affect the design and code quality attributes. The selected object-oriented metrics are primarily applied to the concepts of classes, coupling, and inheritance. For some of the object-oriented metrics discussed here, multiple definitions are
  • 8. given, since researchers and practitioners have not reached a common definition or counting methodology. In some cases, the counting method for a metric is determined by the software analysis package being used to collect the metrics. A Class A class is a template from which objects can be created. This set of objects share a common structure and a common behavior manifested by the set of methods. Three class metrics described here measure the complexity of a class using the class’s methods, messages and cohesion. A.1 Method A method is an operation upon an object and is defined in the class declaration. • METRIC 4: Weighted Methods per Class (WMC) The WMC is a count of the methods implemented within a class or the sum of the complexities of the methods (method complexity is measured by cyclomatic complexity). The second measurement is difficult to implement since not all methods are accessible within the class hierarchy due to inheritance. The number of methods and the complexity of the methods involved is a predictor of how much time and effort is required to develop and maintain the class. The larger the number of methods in a class, the greater the potential impact on children since children inherit all of the
  • 9. page 4 methods defined in a class. Classes with large numbers of methods are likely to be more application specific, limiting the possibility of reuse. This metric measures Understandability, Maintainability, and Reusability [1,4,5,7]. A.2 Message A message is a request that an object makes of another object to perform an operation. The operation executed as a result of receiving a message is called a method. The next metric looks at methods and messages within a class. • METRIC 5: Response for a Class (RFC) The RFC is the carnality of the set of all methods that can be invoked in response to a message to an object of the class or by some method in the class. This includes all methods accessible within the class hierarchy. This metric looks at the combination of the complexity of a class through the number of methods and the amount of communication with other classes. The larger the number of methods that can be invoked from a class through messages, the greater the complexity of the class. If a large number of methods can be invoked in response to a message, the testing and debugging of the class becomes complicated since it requires a
  • 10. greater level of understanding on the part of the tester. A worst case value for possible responses will assist in the appropriate allocation of testing time. This metric evaluates Understandability, Maintainability, and Testability [1,4,5,7]. A.3 Cohesion Cohesion is the degree to which methods within a class are related to one another and work together to provide well-bounded behavior. Effective object- oriented designs maximize cohesion since it promotes encapsulation. The third class metrics investigates cohesion. • METRIC 6: Lack of Cohesion of Methods (LCOM) LCOM measures the degree of similarity of methods by data input variables or attributes (structural properties of classes. Any measure of separateness of methods helps identify flaws in the design of classes. There are at least two different ways of measuring cohesion: 1. Calculate for each data field in a class what percentage of the methods use that data field. Average the percentages then subtract from 100%. Lower percentages mean greater cohesion of data and methods in the class. 2. Methods are more similar if they operate on the same attributes. Count the number of disjoint sets produced from the intersection of the sets of attributes used by the
  • 11. methods. High cohesion indicates good class subdivision. Lack of cohesion or low cohesion increases complexity, thereby increasing the likelihood of errors during the development process. Classes with low cohesion could probably be subdivided into two or more subclasses with increased cohesion. This metric evaluates Efficiency and Reusability [1,2,4,5,7]. page 5 A.4 Coupling Coupling is a measure of the strength of association established by a connection from one entity to another. Classes (objects) are coupled three ways: 1. When a message is passed between objects, the objects are said to be coupled. 2. Classes are coupled when methods declared in one class use methods or attributes of the other classes. 3. Inheritance introduces significant tight coupling between superclasses and their subclasses. Since good object-oriented design requires a balance between coupling and inheritance,
  • 12. coupling measures focus on non-inheritance coupling. The next object-oriented metric measures coupling strength. • METRIC 7: Coupling Between Object Classes (CBO) CBO is a count of the number of other classes to which a class is coupled. It is measured by counting the number of distinct non-inheritance related class hierarchies on which a class depends. Excessive coupling is detrimental to modular design and prevents reuse. The more independent a class is, the easier it is reuse in another application. The larger the number of couples, the higher the sensitivity to changes in other parts of the design and therefore maintenance is more difficult. Strong coupling complicates a system since a module is harder to understand, change or correct by itself if it is interrelated with other modules. Complexity can be reduced by designing systems with the weakest possible coupling between modules. This improves modularity and promotes encapsulation. CBO evaluates Efficiency and Reusability [1,2,3,4,5,7]. B Inheritance Another design abstraction in object-oriented systems is the use of inheritance. Inheritance is a type of relationship among classes that enables programmers to reuse previously defined objects including variables and operators. Inheritance decreases complexity by reducing the number of
  • 13. operations and operators, but this abstraction of objects can make maintenance and design difficult. The two metrics used to measure the amount of inheritance are the depth and breadth of the inheritance hierarchy. • METRIC 8: Depth of Inheritance Tree (DIT) The depth of a class within the inheritance hierarchy is the maximum length from the class node to the root of the tree and is measured by the number of ancestor classes. The deeper a class is within the hierarchy, the greater the number methods it is likely to inherit making it more complex to predict its behavior. Deeper trees constitute greater design complexity, since more methods and classes are involved, but the greater the potential for reuse of inherited methods. A support metric for DIT is the number of page 6 methods inherited (NMI). This metric primarily evaluates Efficiency and Reuse but also relates to Understandability and Testability [1,2,4,5,7]. • METRIC 9: Number of Children (NOC) The number of children is the number of immediate subclasses subordinate to a class in the hierarchy. It is an indicator of the potential influence a
  • 14. class can have on the design and on the system. The greater the number of children, the greater the likelihood of improper abstraction of the parent and may be a case of misuse of subclassing. But the greater the number of children, the greater the reusability since inheritance is a form of reuse. If a class has a large number of children, it may require more testing of the methods of that class, thus increase the testing time. NOC, therefore, primarily evaluates Efficiency, Reusability, and Testability [1,4,5,7]. V. SUMMARY Product Quality for code and design has five attributes. These are Efficiency, Complexity, Understandability, Reusability, and Testability/Maintainability. The SATC has proposed nine metrics for object-oriented systems. They cover the key concepts for object-oriented designs: methods, classes (cohesion), coupling, and inheritance. For each metric, threshold values can be adopted, depending on the applicable quality attributes and the application objectives. Future work will be to define criteria for the metrics. That is, acceptable ranges for each metric will have to developed, based on the effect of the metric on desirable software qualities. REFERENCES 1. Chidamber, Shyam and Kemerer, Chris, “A Metrics Suite for Object-Oriented Design”, IEEE Transactions on Software Engineering, June, 1994, pp. 476-492.
  • 15. 2. Hudli, R., Hoskins, C., Hudli, A., “Software Metrics for Object-oriented Designs”, IEEE, 1994. 3. Lee, Y., Liang, B., Wang, F., “Some Complexity Metrics for Object-Oriented Programs Based on Information Flow”, Proceedings: CompEuro, March, 1993, pp. 302-310. 4. Lorenz, Mark and Kidd, Jeff, Object-Oriented Software Metrics, Prentice Hall Publishing, 1994. 5. McCabe & Associates, McCabe Object-Oriented Tool User’s Instructions, 1994. 6. Set Laboratories, UX Metrics, 1994. 7. Sharble, Robert, and Cohen, Samuel, “The Object-Oriented Brewery: A Comparison of Two Object-Oriented Development Methods”, Software Engineering Notes, Vol 18, No 2., April 1993, pp 60 -73. 8. Tegarden, D., Sheetz, S., Monarchi, D., “Effectiveness of Traditional Software Metrics for Object-Oriented Systems”, Proceedings: 25th Hawaii International Conference on System Sciences, January, 1992, pp. 359-368. 9. Williams, John D., “Metrics for Object-Oriented Projects”, Proceedings: ObjectExpoEuro Conference, July, 1993, pp. 13-18. I.INTRODUCTIONII.METRIC EVALUATION CRITERIAIII. TRADITIONAL METRICSA. MethodsIV.OBJECT-ORIENTED SPECIFIC METRICSA ClassA.1 MethodA.2 MessageA.3