Unit Iii STM
Unit Iii STM
STATIC TESTING
❖ Static testing is a complimentary technique to dynamic testing technique to acquire higher quality
software.
❖ Static testing techniques do not execute the software and they do not require the bulk of test
cases.
❖ This type of testing is also known as non-computer based testing or human testing.
❖ All the bugs cannot be caught alone by the dynamic testing technique; static testing reveals the
errors which are not shown by dynamic testing.
❖ Static testing can be applied for most of the verification activities. Since verification activities are
required at every stage of SDLC till coding, static testing also can be applied at all these phases.
❖ Requirements, design specifications, test plans, source code, user’s manuals,
maintenance procedures are some of the items that can be statically tested.
❖ Fagan reported that more than 60% of the errors in a program can be
detected using static testing.
❑ As defects are found and fixed, the quality of the product increases.
❑ The effectiveness of the dynamic test activity is increased and less time
needs to be devoted for testing the product.
Inspection process is an in-process manual examination of an item to detect bugs. It may be applied to
any product or partial product of the software development process, including requirements, design and
code, project management plan, SQA plan, software configuration plan (SCM plan), risk management
plan, test cases, user manual, etc. Inspections are embedded in the process of developing products and
are done in the early stages of each product’s development.
Software inspection does not execute the code, so it is machine-independent, requires no target system
resources or changes to the program’s operational behavior, and can be used much before the target
hardware is available for dynamic testing purposes.
The inspection process is carried out by a group of peers. The group of peers first inspect the product at the
individual level. After this, they discuss the potential defects of the product observed in a formal meeting.
The second important thing about the inspection process is that it is a formal process of verifying a software
product. The documents which can be inspected are SRS, SDD, code, and test plan.
An inspection process involves the interaction of the following elements:
❑ Inspection steps
❑ Role for participants
❑ Item being inspected
The entry and exit criteria are used to determine whether an item is ready to be inspected.
Entry criteria mean that the item to be inspected is mature enough to be used. For
example, for code inspection, the entry criterion is that the code has been compiled
successfully.
Exit criterion is that once the item has been given for inspection, it should not be updated,
otherwise it will not know how many bugs have been reported and corrected through the
inspection process and the whole purpose of the inspection is lost.
INSPECTION TEAM
❖ For the inspection process, a minimum of the following four team members are
required.
❖ Author/Owner/Producer A programmer or designer responsible for producing the
program or document. He is also responsible for fixing defects discovered during the
inspection process.
❖ Inspector A peer member of the team, i.e. he is not a manager or supervisor. He is not
directly related to the product under inspection and may be concerned with some
other product. He finds errors, omissions, and inconsistencies in programs and
documents.
❖ Moderator A team member who manages the whole inspection process. He schedules,
leads, and controls the inspection session. He is the key person with the responsibility of
planning and successful execution of the inspection.
❖ Recorder One who records all the results of the inspection meeting.
INSPECTION PROCESS
➢ A moderator is assigned.
Inspection meeting The inspection meeting starts with the author of the inspected item who has created it.
The author first discusses every issue raised by different members in the compiled log fi le. After the discussion,
all the members arrive at a consensus whether the issues pointed out are in fact errors and if they are errors,
should they be admitted by the author. It may be possible that during the discussion on any issue, another error
is found. Then, this new error is also discussed and recorded as an error by the author.
The basic goal of the inspection meeting is to uncover any bug in the item. However, no effort is made in the
meeting to fi x the bug. It means that bugs are only being notified to the author, which he will fi x later. If there is
any clarification regarding these bugs, then it should be asked or discussed with other members during the
meeting.
At the end, the moderator concludes the meeting and produces a summary of the
inspection meeting. This summary is basically a list of errors found in the item that need to be
resolved by the author
Rework The summary list of the bugs that arise during the inspection meeting needs to be
reworked by the author. The author fixes all these bugs and reports back to the moderator.
Follow-up It is the responsibility of the moderator to check that all the bugs found in the last
meeting have been addressed and fixed. He prepares a report and ascertains that all issues
have been resolved. The document is then approved for release. If this is not the case, then
the unresolved issues are mentioned in a report and another inspection meeting is called by
the moderator.
BENEFITS OF INSPECTION PROCESS
Bug reduction The number of bugs is reduced through the inspection process. L.H. Fenton [86] reported that
through the inspection process in IBM, the number of bugs per thousand lines of code has been reduced by
two-thirds. Thus, inspection helps reduce bug injection and detection rates. According to Capers Jones,
‘Inspection is by far the most effective way to remove bugs.’
Bug prevention Inspections can also be used for bug prevention. Based on the experiences of previous
inspections, analysis can be made for future inspections or projects, thereby preventing the bugs which
have appeared earlier. Programmers must understand why bugs appear and what can be done to avoid
them in future. At the same time, they should provide inspection results to the quality assurance team.
Productivity Since all phases of SDLC may be inspected without waiting for code development and its
execution, the cost of finding bugs decreases, resulting in an increase in productivity. Moreover, the errors
are found at their exact places, therefore reducing the need of dynamic testing and debugging. In the
article by Fagan [43], an increase of 23% in coding productivity and a 25% reduction in schedules were
reported.
Real-time feedback to software engineers
The inspections also benefit software engineers/developers because they get feedback on their products on
a relatively real-time basis. Developers find out the type of mistakes they make and what is the error density.
Since they get this feedback in the early stages of development, they may improve their capability. Thus,
inspections benefit software engineers/ developers in the sense that they can recognize their weakness and
improve accordingly, which in turn benefits the cost of the project.
Reduction in development resource The cost of rework is surprisingly high if inspections are not used and errors
are found during development or testing. Therefore, techniques should be adopted such that errors are
found and fixed as close to their place of origin as possible. Inspections reduce the effort required for
dynamic testing and any rework during design and code, thereby causing an overall net reduction in the
development resource. Without inspections, more resources may be required during design and dynamic
testing. But, with inspection, the resource requirement is greatly reduced.
Quality improvement We know that the direct consequence of testing is improvement in the quality of
software. The direct consequence of static testing also results in the improvement of quality of the final
product. Inspections help to improve the quality by checking the standard compliance, modularity, clarity,
and simplicity
Project management A project needs monitoring and control. It depends on some data obtained
from the development team. However, this data cannot be relied on forever. Inspection is another
effective tool for monitoring the progress of the project.
Checking coupling and cohesion The modules’ coupling and cohesion can be checked easily through
inspection as compared to dynamic testing. This also reduces the maintenance work.
Learning through inspection Inspection also improves the capability of different team members, as they
learn from the discussions on various types of bugs and the reasons why they occur. It may be more
beneficial for new members. They can learn about the project in a very short time. This helps them in the
later stages of development and testing.
Process improvement There is always scope of learning from the results of one process. An analysis of
why the errors occurred or the frequent places where the errors occurred can be done by the
inspection team members. The analysis results can then be used to improve the inspection process so
that the current as well as future projects can benefit. Discussed below are the issues of process
improvement.
EFFECTIVENESS OF INSPECTION PROCESS
In an analysis done by Oliver Lautenberg, the inspection process was found to be effective as
compared to structural testing because the inspection process alone found 52% errors. Of the remaining
48% of defects, on an average, only 17% are detected by structural testing.
The effectiveness of the inspection process lies in its rate of inspection. The rate of inspection refers to
how much evaluation of an item has been done by the team. If the rate is very fast, it means the
coverage of item to be evaluated is high. Similarly if the rate is too slow, it means that the coverage is
not much. However, the rate should also be considered in the perspective of detection of errors. If the
rate is too fast, then it may be possible that it reveals only few errors. If the rate is too slow, then the cost
of project increases. Thus, a balanced rate of inspection should be followed so that it concentrates on a
reasonable number of defects. It may be calculated as the error detection efficiency of the inspection
process, as given below:
The rate of inspection also depends on some factors like the experience of the
inspection team, the programming language, and the application domain.
COST OF INSPECTION PROCESS
With at least four members involved in an inspection team, the cost of inspecting 100
lines of code is roughly equivalent to one person-day of effort. This assumes that the
inspection itself takes about an hour and that each member spends 1-2 hours preparing
for the inspection. Testing costs are variable and depend on the number of faults in the
software. However, the effort required for the program inspection is less than half the
effort that would be required for equivalent dynamic testing. Further, it has been
estimated that the cost of inspection can be 5–10% of the total cost of the project.
VARIANTS OF INSPECTION PROCESS
Active Design Reviews
Active Design Reviews [87] are for inspecting the design stage of SDLC. In this
process, several reviews are conducted targeting a particular type of bugs and
conducted by the reviewers who are experts in that area. Thus, it covers all the
sections of the design document based on several small reviews instead of only one
inspection. It is also based on the use of questionnaires to give the reviewers better-
defined responsibilities and to make them play a more active role.
The technique has been used in the Naval Research Laboratory’s (Washington)
software cost reduction (SCR) project for several years with good results. The SCR
project involves the experimental redevelopment of the operational flight program
(OFP) for the Navy’s A-7E aircraft.
These are conducted in the following stages
Overview A brief overview of the module being reviewed is presented. The overview
explains the modular structure in case it is unfamiliar to reviewers, and shows them where
the module belongs in the structure.
Meeting The designers read the completed questionnaires and meet the reviewers to
resolve any queries that the designers may have about the reviewer’s answers to the
questionnaires. The reviewers may be asked to defend their answers. This interaction
continues until both designers and reviewers understand the issues, although an
agreement on these issues may not be reached. After the review, the designers produce a
new version of the documentation.
Formal Technical Asynchronous Review Method ( FTArm)
Consolidation In this step, the moderator analyses the result of private and public reviews
and lists the findings and unresolved issues, if any.
Group meeting If required, any unresolved issues are discussed in this step. But the
decision to conduct a group meeting is taken in the previous step only by the moderator.
Conclusion The final report of the inspection process along with the analysis is produced
by the moderator
Gilb Inspection
Gilb and Graham [89] defined this process. It differs from Fagan
inspection in that the defect detection is carried out by individual
inspectors at their own level rather than in a group. Therefore, a
checking phase has been introduced. Three different roles are
defined in this type of inspection:
Planning The leader determines the inspection participants and schedules the
meeting.
Kick-off The relevant documents are distributed, participants are assigned roles
and brief
Edit After all the defects have been reported, the author takes the list and works
accordingly.
Follow-up The leader ensures that the edit phase has been executed properly.
Exit The inspection must pass the exit criteria as fi xed for the completion of the inspection
process.
Humphrey’s Inspection Process
It is based on the idea that the effectiveness of the inspection process can be increased by
replicating it [91]. If we increase the number of teams inspecting the item, the percentage
of defects found may increase. But sometimes the cost of organizing multiple teams is higher
as compared to the number of defects found. A proper evaluation of the situation is
required. Originally, this process was used for inspecting requirement specifications, but it
can also be used for any phase. As discussed, this process consists of many independent
inspection teams. This process needs a coordinator who coordinates various teams, collects
and collates the inspection data received by them. For this purpose, he also meets the
moderator of every inspection team.
Planning and overview This is the formal planning and overview stage.
In addition, it also includes the planning of how many teams will participate in the
inspection process.
Inspection stages There are many inspection processes adopted by many teams. It
is not necessary that every team will choose the same inspection process. The team
is free to adopt any process.
Collation phase The results from each inspection process are gathered, collated,
and a master list of all detected defects is prepared.
Rework and follow-up This step is same as the tradition Fagan inspection process.
Phased Inspection
Phased inspections [92] are designed to verify the product in a particular domain. If
we feel that in a particular area, we may encounter errors, then phased inspections
are carried out. But for this purpose, only experts who have experience in that
particular domain are called. Thus, this inspection process provides a chance to utilize
human resources. In this process, inspection is divided into more than one phase. There
is an ordered set of phases and each phase is designed such that it will check a
particular feature in the product. The next phase in the ordered set of phases assumes
that the particular feature has been verified in the previous phase. There are two types
of phases, as discussed below.
Single inspector In this phase, a rigorous checklist is used by a single inspector to
verify whether the features specified are there in the item to be inspected.
Multiple inspector Here, a checklist cannot be used. It means that the item cannot be
verified just with the questions mentioned in the checklist. There are many inspectors
who are distributed the required documents for verification of an item. Each inspector
examines this information and develops a list of questions of their own based on a
particular feature. These questions are not in binary form as in single inspection. The
item is then inspected individually by all the inspectors based on a self-developed
checklist which is either application or domain specific. After individual checking by
the inspectors, a reconciliation meeting is organized where inspectors compare their
findings about the item.
READING TECHNIQUES
Ad hoc method In this method, there is no direction or guidelines provided for inspection.
However, ad hoc does not mean that inspection participants do not scrutinize the
inspected product systematically. The word ad hoc only refers to the fact that no technical
support on how to detect defects in a software artifact is given to them. In this case, defect
detection fully depends on the skills, knowledge, and experience of an inspector.
Checklists A checklist is a list of items that focus the inspector’s attention on specific topics, such as
common defects or organizational rules, while reviewing a software document [43]. The purpose of
checklists is to gather expertise concerning the most common defects and thereby supporting
inspections. The checklists are in the form of questions which are very general and are used by the
inspection team members to verify the item. However, checklists have some drawbacks too:
The questions, being general in nature, are not sufficiently tailored to take into account a
particular development environment.
There is a probability that some defects are not taken care of. It happens in the case of those
type of defects which have not been previously detected.
Scenario-based reading Checklists are general in nature and do not cover different types
of bugs. Scenario-based reading [93] is another reading technique which stresses on
finding different kind of defects. It is based on scenarios, wherein inspectors are provided
with more specific instructions than typical checklists. Additionally, they are provided with
different scenarios, focusing on different kind of defects.
The following methods have been developed based on the criteria given by scenario-
based reading.
Perspective-based reading The idea behind this method is that a software item should be inspected
from the perspective of different stakeholders [95,104,105]. Inspectors of an inspection team have to
check the software quality as well as the software quality factors of a software artifact from different
perspectives. The perspectives mainly depend upon the roles people have within the software
development or maintenance process. For each perspective, either one or multiple scenarios are
defined, consisting of repeatable activities an inspector has to perform, and the questions an
inspector has to answer. For example, a testing expert first creates a test plan based on the
requirements specification and then attempts to find defects from it. This is designed specifically for
requirements inspection, and inspectors who participate in inspection should have expertise in
inspecting requirements of their own area of expertise. Later, perspective-based reading has been
applied to code inspections and design inspections
Usage-based reading This method proposed by Thelin is applied in design inspections. Design
documentation is inspected based on use cases, which are documented in requirements
specification. Since use-cases are the basis of inspection, the focus is on finding functional
defects, which are relevant from the users’ point of view.
Abstraction driven reading This method given by Dunsmore is designed for code inspections. In
this method, an inspector reads a sequence of statements in the code and abstracts the
functions these statements compute. An inspector repeats this procedure until the final function of
the inspected code artifact has been abstracted and can be compared to the specification.
Thus, the inspector creates an abstraction level specification based on the code under inspection
to ensure that the inspector has really understood the code.
Task-driven reading This method is also valid for code inspections proposed by Kelly & Shepard
[102]. In this method, the inspector has to create a data dictionary, a complete description of
the logic and a cross-reference between the code and the specifications.
Function-point based scenarios This is based on scenarios for defect detection in requirements
documents [103]. This approach is based on function-point analysis ( FPA). FPA defines a
software system in terms of its inputs, fi les, inquiries, and outputs. The scenarios designed
around function-points are known as function-point scenarios. It consists of questions and
directs the focus of an inspector to a specific function-point item within the inspected
requirements document
CHECKLISTS FOR INSPECTION PROCESS
The inspection team must have a checklist against which they detect errors. The
checklist is according to the item to be inspected. For example, the design document
and the code of the module should have different checklists. Checklists can be
prepared with the points mentioned in the verification of each phase. Checklists should
be prepared in consultation with experienced staff and regularly updated as more
experience is gained by the inspection process.
The checklist may vary according to the environment and needs of the organization.
Each organization should prepare its own checklists for every item
STRUCTURED WALKTHROUGHS
A technical review is intended to evaluate the software in the light of development standards, guidelines, and
specifications and to provide the management with evidence that the development process is being carried
out according to the stated objectives. A review is similar to an inspection or walkthrough, except that the
review team also includes management. Therefore, it is considered a higher-level technique as compared to
inspection or walkthrough.
The moderator may also prepare a checklist to help the team focus on the key points. The result of the review
should be a document recording the events of the meeting, deficiencies identified, and review team
recommendations. Appropriate actions should then be taken to correct any deficiencies and address all
recommendations.
VALIDATION ACTIVITIES
By validation, we mean that the module that has been prepared till now is in conformance
with the requirements which were set initially in the SRS or user manual.
Every validation testing focuses on a particular SDLC phase and thereby focuses on a
particular class of errors. We can see a one-to-one correspondence between development
and testing processes.
For example, the purpose of unit validation testing is to find discrepancies between the
developed module’s functionality and its requirements and interfaces specified in the SRS.
Software validation is achieved through a series of black-box tests that demonstrate
conformity with requirements
UNIT VALIDATION TESTING
Since unit is the smallest building block of the software system, it is the first piece of
system to be validated. Before we validate the entire software, units or modules must be
validated.
Units must also be validated to ensure that every unit of software has been built in the
right manner in conformance with user requirements. Unit tests ensure that the software
meets at least a baseline level of functionality prior to integration and system testing.
A module is not independent and cannot be tested in isolation. While testing the
module, all its interfaces must be simulated if the interfaced modules are not ready at
the time of testing the module under consideration. Discussed below are the types of
interface modules which must be simulated, if required, to test a module.
Drivers
Suppose a module is to be tested, wherein some inputs are to be received from another
module. However, this module which passes inputs to the module to be tested is not ready
and under development. In such a situation, we need to simulate the inputs required in the
module to be tested.
A driver can be defined as a software module which is used to invoke a module under
test and provide test inputs, control and monitor execution, and report test results or most
simplistically a line of code that calls a method and passes a value to that method.
A test driver may take inputs in the following form and call the unit to be tested:
The module under testing may also call some other module which is not ready at the time
of testing. Therefore, these modules need to be simulated for testing. In most cases,
dummy modules instead of actual modules, which are not ready, are prepared for these
subordinate modules. These dummy modules are called stubs.
Thus, a stub can be defined as a piece of software that works similar to a unit which is
referenced by the unit being tested, but it is much simpler than the actual unit. A stub
works as a ‘stand-in’ for the subordinate unit and provides the minimum required behavior
for that unit.
Stubs have the following characteristics:
➢ Stub is a place holder for the actual module to be called. Therefore, it is not designed with
the functionalities performed by the actual module. It is a reduced implementation of the
actual module.
➢ It does not perform any action of its own and returns to the calling unit
➢ We may include a display instruction as a trace message in the body of stub. The idea is that
the module to be called is working fi ne by accepting the input parameters.
➢ A constant or null must be returned from the body of stub to the calling module.
➢ Stubs allow the programmer to call a method in the code being developed, even if
the method does not have the desired behavior yet.
➢ By using stubs and drivers effectively, we can cut down our total debugging and
testing time by testing small parts of a program individually, helping us to narrow down
problems before they expand.
➢ Stubs and drivers can also be an effective tool for demonstrating progress in a business
environment.
Example
Program
main() (a) Driver for main() module: Stub for caldiff() Module
{ main() caldiff(int x, int y, int z)
Int a,b,c,sum,diff,mul; { {
scanf(“%d %d %d”, &a, &b, &c); printf(“Difference calculating module”);
int a, b, c, sum;
sum = calsum(a,b,c); return 0;
scanf(“%d %d %d”, &a, &b, &c);
diff = caldiff(a,b,c); }
mul = calmul(a,b,c); sum = calsum(a,b,c);
Stub for calmul() Module
printf(“%d %d %d”, sum, diff, mul); printf(“The output from calsum
calmul(int x, int y, int z)
} module is %d”, sum);
{
calsum(int x, int y, int z) }
printf(“Multiplication calculation
{
module”);
int d;
d = x + y + z; return 0;
return(d); }
}
Integration Testing
Integration is the activity of combining the modules together when all the modules have been
prepared. Integration of modules is according to the design of software specified earlier.
Integration aims at constructing a working software system. Integration testing focuses on
bugs caused by interfacing between the modules while integrating them.
Modules are not standalone entities. They are a part of a software system which comprises of
many interfaces. Even if a single interface is mismatched, many modules may be affected.
Thus, integration testing is necessary for the following reasons:
1. Integration testing exposes inconsistency between the modules such as improper call or
return sequences.
2. Data can be lost across an interface.
3. One module when combined with another module may not give the desired result.
4. Data types and their valid ranges may mismatch between the modules.
There are three approaches for integration testing
Decomposition-Based Integration
The idea for this type of integration is based on the decomposition of design into functional
components or modules. In the tree designed for decomposition-based integration, the nodes
represent the modules present in the system and the links/edges between the two modules
represent the calling sequence. The nodes on the last level in the tree are leaf nodes.
Integration testing methods are classified into two categories:
(a) non-incremental and
(b) incremental.
Non-Incremental Integration Testing
In this type of testing, either all untested modules are combined together and then tested or unit tested
modules are combined together. It is also known as Big-Bang integration testing.
Big-Bang method cannot be adopted practically. This theory has been discarded due to the following
reasons:
1. Big-Bang requires more work. For example, consider the following hierarchy of a software system.
According to the Big-Bang theory, if all unit tested modules are integrated in this example, then for unit
testing of all the modules independently, we require four drivers and seven stubs. This count will grow
according to the size of the system.
2. Actual modules are not interfaced directly until the end of the software system.
3. It will be difficult to localize the errors since the exact location of bugs
cannot be found easily.
Incremental Integration Testing
In this type, you start with one module and unit test it. Then combine the module which has to
be merged with it and perform test on both the modules. In this way, incrementally keep on
adding the modules and test the recent environment. Thus, an integrated tested software
system is achieved. Incremental integration testing is beneficial for the following reasons:
1. Incremental approach does not require many drivers and stubs.
2. Interfacing errors are uncovered earlier.
3. It is easy to localize the errors since modules are combined one by one. The first suspect is the
recently added module. Thus, debugging becomes easy.
4. Incremental testing is a more thorough testing. Consider the example in Fig. 7.8. If we are
testing module 6, then although module 1 and 2 have been tested previously, they will get
the chance to be tested again and again. This gives the modules more exposure to the
probable bugs by the time the last module in the system is tested.
Types of Incremental Integration Testing
Incremental integration can be done either from top to bottom or bottom to top. Based
on this strategy, incremental integration testing is divided into two categories.
Top-down Integration Testing The strategy in top-down integration is to look at the design hierarchy
from top to bottom. Start with the high-level modules and move downward through the design
hierarchy. Modules subordinate to the top module are integrated in the following two ways:
Depth first integration In this type, all modules on a major control path of the design hierarchy are
integrated first. In the example shown in Fig. 7.8, modules 1, 2, 6, 7/8 will be integrated first. Next,
modules 1, 3, 4/5 will be integrated.
Breadth first integration In this type, all modules directly subordinate at each level, moving across
the design hierarchy horizontally, are integrated first. In the example shown in Fig. 7.8, modules 2
and 3 will be integrated first. Next, modules 6, 4, and 5 will be integrated. Modules 7 and 8 will be
integrated last.
Top-Down Integration Procedure
The procedure for top-down integration process is discussed in the following steps:
1. Start with the top or initial module in the software. Substitute the stubs for all the subordinate
modules of top module. Test the top module.
2. After testing the top module, stubs are replaced one at a time with the actual modules for
integration.
3. Perform testing on this recent integrated environment. 4. Regression testing may be
conducted to ensure that new errors have not appeared.
5. Repeat steps 2–4 for the whole design hierarchy.
The bottom-up strategy begins with the terminal or modules at the lowest level in the software structure. After
testing these modules, they are integrated and tested moving from bottom to top level. Since the processing
required for modules subordinate to a given level is always available, stubs are not required in this strategy.
Bottom-up integration can be considered as the opposite of top-down approach. Unlike top-down strategy, this
strategy does not require the architectural design of the system to be complete. Thus, bottom-up integration
can be performed at an early stage in the developmental process. It may be used where the system reuses and
modifies components from other systems.
The steps in bottom-up integration are as follows:
1. Start with the lowest level modules in the design hierarchy. These are the modules from which no other
module is being called.
2. Look for the super-ordinate module which calls the module selected in step 1. Design the driver module for
this super-ordinate module.
3. Test the module selected in step 1 with the driver designed in step 2.
4. The next module to be tested is any module whose subordinate modules (the modules it calls) have all been
tested.
5. Repeat steps 2 to 5 and move up in the design hierarchy.
6. Whenever, the actual modules are available, replace stubs and drivers with the actual one and test again
This type of integration is useful for integrating object-oriented systems, real-time systems, and
systems with strict performance requirements. Bottom-up integration has the disadvantage
that the software as a whole does not exist until the last module is added.
Comparison between Top-Down and Bottom-Up Integration Testing
Sandwich Integration testing
There are situations depending on the project in hand which will force to integrate the
modules by combining top-down and bottom-up techniques. This combined approach
is sometimes known as sandwich integration testing.
It is assumed that integration testing detects bugs which are structural. However, it is
also important to detect some behavioral bugs. If we can refi ne the functional
decomposition tree into a form of module calling graph, then we are moving towards
behavioral testing at the integration level. This can be done with the help of a call
graph, as given by Jorgensen.
A call graph is a directed graph, wherein the nodes are either modules or units, and a
directed edge from one node to another means one module has called another
module. The call graph can be captured in a matrix form which is known as the
adjacency matrix.
The idea behind using a call graph for integration testing is to avoid the efforts made in
developing the stubs and drivers. If we know the calling sequence, and if we wait for the called or calling
function, if not ready, then call graph-based integration can be used.
There are two types of integration testing based on call graph which are discussed next.
Pair-wise Integration If we consider only one pair of calling and called modules, then we can make a set of
pairs for all such modules, as shown in Fig. 7.11, for pairs 1–10 and 1–11. The resulting set will be the total test
sessions which will be equal to the sum of all edges in the call graph. For example, in the call graph shown in
Fig. 7.11, the number of test sessions is 19 which is equal to the number of edges in the call graph.
Neighbourhood Integration
There is not much reduction in the total number of test sessions in pair-wise integration as compared to
decomposition-based integration. If we consider the neighborhoods of a node in the call graph, then the number
of test sessions may reduce. The neighborhood for a node is the immediate predecessor as well as the immediate
successor nodes. The neighborhood of a node, thus, can be defined as the set of nodes that are one edge away
from the given node.
In path execution, there may be a call to another unit. At that point, the control is transferred
from the calling unit to the called unit. This passing of control from one unit to another unit is
necessary for integration testing. Also, there should be information within the module
regarding instructions that call the module or return to the module. This must be tested at the
time of integration. It can be done with the help of path-based integration defined by Paul C.
Jorgenson.
We need to understand the following definitions for path-based integration.
Source node It is an instruction in the module at which the execution starts or resumes. The nodes
where the control is being transferred after calling the module are also source nodes.
Sink node It is an instruction in a module at which the execution terminates. The nodes from which the control
is transferred are also sink nodes.
Module execution path ( MEP) It is a path consisting of a set of executable statements within a module like in a
flow graph.
Message When the control from one unit is transferred to another unit, then the programming language
mechanism used to do this is known as a message. For example, when there is a function call, then it is a
message from one unit (where the call is mentioned; caller module) to another unit (the unit which is being
called).
MM-path It is a path consisting of MEPs and messages. The path shows the sequence of executable
statements; it also crosses the boundary of a unit when a message is followed to call another unit. In other
words, MM-path is a set of MEPs and transfer of control among different units in the form of messages.
MM-path graph It can be defined as an extended flow graph where nodes are MEPs and edges are
messages. It returns from the last called unit to the first unit where the call was made. In this graph, messages
are highlighted with thick lines.
Now let us see the concept of path-based integration with the help of one example.
Fig shows the MM-path as a darken line.
FUNCTION TESTING
Test case execution As in all phases of testing, an appropriate set of test cases need to be executed
and the results of those test cases recorded. Which test cases are to be executed should be defined
within the context of the test plan and the current state of the application being tested.
SYSTEM TESTING
When all the modules have been integrated with the software system, then the software is
incorporated with other system elements (e.g. hardware, people, information).
System testing is the process of attempting to demonstrate that a program or system does not
meet its original requirements and objectives, as stated in the requirement specification. The
central purpose of system testing is to compare the system with its stated objectives.
System testing is actually a series of different tests to test the whole system on various grounds
where bugs have the probability to occur. The ground can be performance, security, maximum
load, etc. The integrated system is passed through various tests based on these grounds and
depending on the environment and type of project. After passing through these tests, the
resulting system is a system which is ready for acceptance testing which involves the user.
But it is difficult to test the system on various grounds, since there is no methodology for system
testing. One solution to this problem is to think from the perspective of the user and the problem
the user is trying to solve.
This dilemma is solved by using the program’s user documentation. Design the system test by
analysing the objectives; formulate test cases by analysing the user documentation. This has a
useful side-effect of comparing the program with its objectives and the user documentation, as
well as comparing the user documentation with the objectives
Recovery Testing Recovery is just like the exception handling feature of a programming language. It is
the ability of a system to restart operations after the integrity of the application has been lost. It reverts to
a point where the system was functioning correctly and then, reprocesses the transactions to the point of
failure.
Some software systems (e.g. operating system, database management systems, etc.) must recover from
programming errors, hardware failures, data errors, or any disaster in the system. So the purpose of this
type of system testing is to show that these recovery functions do not work correctly.
The main purpose of this test is to determine how good the developed software is when it faces a
disaster. Disaster can be anything from unplugging the system which is running the software from power,
network etc., also stopping the database, or crashing the developed software itself.
Some examples of recovery testing are given below:
➢ While the application is running, suddenly restart the computer and thereafter, check the validity
of application’s data integrity.
➢ While the application receives data from the network, unplug the cable and plug-in after awhile, and analyse
the application’s ability to continue receiving data from that point, when the network connection
disappeared.
➢ Restart the system while the browser has a definite number of sessions and after rebooting, check that it is able
to recover all of them.
Beizer proposes that testers should work on the following areas during recovery testing:
Restart If there is a failure and we want to recover and start again, then fi rst the current system state and
transaction states are discarded. Following the criteria of checkpoints as discussed above, the most recent
checkpoint record is retrieved and the system is initialized to the states in the checkpoint record. Thus, by using
checkpoints, a system can be recovered and started again from a new state. Testers must ensure that all
transactions have been reconstructed correctly and that all devices are in proper states. The system now is in a
position to begin to process new transactions.
Switchover Recovery can also be done if there are standby components and in case of failure of one
component, the standby takes over the control. The ability of the system to switch to a new component must be
tested.
Security Testing
Security is a protection system that is needed to assure the customers that their data will be protected. For example, if Internet users feel
that their personal data/information is not secure, the system loses its accountability. Security may include controlling access to data,
encrypting data in communication, ensuring secrecy of stored data, auditing security events, etc. The effects of security breaches could
be extensive and can cause loss of information, corruption of information, misinformation, privacy violations, denial of service, etc.
❑ Security requirements should be associated with each functional requirement. Each functional requirement, most likely, has a specifi c
set of related security issues to be addressed in the software implementation. For example, the log-on requirement in a client-server
system must specify the number of retries allowed, the action to be taken if the log-on fails, and so on
❑ A software project has security issues that are global in nature, and are therefore, related to the application’s architecture and
overall implementation. For example, a Web application may have a global requirement that all private customer data of any kind is
stored in encrypted form in the database.
Security vulnerabilities Vulnerability is an error that an attacker can exploit.
Security vulnerabilities are of the following types:
❖ Bugs at the implementation level, such as local implementation errors or inter-procedural interface errors
❖ Design-level mistakes. Design-level vulnerabilities are the hardest defect category to handle, but they are
also the most prevalent and critical. Examples of design-level security flaws include problem in error-
handling, unprotected data channels, incorrect or missing access control mechanisms, and timing errors
especially in multithreaded systems.
How to perform security testing Testers must use a risk-based approach, grounded in both the system’s
architectural reality and the attacker’s mindset, to gauge software security adequately. By identifying risks and
potential loss associated with those risks in the system and creating tests driven by those risks, the tester can
properly focus on areas of code in which an attack is likely to succeed.
Risk management and security testing Software security practitioners perform many different tasks to manage
software security risks, including:
1. Creating security abuse/misuse cases
2. Listing normative security requirements
3. Performing architectural risk analysis
4. Building risk-based security test plans
5. Wielding static analysis tools
6. Performing security tests
Thus, security testing must necessarily involve two diverse approaches:
▪ Testing security mechanisms to ensure that their functionality is properly implemented
▪ Performing risk-based security testing motivated by understanding and simulating the
attacker’s approach
Elements of security testing The basic security concepts that need to be covered by security
testing are discussed below:
Confidentiality A security measure which protects against the disclosure of information to parties
other than the intended recipient. Integrity A measure intended to allow the receiver to
determine that the information which it receives has not been altered in transit or by anyone
other than the originator of the information.
Integrity schemes often use some of the same underlying technologies as confidentiality
schemes, but they usually involve adding additional information to a communication to form
the basis of an algorithmic check rather than encoding all the communication.
Authentication A measure designed to establish the validity of a transmission, message, or
originator. It allows the receiver to have confidence that the information it receives originates
from a specific known source.
Authorization It is the process of determining that a requester is allowed to receive a service or
perform an operation. Access control is an example of authorization. Availability It assures that
the information and communication services will be ready for use when expected. Information
must be kept available for authorized persons when they need it.
Non-repudiation A measure intended to prevent the later denial that an action happened, or
a communication took place, etc. In communication terms, this often involves the interchange
of authentication information combined with some form of provable timestamp.
Performance Testing
Load testing is a type of non-functional testing. A load test is type of software testing which
is conducted to understand the behavior of the application under a specific expected
load. When a system is tested with a load that causes it to allocate its resources in
maximum amounts, it is called load testing. The idea is to create an environment more
demanding than the application would experience under normal workloads. Load testing
checks how a system performs when many users are using it at the same time. To make
sure the system can handle busy times without slowing down or crashing.
Load Testing Process:
1. 1. E-commerce Website: Simulate hundreds of users browsing, adding items to carts, and
checking out simultaneously.
2. Social Media Platform: Test thousands of users posting updates, sharing content, and
interacting with each other concurrently.
3. Online Banking System: Simulate numerous users logging in, checking balances,
transferring funds, and paying bills concurrently.
Stress Testing
Stress testing is also a type of load testing, but the difference is that the system is put under loads
beyond the limits so that the system breaks. Thus, stress testing tries to break the system under test
by overwhelming its resources in order to find the circumstances under which it will crash. The areas
that may be stressed in a system are:
➢ Input transactions
➢ Disk space
➢ Output
➢ Communications
Usability testing identifies discrepancies between the user interfaces of a product and the
human engineering requirements of its potential users. This type of system testing is related
to a system’s presentation rather than its functionality. System testing can be performed
to find human-factors or usability problems on the system. The idea is to adapt the
software to users’ actual work styles rather than forcing the users to adapt according to
the software. Thus, the goal of usability testing is to verify that intended users of the system
are able to interact properly with the system while having a positive and convenient
experience.
What the user wants or expects from the system can be determined using several
ways like:
Area experts The usability problems or expectations can be best understood by the subject or
area experts who have worked for years in the same area. They analyse the system’s specific
requirements from the user’s perspective and provide valuable suggestions.
Group meetings Group meeting is an interesting idea to elicit usability requirements from the
user. These meetings result in potential customers’ comments on what they would like to see in
an interface.
Survey Surveys are another medium to interact with the user. It can also yield valuable
information about how potential customers would use a software product to accomplish their
tasks.
Analyse similar products We can also analyse the experiences in similar kinds of projects done
previously and use it in the current project. This study will also give us clues regarding usability
requirements.
Usability characteristics against which testing is conducted are discussed below:
Ease of use The users enter, navigate, and exit with relative ease. Each user interface
must be tailored to the intelligence, educational background, and environmental pressures of the
end-user.
Interface steps User interface steps should not be misleading. The steps should also not be very
complex to understand either.
Response time The time taken in responding to the user should not be so high that the user is
frustrated or will move to some other option in the interface.
Help system A good user interface provides help to the user at every step. The help
documentation should not be redundant; it should be very precise and easily understood by
every user of the system.
Error messages For every exception in the system, there must be an error message in text form so
that users can understand what has happened in the system. Error messages should be clear and
meaningful.
Compatibility/Conversion/Configuration Testing:
Developers/testers must keep in mind that the software is being built to satisfy the user requirements
and no matter how elegant its design is, it will not be accepted by the users unless it helps them
achieve their goals as specified in the requirements. The purpose of acceptance testing is to give the
end-user a chance to provide the development team with feedback as to whether or not the software
meets their needs. Ultimately, it’s the user that needs to be satisfied with the application, not the
testers, managers, or contract writers.
Thus, acceptance testing is the formal testing conducted to determine whether a software
system satisfies its acceptance criteria and to enable buyers to determine whether to accept the
system or not. It determines whether the developed system meets the predetermined functionality,
performance, quality, and interface criteria acceptable to the user. User acceptance testing, on the
other hand, should be carried out by end-users.
Thus, acceptance testing is designed to:
1. Determine whether the software is fit for the user.
2. Making users confident about the product.
3. Determine whether a software system satisfies its acceptance criteria.
4. Enable the buyer to determine whether to accept the system or not.
Entry Criteria
❑ System testing is complete and defects identified are either fixed or documented.
❑ Acceptance plan is prepared and resources have been identified.
❑ Test environment for the acceptance testing is available.
Exit Criteria
❑ Acceptance decision is made for the software.
❑ In case of any warning, the development team is notified.
Types of Acceptance Testing:
Acceptance testing is classified into the following two categories:
1. Alpha Testing
2. Beta Testing
ALPHA TESTING
Alpha is the test period during which the product is complete and usable in a test environment,
but not necessarily bug-free. It is the final chance to get verification from the customers that the
tradeoffs made in the final development stage are coherent.
(i) to give confidence that the software is in a suitable state to be seen by the customers.
(ii) to find bugs that may only be found under operational conditions. Any other major defects or
performance issues should be discovered in this stage. Since alpha testing is performed at the
development site, testers and users together perform this testing. Therefore, the testing is in a
controlled manner such that if any problem comes up, it can be managed by the testing
team.
Entry Criteria to Alpha:
▪ All features are complete/testable (no urgent bugs).
▪ High bugs on primary platforms are fixed/verified.
▪ 50% of medium bugs on primary platforms are fixed/verified.
▪ All features have been tested on primary platforms.
▪ Performance has been measured/compared with previous releases (user
functions).
▪ Usability testing and feedback (ongoing).
▪ Alpha sites are ready for installation.
Exit Criteria from Alpha
▪ Get responses/feedbacks from customers.
▪ Prepare a report of any serious bugs being noticed
▪ Notify bug-fixing issues to developers.
BETA TESTING
Beta is the test period during which the product should be complete and usable in a production
environment.
The purpose of the beta ship and test period is to test the company’s ability to deliver and support
the product (and not to test the product itself). Beta also serves as a chance to get a final ‘vote of
confidence’ from a few customers to help validate our own belief that the product is now ready
for volume shipment to all customers.
Versions of the software, known as beta-versions, are released to a limited audience outside the
company. The software is released to groups of people so that further testing can ensure the
product has few or no bugs. Sometimes, beta-versions are made available to the open public.
Testing during the beta phase, informally called beta testing, is generally constrained to black-box
techniques The term beta test can refer to a stage of the software—closer to release than being ‘in
alpha’—or it can refer to the particular group and process being done at that stage.
Entry Criteria to Beta:
➢ Positive responses from alpha sites.
➢ Customer bugs in alpha testing have been addressed.
➢ There are no fatal errors which can affect the functionality of the software.
➢ Secondary platform compatibility testing is complete.
➢ Regression testing corresponding to bug fixes has been done.
➢ Beta sites are ready for installation.
Exit Criteria from Beta
➢ Get responses/feedbacks from the beta testers.
➢ Prepare a report of all serious bugs.
➢ Notify bug-fi xing issues to developers.
Guidelines for Beta Testing
➢ Don’t expect to release new builds to beta testers more than once every two
weeks.
➢ Don’t plan a beta with fewer than four releases.
PROGRESSIVE VS. REGRESSIVE TESTING
From verification to validation, the testing process progresses towards the release of the product.
However, to maintain the software, bug fixing may be required during any stage of development
and therefore, there is a need to check the software again to validate that there has been no
adverse effect on the already working software.
II. a new component, when used with unchanged components, causes failures in the
unchanged components by generating side-effects or feature interactions.
Therefore, now the following versions will be there in the system:
Baseline version The version of a component (system) that has passed a test suite.
Delta version A changed version that has not passed a regression test.
Delta build An executable configuration of the SUT that contains all the delta and baseline
components.
Thus, it can be said that most test cases begin as progressive test cases and eventually
become regression test cases. Regression testing is not another testing activity. Rather, it is
the re-execution of some or all of the already developed test cases.
Regression testing
The purpose of regression testing is to ensure that bug-fixes and new functionalities
introduced in a new version of the software do not adversely affect the correct
functionality inherited from the previous version. It may be possible that small changes in
one part of a program may have subtle undesired effects on other unrelated modules of
the software. It is not necessary that if you are getting the desired outputs on the screen,
then there is no problem.
Importance of regression testing
i. It validates the parts of the software where changes occur.
ii. It validates the parts of the software which may be affected by some changes, but
otherwise unrelated.
iii. It ensures proper functioning of the software, as it was before changes occurred.
iv. It enhances the quality of software, as it reduces the risk of high-risk bugs.
Regression testability refers to the property of a program, modification, or test suite that lets it be
effectively and efficiently regression-tested.
Leung and White classify a program as regression testable if most single statement modifications
to the program entail rerunning a small proportion of the current test suite. Under this definition,
regression testability is a function of both the design of the program and the test suite.
It tests to check that the bug has been addressed The first objective in bug fix testing is to
check whether the bug-fixing has worked or not. Therefore, you run exactly the same test
that was executed when the problem was first found. If the program fails on this testing, it
means the bug has not been fixed correctly and there is no need to do any regression
testing further.
It finds other related bugs It may be possible that the developer has fixed only the symptoms
of the reported bugs without fixing the underlying bug. Moreover, there may be various ways
to produce that bug. Therefore, regression tests are necessary to validate that the system
does not have any related bugs.
It tests to check the effect on other parts of the program It may be possible that bug-fixing has
unwanted consequences on other parts of a program. Therefore, regression tests are
necessary to check the influence of changes in one part on other parts of the program.
When Regression testing is done?
Software Maintenance
▪ Corrective maintenance Changes made to correct a system after a failure has been observed
▪ Adaptive maintenance Changes made to achieve continuing compatibility with the target environment or
other systems.
▪ Perfective maintenance Changes designed to improve or add capabilities.
▪ Preventive maintenance Changes made to increase robustness, maintainability, portability, and other features.
► Rapid Iterative Development
The extreme programming approach requires that a test be developed for each class and that this test be re-run
every time the class changes.
► Compatibility Assessment and Benchmarking
Some test suites are designed to be run on a wide range of platforms and applications to establish conformance
with a standard or to evaluate time and space performance. These test suites are meant for regression testing, but
not intended to reveal regression bugs.
Regression testing types
Bug-Fix regression This testing is performed after a bug has been reported and fixed. Its
goal is to repeat the test cases that expose the problem in the first place.
product. The goal is to prove that the change has no detrimental effect on something
that was earlier in order. It tests the overall integrity of the program, not the success of
software fixes.
Regression testing techniques
There are three different techniques for regression testing. They are discussed below.
❖ Regression test selection technique This technique attempt to reduce the time required to
retest a modified program by selecting some subset of the existing test suite.
Selective retest techniques attempt to reduce the cost of testing by identifying the portions of P’
that must be exercised by the regression test suite. Selective retesting is distinctly different from a
retest-all approach that always executes every test in an existing regression test suite ( RTS). Thus,
the objective of selective retest technique is cost reduction. It is the process of selecting a subset
of the regression test suite that tests the changes.