Notes of Unit - IV (SE)
Notes of Unit - IV (SE)
The main goal of software testing is to find bugs as early as possible and
fix bugs and make sure that the software is bug-free. The goals of software
testing may be classified into three major categories as follows:
1. Immediate Goals
2. Long-term Goals
3. Post-Implementation Goals
Read
Discuss
Principles of Testing:-
(v) It follows the Pareto rule(80/20 rule) which states that 80% of errors
come from 20% of program components.
(vi) Start testing with small parts and extend it to large parts.
Types of Testing:-
1. Unit Testing
Example:
c) Incorrect initialization
2. Integration Testing
Example:
3. Regression Testing
Every time a new module is added leads to changes in the program. This
type of testing makes sure that the whole component works properly even
after adding components to the complete program.
Example
4. Smoke Testing
This test is done to make sure that the software under testing is ready or
stable for further testing
Example:
5. Alpha Testing
Example:
the organization
6. Beta Testing
The beta test is conducted at one or more customer sites by the end-user
of the software. This version is released for a limited number of users for
testing in a real-time environment
Example:
number of people
7. System Testing
This software is tested such that it works fine for the different operating
systems. It is covered under the black box testing technique. In this, we
just focus on the required input and output without focusing on internal
working.
Example:
testing
8. Stress Testing
In this, we give unfavorable conditions to the system and check how they
perform in those conditions.
Example:
9. Performance Testing
● Testing of Requirements,
● Design and Analysis of Testing,
● Testing of Code,
● Integration testing,
● System testing,
● User Testing.
The following table lists the advantages and disadvantages of black-box testing.
Advantages Disadvantages
Well suited and efficient for large Limited coverage, since only a
code segments. selected number of test scenarios
is actually performed.
The tester needs to have a look inside the source code and find out which
unit/chunk of the code is behaving inappropriately.
The following table lists the advantages and disadvantages of white-box testing.
Advantages Disadvantages
As the tester has knowledge of the Due to the fact that a skilled tester
source code, it becomes very easy is needed to perform white-box
to find out which type of data can testing, the costs are increased.
help in testing the application
effectively.
It helps in optimizing the code. Sometimes it is impossible to look
into every nook and corner to find
out hidden errors that may create
problems, as many paths will go
untested.
Grey-Box Testing
Gray-box testing is a technique to test the application with having a limited
knowledge of the internal workings of an application. In software testing, the
phrase the more you know, the better carries a lot of weight while testing an
application.
Mastering the domain of a system always gives the tester an edge over someone
with limited domain knowledge. Unlike black-box testing, where the tester only
tests the application's user interface; in grey-box testing, the tester has access to
design documents and the database. Having this knowledge, a tester can prepare
better test data and test scenarios while making a test plan.
Advantages Disadvantages
Offers combined benefits of Since the access to source code is
black-box and white-box testing not available, the ability to go over
wherever possible. the code and test coverage is
limited.
Grey box testers don't rely on the The tests can be redundant if the
source code; instead they rely on software designer has already run a
interface definition and functional test case.
specifications.
Not suited for Not suited for algorithm Suited for algorithm
algorithm testing. testing. testing.
This can only be done Data domains and Data domains and
by trial-and-error internal boundaries can internal boundaries
method. be tested, if known. can be better tested.
It checks for the input values near the boundary that have a higher chance
of error. Every partition has its maximum and minimum values and these
maximum and minimum values are the boundary values of a partition.
Note:
● A boundary value for a valid partition is a valid boundary value.
● A boundary value for an invalid partition is an invalid boundary
value.
● For each variable we check-
○ Minimum value.
○ Just above the minimum.
○ Nominal Value.
○ Just below Max value.
○ Max value.
Valid
Invalid
Invalid
(min, min + 1,
(max +
(min-1) nominal, max – 1,
1)
max)
17 18, 19, 37, 55, 56 57
Valid Test cases: Valid test cases for the above can be any value entered
greater than 17 and less than 57.
Invalid Test Cases: When any value less than 18 and greater than 56 is
entered.
Single Fault Assumption: When more than one variable for the same
application is checked then one can use a single fault assumption. Holding
all but one variable to the extreme value and allowing the remaining
variable to take the extreme value. For n variable to be checked:
1 ≤ Month≤12
1 ≤ Day ≤31
Solution: Taking the year as a Single Fault Assumption i.e. year will be
having values varying from 1900 to 2000 and others will have nominal
values.
14 June
2 6 15 1901
1901
14 June
3 6 15 1960
1960
14 June
4 6 15 1999
1999
14 June
5 6 15 2000
2000
Taking Day as Single Fault Assumption i.e. Day will be having values
varying from 1 to 31 and others will have nominal values.
Test Mont Da Yea
Output
Case h y r
29 June
8 6 30 1960
1960
Taking Month as Single Fault Assumption i.e. Months will have values
varying from 1 to 12 and others will have nominal values.
Test Mont Da Yea
Output
Case h y r
14 Feb
11 2 15 1960
1960
14 Nov
12 11 15 1960
1960
14 Dec
13 12 15 1960
1960
4 × 3 + 1 =13
The focus of BVA: BVA focuses on the input variable of the function. Let’s
define two variables X1 and X2, where X1 lies between a and b and X2 lies
between c and d.
The idea and motivation behind BVA are that errors tend to occur near the
extremes of the variables. The defect on the boundary value can be the
result of countless possibilities.
PASCAL, ADA is the strongly typed language that requires all constants or
variables defined with an associated data type.
Enter value 0 to 5
1 Not accepted
character
2 Enter 6 to 10 character Accepted
● Informal:
In informal review the creator of the documents put the contents in
front of the audience and everyone gives their opinion and thus
defects are identified in the early stage.
● Walkthrough:
It is basically performed by an experienced person or expert to
check the defects so that there might not be problems further in
the development or testing phase.
● Peer review:
Peer review means checking documents of one-another to detect
and fix the defects. It is basically done in a team of colleagues.
● Inspection:
Inspection is basically the verification of documents by higher
authority like the verification of software requirement
specifications (SRS).
2. Static Analysis:
Static Analysis includes the evaluation of the code quality that is written by
developers. Different tools are used to do the analysis of the code and
comparison of the same with the standard.
● Data Flow:
Data flow is related to stream processing.
● Control Flow:
Control flow is basically how the statements or instructions are
executed.
● Cyclomatic Complexity:
Cyclomatic complexity is the measurement of the complexity of
the program that is basically related to the number of independent
paths in the control flow graph of the program.