Introduction To Testing As An Engineering Activity
Introduction To Testing As An Engineering Activity
Introduction To Testing As An Engineering Activity
Software systems are becoming more challenging to build. They are playing an increasingly
important role in society. Pressure for software professionals to focus on quality issues. Poor quality
software that can cause loss of life or property is no longer acceptable to society. Highest quality
attributes are reliability, correctness, usability, and the ability to meet all user requirements
Testing as a Process
Process, in the software engineering domain, is the set of methods, practices, standards, documents,
activities, policies, and procedures that software engineers use to develop and maintain a software
system and its associated artifacts, such as project and test plans, design documents, code, and manuals.
Embedded within the software development process are several other processes including testing.
Testing itself is related to two other processes called verification and validation
.
Validation is the process of evaluating a software system or component during, or at the end of, the
development cycle in order to determine whether it satisfies specified requirements
Verification is the process of evaluating a software system or component to determine whether the
products of a given development phase satisfy the conditions imposed at the start of that phase
Economic aspects are related to the reality that resources and time are available to the testing group on a
limited basis.
The technical aspects of testing relate to the techniques, methods, measurements, and tools used to
insure that the software under test is as defect-free and reliable as possible for the conditions and
constraints under which it must operate
The managerial aspects means that an organizational policy for testing must be defined and documented.
TMM Levels
As in the case of the CMM, the TMM also follows what is called a staged architecture for process
improvement models. It contains stages or levels through which an organization passes as its testing
process evolves from one that is ad hoc and unmanaged to one that is managed, defined, measured, and
optimizable.
At TMM level 1, testing is a chaotic process; it is ill-defined, and not distinguished from debugging.
Level 3—Integration:
Goal 3: Integrate testing into the software life cycle; Goal 4: Control and monitor testing
Level 4—Management and Measurement:
Basic definitions
Errors
Faults
Failures
A failure is the inability of a software system or component to perform its required functions
within specified performance requirements
Test Cases
2. Execution conditions
3. Expected outputs
Test
A test is a group of related test cases, or a group of related test cases and test procedures
Test Oracle
A test oracle is a document, or piece of software that allows testers to determine whether a test
has been passed or failed.
Test Bed
A test bed is an environment that contains all the hardware and software needed to test a
software component or a software system
Software Quality
Quality relates to the degree to which a system, system component, or process meets specified
requirements.
Quality metrics
1. Correctness
2. Reliability
3. Usability
4. Integrity
5. Portability
6. Maintainability
7. interoperability
Testing principles are important to test specialists/engineers because they provide the foundation for
developing testing knowledge and acquiring testing skills.
In the software domain, principles may also refer to rules or codes of conduct relating to professionals
who design, develop, test, and maintain software systems
Principle 1.
Testing is the process of exercising a software component using a selected set of test cases, with
the intent of (i) revealing defects (ii) evaluating quality.
Defects do occur, and they have a negative impact on software quality.Testers need to detect
these defects before the software becomes operational
Principle 2.
When the test objective is to detect defects, then a good test case is one that has a high
probability of revealing a yetundetected defect(s)
It requires the tester to consider the goal for each test case, which specific type of defect is to be
detected by the test case.the tester approaches testing in the same way a scientist approaches an
experiment
Principle 3.
A failure may be overlooked, and the test may be granted a “pass” status. The defect may be revealed at
some later stage of testing, but in that case it may be more costly and difficult to locate and repair The
outcome of a quality test results in unnecessary rework, or oversight of a critical problem
Principle 5. Test cases should be developed for both valid and invalid input conditions
Software users may have misunderstandings, or lack information about the nature of the inputs, often
make typographical errors. Use of test cases that are based on invalid inputs since they may exercise
the code in unexpected ways and identify unexpected software behavior
Principle 6. The probability of the existence of additional defects in a software component is proportional
to the number of defects already detected in that component
if there are two components A and B, and testers have found 20 defects in A and 3 defects in B, then the
probability of additional defects in A is higher than B
Principle 7. Testing should be carried out by a group that is independent of the development group.
It is difficult for a developer to admit that a software created and developed can be faulty. Developers
often have difficulty in locating the defects since their mental model of the code may overshadow as it
exists in actuality
Experiments in the testing domain to require recording of the exact conditions of the test.It is useful for
tests that need to be repeated after defect repair.
Test plans should be developed for each level of testing, and objectives for each level should be described
in the associated plan. The objectives should be stated as quantitatively as possible
Principle 10. Testing activities should be integrated into the software life cycle.
Test planning activities should be integrated into the software life cycle starting as early as in the
requirements analysis phase, and continue on throughout the software life cycle in parallel with
development activities
A tester needs to have knowledge from both experience and education as to how software is specified,
designed, and developed. A tester needs to have knowledge of where faults of a certain type might occur
a tester needs to have a good grasp of the problem domain of the software being tested
Developers, analysts, and marketing staff need to realize that testers add value to a software product in
that they detect defects and evaluate quality as early as possible in the software life cycle.
The tester’s job is to reveal defects, find weak points, inconsistent behaviour. It is difficult for developers
to effectively test their own code (spend lot of time in developing)
The goal of a tester is to work with the developers to produce high-quality software that meets the
customers’ requirements. Testers also need to work alongside with requirements engineers to ensure
that requirements are testable. Test managers will need to cooperate with project managers in order to
develop reasonable test plans
At TMM levels 1 or 2, you may find that there is no independent software test function in your
organization. At levels 3 and higher of the TMM the testers should always have managerial independence
from developers
When defects are detected during testing, software should be returned to the developers who locate the
defect and repair the code
Origins of Defects
The term defect and its relationship to the terms error and failure in the context of the software
development domain.
Origins of defects.
Defect Classes
Defects, are classified in to four major classes reflecting their point of origin in the software life cycle
The overall description of what the product does, and how it should behave (inputs/outputs), is incorrect,
ambiguous, and/or incomplete.
Feature Defects
Features refer to functional aspects. Feature defects are due to feature descriptions that are missing,
incorrect, incomplete, or superfluous.
Defects that occur in the description of how the target software is to interface with external software,
hardware, and users
Design Defects
Processing steps in the algorithm as described by the pseudo code are incorrect
Eg: e processing steps in the algorithm written in the pseudo code language may not be in the correct
order
Control defects occur when logic flow in the pseudo code is not correct
Eg: Logic defects usually relate to incorrect use of logic operators, such as less than (), greater than (), etc.
Data Defects
Incorrect design of data structures. a record may be lacking a field, an incorrect type is assigned to a
variable or a field in a record, an array may not have the proper number of elements assigned, or storage
space may be allocated incorrectly
These are defects derived from incorrect number of parameters, or an incorrect ordering of parameters.
Eg: the design may not properly describe the correct functionality of a module
These are derived from incorrect design descriptions for interfaces with components, external software
systems, databases, and hardware devices
Coding defects
code-related algorithmic and processing defects would now include unchecked overflow and underflow
conditions, comparing inappropriate data types, converting one data type to another, incorrect ordering
of arithmetic operators.
Typographical Defects
These are principally syntax errors. Eg: incorrect spelling of a variable name that are usually detected by a
compiler
Initialization Defects
Data-Flow Defects
Certain reasonable operational sequences that data should flow through. Eg: a variable should be
initialized, before it is used, It should not be initialized twice before there is an intermediate use.
Data Defects
These are indicated by incorrect implementation of data structures. Eg:the programmer may omit a field
in a record, an incorrect type or constants set incorrectly
interface defects in the code may be due to using incorrect or inconsistent parameter types, an incorrect
number of parameters, or improper ordering of the parameters
These defects arise from problems related to system calls, links to databases, input/output sequences,
memory usage, resource usage, interrupts and exception handling, data exchanges with hardware,
protocols, formats, interfaces with build files, and timing sequences (race conditions may result).
Testing Defects
Auxiliary code must be developed in order to test software at the unit and integration levels is called the
test harness
Test harnesses are subject to the same types of code and design defects that can be found in all other
types of software
These would encompass incorrect, incomplete, missing, inappropriate test cases, and test procedures.
These defects are again best detected in test plan reviews
Defect Examples
A simple program that calculates the total monetary value of a set of coins.
It does not state that the input, number_of_coins, and the output, number_of_dollars and number
_of_cents, should all have values of zero or greater.The values in number_of_coins, dollars and cents
cannot be negative in the real-world domain
Allowing the final program to accept negative values for the input number_of_coins for each of the
denominations, and consequently it may calculate an invalid value for the results.
Interface description defects
Interface description defects relate to the ambiguous and incomplete description of user–software
interaction. It is not clear from the specification how the user interacts with the program to provide input,
and how the output is to be reportedBecause of ambiguities in the user interaction description the
software may be difficult to use.
Design defects
The defect in this subclass arises from an incorrect “while” loop condition (should be less than or equal to
six)
These arise from the lack of error checks for incorrect and/or invalid inputs, lack of a path where users
can correct erroneous inputs, lack of a path for recovery from input errors
Data defects.
This defect relates to an incorrect value for one of the elements of the integer array, coin_values, which
should read 1, 5,10,25,50,100.
External interface description defects.
These are defects arising from the absence of input messages or prompts that introduce the program to
the user and request inputs. The user has no way of knowing in which order the number of coins for each
denomination must be input, and when to stop inputting values.
There is an absence of help messages, and feedback for user if he wishes to change an input or learn the
correct format and order for inputting the number of coins
Coding Defects
These include the loop variable increment step which is out of the scope of the loop. Note that incorrect
loop condition (i<6) is carried over from design and should be counted as a design defect.
The division operator may cause problems if negative values are divided, although this problem could be
eliminated with an input check.
The variable total_coin_value is not initialized. It is used before it is defined. (This might also be
considered a data defect.)
Data Defects:
The error in initializing the array coin_values is carried over from design and should be counted as a
design defect.
The call to the external function “scanf” is incorrect. The address of the variable must be provided
(&number_of_coins).
The documentation that accompanies this code is incomplete and ambiguous. It reflects the deficiencies
in the external interface description and other defects that occurred during specification and design
Even though it implements a simple function the program is unusable because of the nature of the
defects it contains. Such software is not acceptable to users.
he defect data is useful for test planning It helps you to select applicable testing techniques, design (and
reuse) the test cases you need, and allocate the amount of resources you will need to devote to detecting
and removing these defects
The defect repository, and support for TMM maturity goals.