Chapter 2
Chapter 2
We need to define models to help us understand what we are doing, provide a basis for defining goals,
and provide a basis for measurement. In what follows we define model as an abstraction of a real world
process. It attempts to explain what is going on by making assumptions and simplifying the environment.
It gives us a viewpoint of the software development process, product or environment by classifying
various phenomena, abstracting from reality, and isolating the aspects of interest. There are models of
resource use, complexity, reliability, change, defects, etc. We define metric as a quantitative measure of
extent or degree to which something possesses and exhibits a certain characteristic, quality, property, or
attribute.
We need of people, (e.g., customer, manager, developer), processes, and products in order to
understand what they are and how they work. Most importantly, we need to study the interactions of
these models. These models do not have to be formal. We can have informal models that provide
visibility into the items of interest. Let us consider a few such models.
2.1
and isolating faults before they are executed. We can detect faults and failures after they have been put
into various documents, and can isolate faults.
The bottom half of the figure is a model of the activities carried out during the software development
process. Given a problem, an attempt is made to understand the problem in order to construct solutions.
Those solutions are then documented and those documents may be analyzed. Based upon our
understanding of the documents, we create lower level solutions, e.g. from specifications we create
design, from design we create code, etc. One of those documents, the is executable and provides
results from that execution. Those results can also be analyzed. During the entire process there are
management activities that go on, dealing with the flow of information, for example.
We combine these too models in order to provide some insights for selecting methods, techniques and
tools that will allow us to minimize the number of defects associated with software activities. Beginning
on the left hand side of the diagram, we are interested in preventing errors. Where can we prevent
errors or misunderstandings from ever entering the system in the first place.We can do that by
preventing errors in our understanding of the problem, constructing of solutions, documenting of
solutions, and understanding of various documents to create lower level solutions.
Methods, techniques and tools that prevent errors in problem understanding include education and
training in the problem domain as well in the requirements of similar projects; simulations of the users
needs; clear, unambiguous, consistency and completeness checking notations for writing the
requirements, etc. Approaches to preventing errors in the construction of solutions include education
and training in the solution domain; prior experience with solving similar problems; etc. Approaches to
preventing errors in documentation and management include the education, training and use of good
methods that have been shown to be effective for this problem domain and environment.
Approaches to preventing faults in documenting or recording solutions, include syntax-directed
compilers and or document preparation tools that forbid the recording of certain types of
misunderstandings. These tools do not prevent all types of faults from entering the system but usually
concentrate on a particular type of fault, e.g., a syntax-directed editor focuses on preventing syntactic
faults and some semantic faults that can be detected by a compiler.
We can isolate and detect faults during the analysis of documents by the education, training, and use of
good reading techniques and methods that have been shown to be effective for this problems domain
and environment, as discussed in the last section. We can detect failures by good testing techniques and
methods, tailored to the types of errors, faults and failures, expected in this environment.
Based upon the interaction of these two models, we can define various software defect classification
schemes that allow us to better understand the kinds of defects we make so we can choose the
appropriate techniques, methods and tools for our environment. For example, error classification
schemes include:
Error origin - the phase or activity in which the misunderstanding took place. Example subclasses
include: requirements, specification, design, code, unit test, system test, acceptance test, maintenance
2.2
Error domain - the object or domain of the misunderstanding. Example subclasses include:
application, problem-solution, notation <semantics, syntax>, environment, information management,
clerical where application is a misunderstanding of the problem or application domain, problem-solution
is a misunderstanding of the solution space, semantics and syntax are misunderstandings of the
semantics of syntax of the notation used to express the problem or solution, environment is a
misunderstanding of the compiler, operating system or external interface, information management is a
misunderstanding due to communication, and clerical is a mistyping or misspelling
Document error type - the form of misunderstanding contained in a document. Example subclasses
include: ambiguity, omission, inconsistency, incorrect fact, wrong section
Change effect - the number of modules changed to fix an error
Fault classification schemes include:
Fault detection time - the phase or activity in which the fault was detected. Example subclasses
include requirements, specification, design, code, unit test, system test, acceptance test, maintenance
Fault Density - number of faults per KLOC
Effort to Isolate/Fix - the time taken to isolate of fix a fault usually in intervals of time, e.g., 1 hour or
less, 1 hour to 1 day, 1 day to 3 days, more than 3 days
Omission/commission - where omission is neglecting to include some entity and commission is the
inclusion of some incorrect executable statement or fact
Algorithmic fault - the problem with the algorithm, e.g., control flow, interface, data <definition,
initialization, use>, where control flow is an incorrect path taken, interface is a fault associated with
structures outside the modules environment, definition is the incorrect definition of a variable or data
type, initialization is a failure to initialize data on entry/exit, and use is the incorrect use of a data
structure, or an erroneous evaluation of a variables value
Failure classification schemes include:
Failure detection time - the phase or activity in which the failure was detected. Example, subclasses
include: unit test, system test, acceptance test, operation
System Severity - the level of effect the failure has on the system. Example subclasses include:
operation stops completely, operation is significantly impacted, prevents full use of features but can be
compensated, minor or cosmetic
2.3
Customer Impact - the level of effect the failure has on the customer. Example subclasses re usually
similar to the subclasses for system severity but filled out from the customer perspective so the same
failures may be categorized differently because of subjective implications and customer satisfaction
issues
Although each of these classes may be interesting in their own right, we are often interested in the
combination of classes of errors. For example, the relationship between system severity failures and
faults of omission/commission. Are the highest severity faults caused by leaving something out or putting
in the wrong thing? What is the average effort to isolate/fix a fault of omission or a control flow fault or a
requirements error or an application error.
This model not only provides insights into how we can make and prevent defects in the software
development process, it also provides a basis for defining measures and analyzing those measures.
Specification phase
Design phase
Code phase
|
|
|
REQUIREMENTS
_________444
|
|
|
SPECIFICATION
_________444
|
|
|
DESIGN
________444
|
|
|
CODE
________444
2.4
Test
phase
|
|
|
TEST RESULTS
________444
Figure 6
For example, if the document is the requirements document then potential consumers include the user,
tester, developer, maintainer, software quality assurer, the hardware engineer, etc.
Requirements
|
_________________|
|
R
E
Q
| 4
Design
| 4 ________________
| 4
This assumes that each document is reviewed from the perspective of each of its consumers and the
producers should have those consumers in mind when writing the document. This assumes model of the
software development process as shown in figure 6.
It is clear from figure 6 that there are a large variety of consumers for the various documents and thus a
large variety of perspectives from which each document should be evaluated, e.g., user, customer,
system analyst, designer, coder, system tester, maintainer, quality assurer, hardware engineer, etc. It
would be impractical for each of these consumers to review each document. Thus a practical solution is
to choose an appropriate subset for each document. The subset might include the person producing the
document from which the current document was produced as well as the immediate consumer of the
current document. For example one set of reviewers is offered in figure 7.
Documents
Perspectives
Req Spec Design Code Test
________________________________________________________
|
Customer
| 4 4
|
2.5
System analyst
| 4
4
4
|
Designer
|
4
4 4
|
Coder
|
4
|
System tester
| 4
4
4
|
Maintainer
|
4
4
|
Quality
|
4
_________________________________________________________________
Figure 7. Example Reviewers for Documents
Although this model does not directly generate metrics, it does define measurement points, measurement
perspectives, and insights into the quality of the intermediate products. In the next section we will
provide a basis for measuring these perspectives.
2.6
productivity
work productivity
cost
environment
capital investment
In many software environments, productivity is defined in terms of lines of code per unit of effort. In the
contest o this model, that definition is at best a definition of work productivity and at that is only a very
weak approximation. For example how good a measure of function is lines of code? Is the product,
process, and environment taken into account to differentiate the possible levels of productivity for
different contexts?
Although this model is the least insightful with regard to metrics, it is very useful in terms of
understanding whether we are measuring the right thing and does provide some insights into the fact that
we cannot use lines of code per unit of effort as a measure across the industry for comparison because
of the influence of the different product, process, and environment factors. In some sense it shows that
lines of code per unit of effort is a complexity measure; it tells us how expensive it is to produce lines of
code for a particular project given the context and individuals involved.
We have seen three different models, each offering some understanding of the software process and
product and the nature of the business. Hopefully they have demonstrated the importance of modeling.
Whenever we build a model we should ask certain specific questions: Is the model correct in principle?
Does the model actually describe what we are doing? How can we improve the model based on theory,
practice and analysis? How do we feed back what we have learned to improve the model or our
adherence to it?
In order to improve the software development process and product, we need to better understand.
This implies the building of models. We want to build descriptive models to explain what is happening.
This allows us to better understand the nature of the business locally. Using these models we can
analyze and experiment with improvements in technology. Then we want to define prescriptive models
to motivate that improvement.
2.7
2.8