You are on page 1of 11

Two testing methods for software quality assurance program.

Cyclomatic Complexity in Software Testing

Cyclomatic Complexity in Software Testing is a testing metric used for


measuring the complexity of a software program. It is a quantitative measure
of independent paths in the source code of a software program. Cyclomatic
complexity can be calculated by using control flow graphs or with respect to
functions, modules, methods or classes within a software program.

V(G) = E - N + 2

Where,
E = number of edges
N = number of nodes
1

7 3

4 5

The code for the above flowchart is:

i = 0;
n=4; //N-Number of nodes present in the graph

while (i<n-1) do
j = i + 1;

while (j<n) do
if A[i]<A[j] then
swap(A[i], A[j]);

end do;
i=i+1;

end do;

V(G) = E - N + 2
V(G) = 9 – 7 + 2 = 4

Basis Set – A set of possible execution path of a program


1-7
1-2-6-1-7
1-2-3-4-5-2-6-1-7
1-2-3-5-2-6-1-7

Equivalence class testing (Equivalence class Partitioning)


It is a black-box testing technique used in software testing as a major step in
the Software development life cycle (SDLC). This testing technique is better
than many of the testing techniques like boundary value analysis, worst case
testing, robust case testing and many more in terms of time consumption and
terms of precision of the test cases. Since testing is done to identify possible
risks, equivalence class testing performs better than the other techniques as
the test cases generated using it are logically identified with partitions in
between to create different input and output classes. This can be shown from
the next-date problem which is stated below:

Given a day in the format of day-month-year, you need to find the next date
for the given date. Perform boundary value analysis and equivalence-class
testing for this.

Conditions:
D: 1 < Day < 31
M: 1 < Month < 12
Y: 1800 < Year < 2048

Boundary value analysis:


No. of test Cases (n = no. of variables) = 4n+1 = 4*3 +1 =13

Test cases:

Test case ID Day Month Year Expected


output
1 1 6 2000 2-6-2000
2 2 6 2000 3-6-2000
3 15 6 2000 16-6-2000
4 30 6 2000 1-7-2000
5 31 6 2000 Invalid date
6 15 1 2000 16-1-2000
7 15 2 2000 16-2-2000
8 15 11 2000 16-11-2000
9 15 12 2000 16-12-2000
10 15 6 1800 16-6-1800
11 15 6 1801 16-6-1801
12 15 6 2047 16-6-2047
13 15 6 2048 16-6-2048

Equivalence class testing:

Input classes:

Day:
D1: day between 1 to 28
D2: 29
D3: 30
D4: 31
Month:
M1: Month has 30 days
M2: Month has 31 days
M3: Month is February
Year:
Y1: Year is a leap year
Y2: Year is a normal year
Output classes:

Increment Day
Reset Day and Increment Month
Increment Year
Invalid Date

Strong Normal Equivalence Class Test Cases:


Test case ID Day Month Year Expected output
1 D1 M1 Y1 Increment Day
2 D1 M1 Y2 Increment Day
3 D1 M2 Y1 Increment Day
4 D1 M2 Y2 Increment Day
5 D1 M3 Y1 Increment Day or
Reset Day and
Increment month
6 D1 M3 Y2 Increment Day or
Reset Day and
Increment month
7 D2 M1 Y1 Increment Day
8 D2 M1 Y2 Increment Day
9 D2 M2 Y1 Increment Day
10 D2 M2 Y2 Increment Day
11 D2 M3 Y1 Reset Day and
Increment month
12 D2 M3 Y2 Invalid date
13 D3 M1 Y1 Reset Day and
Increment month
14 D3 M1 Y2 Reset Day and
Increment month
15 D3 M2 Y1 Increment Day
16 D3 M2 Y2 Increment Day
17 D3 M3 Y1 Invalid date
18 D3 M3 Y2 Invalid date
19 D4 M1 Y1 Invalid date
20 D4 M1 Y2 Invalid date
21 D4 M2 Y1 Reset Day and
Increment month
22 D4 M2 Y2 Reset Day and
Increment month
23 D4 M3 Y1 Invalid date
24 D4 M3 Y2 Invalid date

Test cases:

Test case ID Day Month Year Expected


output
E1 15 4 2004 16-4-2004
E2 15 4 2003 16-4-2003
E3 15 1 2004 16-1-2004
E4 15 1 2003 16-1-2003
E5 15 2 2004 16-2-2004
E6 15 2 2003 16-2-2003
E7 29 4 2004 30-4-2004
E8 29 4 2003 30-4-2003
E9 29 1 2004 30-1-2004
E10 29 1 2003 30-1-2003
E11 29 2 2004 1-3-2004
E12 29 2 2003 Invalid date
E13 30 4 2004 1-5-2004
E14 30 4 2003 1-5-2003
E15 30 1 2004 31-1-2004
E16 30 1 2003 31-1-2003
E17 30 2 2004 Invalid date
E18 30 2 2003 Invalid date
E19 31 4 2004 Invalid date
E20 31 4 2003 Invalid date
E21 31 1 2004 1-2-2004
E22 31 1 2003 1-2-2003
E23 31 2 2004 Invalid date
E24 31 2 2003 Invalid date

So from this problem it is clearly seen that equivalence class testing clearly
checks for many cases that boundary value did not considered like that of
February which has 28-29 days, leap year which lead to variation in number of
days in February and many more.

Advantages of software quality program


It saves money. Errors are expensive. If a company releases a imperfect
application, they will take it up by releasing fixes, patches, and in some cases
indeed total updates. These cost money. Besides, computer program
companies can lose business (as in, money!) in case they have a reputation for
destitute quality, buggy software.
It spares time. CrossTalk, the Diary of Defense Software Designing, reports it
may take up to 150 times longer to settle a mistake in production than to settle
that error within the design stage.
It avoids breakdowns and comparative catastrophes. Taking a signal from the
primary two focuses, breakdowns cost money, are time-consuming, and deny
clients access to the item or benefit. If there’s anything more awful than a
program with a number of kinks and bugs in it, it’s an application that
eventually falls flat.
It boosts customer confidence. You'll be able to spend so much time making a
great reputation, as it were to lose it overnight. Alternately, clients will run to
companies that are known for creating quality releases.
It increases your market share. A high-quality program puts your company in a
stronger, more prevailing market position.
It cuts maintenance costs. Get the release right the first time, and your
company can forget about it and move on to another enormous thing. Release
an item with incessant issues, and your commerce lowlands down in a costly,
time-consuming, never-ending cycle of repairs.
It increments item security. In spite of the fact that item security sounds like
something more appropriate to a physical item like a bike helmet, electrical
machine, or vehicle. In any case, “safety” gets to be pertinent after you
calculate within the concept of cybersecurity. Numerous applications depend
on an internet connection, and in the event that your item leaves your clients
vulnerable to information breaches, the results are disastrous.

Saves You Money


How much money does a faulty software project cost you? It costs you users
and clients. And it is well known that the longer a bug goes undetected in your
software, the more difficult and expensive it is to fix it. By employing QA
testing throughout the development process of the software, you will save
time and money after deploy.

Prevents Catastrophic Corporate Emergencies


With corporate software, the stakes are even higher. Bugs in corporate
software can lead to system blackouts, missing data, and communication
breakdowns. If you are going to be employing software throughout a company
or to handle sensitive information, then you had better be sure that the
software is going to work exactly how it needs to work. There is no margin for
error.

Inspires Client Confidence


By making QA software testing a clear priority for software development, you
are sending a message to your clients that you want their software to be as
successful as possible. This is incredibly important when you’re in the business
of delivering quality and forging long-term relationships.

Maintains Great User Experience


It is becoming more and more clear these days that user experience will make
or break a product. If software is glitching or slow, then it impedes the
experience of the user with the product. Bad user experience results in
dissatisfaction and frustration. Good user experience, what you get when you
have meticulously tested a software product, results in a satisfied user- one
who is much more likely to recommend the product and your business to
others.

Brings In More Profit


If you are creating software that you will market or sell, then investing in QA
will mean that you can sell your product at a higher rate. There is nothing
worse than an angry user who paid for a product that doesn’t even work.

Boosts Customer Satisfaction


Related to the first point, this sixth benefit is focused on the reputation that
customer satisfaction brings your company, not just the profit. By offering
quality software that works when and how you want it to work, you will be
boosting your reputation by producing happy customers. Don’t tax your
customer’s patience with defective software that you have to constantly fix.
Give them quality from the beginning and they’ll reward you with loyalty.

Promotes Organization, Productivity, and Efficiency


What you don’t want is the chaos of faulty software, frantic communication,
and hurried fixes. Being organized with QA testing from the beginning of your
development strategy will allow you to work in peace and be more productive
with your time. By utilizing agile methodologies, where software developers
create and deliver small chunks of a product on a clear timeline, you can begin
testing software as it is created, instead of always waiting to the end. When
software testing is an integral part of your software strategy, you win, your
client wins, and their users win. The benefits are clear.

Some other benefits include:


 Increased productivity of the development team.
 Improved Product Quality - Test statistics and defect tracking are more
precise and up to date.
 Decreased re-work costs as the detection of defects are found earlier in
software project development life cycle in every stage.
 Increased confidence levels in existing product management and future
product development.
 Increased credibility as the software produced will be highly qualitative.
 Saves Money.
 Inspires Client Confidence.
 Maintains Great User Experience.
 Brings In More Profit.
 Boosts Customer Satisfaction.

You might also like