Software Design
Software Design
Software Design is the process to transform the user requirements into some
suitable form, which helps the programmer in software coding and
implementation. During the software design phase, the design document is
produced, based on the customer requirements as documented in the SRS
document. Hence the aim of this phase is to transform the SRS document into
the design document.
The following items are designed and documented during the design phase:
1. Correctness:
A good design should be correct i.e. it should correctly implement all
the functionalities of the system.
2. Efficiency:
A good software design should address the resources, time, and cost
optimization issues.
3. Understandability:
A good design should be easily understandable, for which it should be
modular and all the modules are arranged in layers.
4. Completeness:
The design should have all the components like data structures,
modules, and external interfaces, etc.
5. Maintainability:
A good software design should be easily amenable to change
whenever a change request is made from the customer side.
1. Architectural Design:
The architecture of a system can be viewed as the overall structure of
the system & the way in which structure provides conceptual integrity of
the system. The architectural design identifies the software as a system
with many components interacting with each other. At this level, the
designers get the idea of the proposed solution domain.
3. Detailed design:
Once the high-level design is complete, a detailed design is
undertaken. In detailed design, each module is examined carefully to
design the data structure and algorithms. The stage outcome is
documented in the form of a module specification document.
Design Strategies
A good system design is to organize the program modules in such a way
that are easy to develop and change. Structured design techniques help
developers to deal with the size and complexity of programs. Analysts
create instructions for the developers about how code should be written
and how pieces of code should fit together to form a program.
Importance :
Advantages:
● The economics can result when general solutions can be reused.
● It can be used to hide the low-level details of implementation and
be merged with the top-down technique.
Disadvantages:
● It is not so closely related to the structure of the problem.
● High-quality bottom-up solutions are very hard to construct.
● It leads to the proliferation of ‘potentially useful’ functions rather
than the most appropriate ones.
● Top-down approach:
Each system is divided into several subsystems and components.
Each of the subsystems is further divided into a set of subsystems
and components. This process of division facilitates in forming a
system hierarchy structure. The complete software system is
considered as a single entity and in relation to the characteristics,
the system is split into sub-system and component. The same is
done with each of the sub-systems.
This process is continued until the lowest level of the system is
reached. The design is started initially by defining the system as a
whole and then keeps on adding definitions of the subsystems
and components. When all the definitions are combined together,
it turns out to be a complete system.
For the solutions of the software that need to be developed from
the ground level, top-down design best suits the purpose.
Advantages:
● The main advantage of the top-down approach is that its strong
focus on requirements helps to make a design responsive
according to its requirements.
Disadvantages:
● Project and system boundaries tend to be application
specification-oriented. Thus it is more likely that advantages of
component reuse will be missed.
● The system is likely to miss, the benefits of a well-structured,
simple architecture.
● Hybrid Design:
It is a combination of both the top-down and bottom-up design
strategies. In this, we can reuse the modules.
Functional Independence: Functional independence is achieved by developing
functions that perform only one kind of task and do not excessively interact with other
modules. Independence is important because it makes implementation more
accessible and faster. The independent modules are easier to maintain, test, and
reduce error propagation and can be reused in other programs as well. Thus,
functional independence is a good design feature which ensures software quality.
Module Coupling
A good design is the one that has low coupling. Coupling is measured by the number
of relations between the modules. That is, the coupling increases as the number of
calls between modules increase or the amount of shared data is large. Thus, it can be
said that a design with high coupling will have more errors.
17.6M
352
History of Java
3. Stamp Coupling: Two modules are stamp coupled if they communicate using
composite data items such as structure, objects, etc. When the module passes non-
global data structure or entire structure to another module, they are said to be stamp
coupled. For example, passing structure variable in C or object in C++ language to a
module.
4. Control Coupling: Control Coupling exists among two modules if data from one
module is used to direct the structure of instruction execution in another.
5. External Coupling: External Coupling arises when two modules share an externally
imposed data format, communication protocols, or device interface. This is related to
communication to external tools and devices.
6. Common Coupling: Two modules are common coupled if they share information
through some global data items.
7. Content Coupling: Content Coupling exists among two modules if they share code,
e.g., a branch from one module into another module.
Module Cohesion
In computer programming, cohesion defines to the degree to which the elements of a
module belong together. Thus, cohesion measures the strength of relationships
between pieces of functionality within a given module. For example, in highly cohesive
systems, functionality is strongly related.
Coupling shows the relationships Cohesion shows the relationship within the
between modules. module.
While creating, you should aim for While creating you should aim for high
low coupling, i.e., dependency cohesion, i.e., a cohesive component/ module
among modules should be less. focuses on a single function (i.e., single-
mindedness) with little interaction with other
modules of the system.
Attributes Description
Identification Identifies name of the entity. All the
entities have a unique name.
UML is linked with object oriented design and analysis. UML makes the use of
elements and forms associations between them to form diagrams. Diagrams in
UML can be broadly classified as:
The image below shows the hierarchy of diagrams according to UML 2.2
Object Oriented Concepts Used in UML –
1. Class – A class defines the blue print i.e. structure and functions of an
object.
2. Objects – Objects help us to decompose large systems and help us to
modularize our system. Modularity helps to divide our system into
understandable components so that we can build our system piece by
piece. An object is the fundamental unit (building block) of a system
which is used to depict an entity.
3. Inheritance – Inheritance is a mechanism by which child classes
inherit the properties of their parent classes.
4. Abstraction – Mechanism by which implementation details are hidden
from user.
5. Encapsulation – Binding data together and protecting it from the outer
world is referred to as encapsulation.
6. Polymorphism – Mechanism by which functions or entities are able to
exist in different forms.
1. Class Diagram – The most widely use UML diagram is the class
diagram. It is the building block of all object oriented software
systems. We use class diagrams to depict the static structure of a
system by showing system’s classes,their methods and attributes.
Class diagrams also help us identify relationship between different
classes or objects.
2. Composite Structure Diagram – We use composite structure diagrams
to represent the internal structure of a class and its interaction points
with other parts of the system. A composite structure diagram
represents relationship between parts and their configuration which
determine how the classifier (class, a component, or a deployment
node) behaves. They represent internal structure of a structured
classifier making the use of parts, ports, and connectors. We can also
model collaborations using composite structure diagrams. They are
similar to class diagrams except they represent individual parts in
detail as compared to the entire class.
3. Object Diagram – An Object Diagram can be referred to as a
screenshot of the instances in a system and the relationship that
exists between them. Since object diagrams depict behaviour when
objects have been instantiated, we are able to study the behaviour of
the system at a particular instant. An object diagram is similar to a
class diagram except it shows the instances of classes in the system.
We depict actual classifiers and their relationships making the use of
class diagrams. On the other hand, an Object Diagram represents
specific instances of classes and relationships between them at a
point of time.
4. Component Diagram – Component diagrams are used to represent the
how the physical components in a system have been organized. We
use them for modelling implementation details. Component Diagrams
depict the structural relationship between software system elements
and help us in understanding if functional requirements have been
covered by planned development. Component Diagrams become
essential to use when we design and build complex systems.
Interfaces are used by components of the system to communicate
with each other.
5. Deployment Diagram – Deployment Diagrams are used to represent
system hardware and its software.It tells us what hardware
components exist and what software components run on them.We
illustrate system architecture as distribution of software artifacts over
distributed targets. An artifact is the information that is generated by
system software. They are primarily used when a software is being
used, distributed or deployed over multiple machines with different
configurations.
6. Package Diagram – We use Package Diagrams to depict how
packages and their elements have been organized. A package diagram
simply shows us the dependencies between different packages and
internal composition of packages. Packages help us to organise UML
diagrams into meaningful groups and make the diagram easy to
understand. They are primarily used to organise class and use case
diagrams.
Behavior Diagrams –
3. It recognizes the internal as well as external factors that influence the system.
25.4M
566
C++ vs Java
After that, we will enlist the actors that will interact with the system. The actors are the
person or a thing that invokes the functionality of a system. It may be a system or a
private entity, such that it requires an entity to be pertinent to the functionalities of the
system to which it is going to interact.
Once both the actors and use cases are enlisted, the relation between the actor and
use case/ system is inspected. It identifies the no of times an actor communicates
with the system. Basically, an actor can interact multiple times with a use case or
system at a particular instance of time.
Following are some rules that must be followed while drawing a use case diagram:
1. A pertinent and meaningful name should be assigned to the actor or a use case
of a system.
2. The communication of an actor with a use case must be defined in an
understandable way.
Here the Web Customer actor makes use of any online shopping website to purchase
online. The top-level uses are as follows; View Items, Make Purchase, Checkout, Client
Register. The View Items use case is utilized by the customer who searches and view
products. The Client Register use case allows the customer to register itself with the
website for availing gift vouchers, coupons, or getting a private sale invitation. It is to
be noted that the Checkout is an included use case, which is part of Making Purchase,
and it is not available by itself.
The View Items is further extended by several use cases such as; Search Items,
Browse Items, View Recommended Items, Add to Shopping Cart, Add to Wish list. All
of these extended use cases provide some functions to customers, which allows them
to search for an item. The View Items is further extended by several use cases such
as; Search Items, Browse Items, View Recommended Items, Add to Shopping Cart,
Add to Wish list. All of these extended use cases provide some functions to
customers, which allows them to search for an item.
Both View Recommended Item and Add to Wish List include the Customer
Authentication use case, as they necessitate authenticated customers, and
simultaneously item can be added to the shopping cart without any user
authentication.
Similarly, the Checkout use case also includes the following use cases, as shown
below. It requires an authenticated Web Customer, which can be done by login page,
user authentication cookie ("Remember me"), or Single Sign-On (SSO). SSO needs an
external identity provider's participation, while Web site authentication service is
utilized in all these use cases.
The Checkout use case involves Payment use case that can be done either by the
credit card and external credit payment services or with PayPal.
Important tips for drawing a Use Case diagram
Following are some important tips that are to be kept in mind while drawing a use case
diagram:
8. A use case diagram should represent the most significant interaction among
the multiple interactions.
It shows the attributes, classes, functions, and relationships to give an overview of the
software system. It constitutes class names, attributes, and functions in a separate
compartment that helps in software development. Since it is a collection of classes,
interfaces, associations, collaborations, and constraints, it is termed as a structural
diagram.
● Upper Section: The upper section encompasses the name of the class. A class
is a representation of similar objects that shares the same relationships,
attributes, operations, and semantics. Some of the following rules that should
be taken into account while representing a class are given below:
● Middle Section: The middle section constitutes the attributes, which describe
the quality of the class. The attributes have the following characteristics:
a. The attributes are written along with its visibility factors, which are public
(+), private (-), protected (#), and package (~).
Relationships
In UML, relationships are of three types:
Abstract Classes
In the abstract class, no objects can be a direct entity of the abstract class. The
abstract class can neither be declared nor be instantiated. It is used to find the
functionalities across the classes. The notation of the abstract class is similar to that
of class; the only difference is that the name of the class is written in italics. Since it
does not involve any implementation for a given function, it is best to use the abstract
class with multiple objects.
Let us assume that we have an abstract class named displacement with a method
declared inside it, and that method will be called as a drive (). Now, this abstract class
method can be implemented by any object, for example, car, bike, scooter, cycle, etc.
Some key points that are needed to keep in mind while drawing a class diagram are
given below:
5. Notes can be used as and when required by the developer to describe the
aspects of a diagram.
12. To show the collaboration among every instance in the static view.
Both the object and class diagram are similar to some extent; the only difference is
that the class diagram provides an abstract view of a system. It helps in visualizing a
particular functionality of a system.
The object diagram is actually similar to the concrete (actual) system behavior. The
main purpose is to depict a static view of a system.
Exception Handling in Java - Javatpoint
1. All the objects present in the system should be examined before start drawing
the object diagram.
2. Before creating the object diagram, the relation between the objects must be
acknowledged.
4. Reverse engineering.
A set of messages that are interchanged between the entities to achieve certain
specified tasks in the system is termed as interaction. It may incorporate any feature
of the classifier of which it has access. In the interaction diagram, the critical
component is the messages and the lifeline.
In UML, the interaction overview diagram initiates the interaction between the objects
utilizing message passing. While drawing an interaction diagram, the entire focus is to
represent the relationship among different objects which are available within the
system boundary and the message exchanged by them to communicate with each
other.
The sequence diagram envisions the order of the flow of messages inside the system
by depicting the communication between two lifelines, just like a time-ordered
sequence of events.
Before drawing an interaction diagram, the first step is to discover the scenario for
which the diagram will be made. Next, we will identify various lifelines that will be
invoked in the communication, and then we will classify each lifeline. After that, the
connections are investigated and how the lifelines are interrelated to each other.
2. The sequence of the message flow among several entities within the system.
4. Several distinct messages that depict the interactions in a precise and clear
way.
2. The interaction diagram explores and compares the use of the collaboration
diagram sequence diagram and the timing diagram.
4. The sequence diagram portrays the order of control flow from one element to
the other elements inside the system, whereas the collaboration diagrams are
employed to get an overview of the object architecture of the system.
○ In the collaboration diagram, firstly, the object is created, and then its
class is specified.
2. Actors: In the collaboration diagram, the actor plays the main role as it invokes
the interaction. Each actor has its respective role and name. In this, one actor
initiates the use case.
3. Links: The link is an instance of association, which associates the objects and
actors. It portrays a relationship between the objects through which the
messages are sent. It is represented by a solid line. The link helps an object to
connect with or navigate to another object, such that the message flows are
attached to links.
Following are some of the use cases enlisted below for which the collaboration
diagram is implemented:
1. To model collaboration among the objects or roles that carry the functionalities
of use cases and operations.
3. To capture the interactions that represent the flow of messages between the
objects and the roles inside the collaboration.
1. Determine the behavior for which the realization and implementation are
specified.
2. Discover the structural elements that are class roles, objects, and subsystems
for performing the functionality of collaboration.
7. It focuses on the elements and not the message flow, like sequence diagrams.
8. Since the collaboration diagrams are not that expensive, the sequence diagram
can be directly converted to the collaboration diagram.
9. There may be a chance of losing some amount of information while
implementing a collaboration diagram with respect to the sequence diagram.
2. It is a time-consuming diagram.
Principles
There are many myths and false assumptions that continue to loom around
Software Testing. There are also lots of myths out there that prevent fully
testing the software application that can lead to producing an insecure and
less productive software application. Software testing not only provides
security to the system or software application but also concentrates on
fulfilling the requirements of the end-users.
Following are the myths that need to be challenged for the purpose of good
software quality:
Testing Limitations
● Time and budget constraints normally require very careful planning of the testing
effort.
● Test results are used to make business decisions for release dates.
● You will run out of time before you run out of test cases
Fault :
It is an incorrect step in any process and data definition in computer
program which is responsible of the unintended behavior of any program
in the computer. Faults or bugs in a hardware or software may cause
errors. An error can be defined as a part of the system which will lead to
the failure of the system. Basically an error in a program is an indication
that failure occurs or has tp occurred.
If there are multiple components of the system, errors in that system will
lead to component failure. As there are many component in the system that
interact with each other, failure of one component might be responsible to
introduce one or more faults in the system. Following cycle show the
behavior of the fault.
Figure: Fault Behavior
Types of fault :
In software products, different types of fault can be occurred. In order to
remove the fault, we have to know what type of fault which is facing by our
program. So the following are the types of faults :
Fault Avoidance :
Fault in the program can be avoid by using techniques and procedures
which aims to avoid the introduction of the fault during any phase of the
safety lifecycle of the safety related system.
Fault Tolerance :
It is ability of the functional unit to continue to perform a required function
even in the presence of the fault.
Levels of Testing
In this section, we are going to understand the various levels of software testing.
As we learned in the earlier section of the software testing tutorial that testing any
application or software, the test engineer needs to follow multiple testing techniques.
In order to detect an error, we will implement software testing; therefore, all the errors
can be removed to find a product with more excellent quality.
.
26.3M
608
Stay
In order to test any application, we need to go through all the above phases of SDLC.
Like SDLC, we have multiple levels of testing, which help us maintain the quality of the
software.
The levels of software testing involve the different methodologies, which can be used
while we are performing the software testing.
In software testing
1. Unit Testing
2. Integration Testing
3. System Testing
4. Acceptance Testing
As we can see in the above image that all of these testing levels have a specific
objective which specifies the value to the software development lifecycle.
Unit testing is the first level of software testing, which is used to test if software
modules are satisfying the given requirement or not.
The first level of testing involves analyzing each unit or an individual component of the
software application.
Unit testing will help the test engineer and developers in order to understand the base
of code that makes them able to change defect causing code quickly. The developers
implement the unit.
Level2: Integration Testing
The second level of software testing is the integration testing. The integration testing
process comes after unit testing.
It is mainly used to test the data flow from one module or component to other
modules.
In integration testing, the test engineer tests the units or separate components or
modules of the software in a group.
The primary purpose of executing the integration testing is to identify the defects at
the interaction between integrated components or units.
When each component or module works separately, we need to check the data flow
between the dependent modules, and this process is known as integration testing.
We only go for the integration testing when the functional testing has been completed
successfully on each application module.
In simple words, we can say that integration testing aims to evaluate the accuracy of
communication among all the modules.
The third level of software testing is system testing, which is used to test the
software's functional and nonfunctional requirements.
In system testing, we will go through all the necessary modules of an application and
test if the end features or the end business works fine, and test the product as a
complete system.
In simple words, we can say that System testing is a sequence of different types of
tests to implement and examine the entire working of an integrated software computer
system against requirements.
The last and fourth level of software testing is acceptance testing, which is used to
evaluate whether a specification or the requirements are met as per its delivery.
The software has passed through three testing levels (Unit Testing, Integration
Testing, System Testing). Some minor errors can still be identified when the end-user
uses the system in the actual scenario.
In simple words, we can say that Acceptance testing is the squeezing of all the testing
processes that are previously done.
The acceptance testing is also known as User acceptance testing (UAT) and is done by
the customer before accepting the final product.
Usually, UAT is done by the domain expert (customer) for their satisfaction and checks
whether the application is working according to given business scenarios and real-
time scenarios.
Alpha testing is simulated or real operational testing at an in-house site. It comes after
the unit testing, integration testing, etc. Alpha testing used after all the testing are
executed.
It can be a white box, or Black-box testing depends on the requirements - particular
lab environment and simulation of the actual environment required for this testing.
26.6M
507
3. Test case design: Execute the test plan and test cases.
4. Logging Defects: Logging the identified and detected bug found in the
application.
5. Bug Fixation: When all the bugs are identified and logged, then there is a need
to fix the bug.
6. Retesting: When all the issues are solved, and fixed retesting is done.
First Phase: In-house developers of software engineers do the first phase of testing. In
this phase, the tester used hardware debugger or hardware aided debugger to catches
the bugs quickly. During the alpha testing, a tester finds a lot of bugs, crashes, missing
features, and docs.
Second Phase: The second phase involves the quality assurance staff performs the
alpha testing by involving black box and white box techniques.
● Alpha testing allows the team to test the software in a real-world environment.
● One of the reasons to do alpha testing is to ensure the success of the software
product.
● Alpha testing helps to gain confidence in the user acceptance of the software
product.
● With the help of black box and white box technique, we can achieve the alpha
testing.
● Alpha testing ensures the maximum possible quality of the software before
releasing it to market or client for beta testing.
● Alpha testing is for testing the software application, products, and projects.
● One of the benefits of alpha testing is it reduces the delivery time of the project.
● The difference between the tester's tests the data for testing the software and
the customer's data from their perspective may result in the discrepancy in the
software functioning.
● The lab environment is used to simulate the real environment. But still, the lab
cannot furnish all the requirement of the real environment such as multiple
conditions, factors, and circumstances.
Wrap Up:
Every software product needs to undergo a vital methodology before going into a
highly competitive market. Alpha testing is one of the vital testing. It needs to be
considered by going through the functionality of the software and achieve the
confidence in its user acceptance for the real environment, before releasing it into the
market.
● Beta testing is the last phase of the testing, which is carried out at the client's or
customer's site.
● Beta testing used in a real environment at the user's site. Beta testing helps in
providing the actual position of the quality.
● Beta testing always is done after the alpha testing, and before releasing it into
the market.
● Beta testing performs in the absence of tester and the presence of real users
● Beta testing is performed after alpha testing and before the release of the final
product.
● Beta testing generally is done for testing software products like utilities,
operating systems, and applications, etc.
1) Closed beta version: Closed beta version, also known as a private beta, it is released
to a group of selected and invited people. Those people will test the software and
evaluate their features and specifications. This beta version represents the software
which is capable of delivering value, but it is not ready to be used by everyone.
Because it shows the issues like lack of documentation or missing vital features.
2) Open beta version: Open beta is also known as a public beta. The open beta opened
to the public. Any user as a tester can assess the beta version to provide the relevant
feedback and reviews. Open beta version improves the quality of the final release. This
version helps to find the various undetected errors and issues.
The beta testing process orients this beta version.
1. Planning: Like another testing process, beta testing also supports proper
planning. In this stage, the team prepares a testing strategy and defines the
goal of testing. In this case, the team establishes the need of users for testing,
duration, and necessary details related to the process.
2. Participant Recruitment: This is the second stage of the beta process in which
the team recruits a group of selected end-users for testing. This group can
change as per the requirement of the organization and the product.
3. Product Launch: When a team of users (testers) recruited. The beta version of
the product is launched or installed at the client or user side, and users will test
the product for quality assurance.
4. Collect and Evaluate Feedback: When the testing finished, developers will
collect the feedback provided by the testers and evaluate it. In the end, based
on the feedback, issues, and bugs are fixed and resolved by the responsible
individual team.
5. Closure: When all the problems fixed and the organization meets the exit
criteria, beta testing achieved, and the rewards offered to the testing team.
1. Open Beta Testing: Open beta testing involves testing the software product by a
large number of people before the final release. The organization decides to
make a software product open to the public before releasing the product. Open
Beta includes the extensive participation of the public to use and evaluate
software product accordingly.
Users report the bug to the organization, along with a suggestion to improve the
quality of the software.
2. Closed Beta Testing: Opposite to the open beta testing. Closed beta testing
performed by the selective and limited number of persons. The organization
recruits these. In this testing software product is not open to the public.
4. Public Beta Testing: This type of testing is similar to open testing. Public beta
testing also allows the product is delivering to the end-users worldwide, with
the aid of various online channels available in the world. From this, the
feedback and evaluated data also collected and based on the requirement
changes, and the development team implements modifications.
5. Technical Beta Testing: Technical beta testing is also an essential type of beta
testing. This testing involves delivering the software product to the internal
groups of the organization. However, the data and feedback provided by the
employees of the organization.
7. Post-Release Beta Testing: In this testing, the product delivered to the market
for the use of the end-users. Their feedback, reactions, and experience are
collect for the future release of the software.
Any product undergoing to beta test should be reviewed for the entire checklist before
launching it.
● The product management team should review that all the functionality is in
good condition.
The real users who use the product are the participants.
Objective: We should have to mention the aim of the project why there is a need for
beta testing even after performing the internal testing.
Test Approach: We should have to mention clearly that the testing is in the deep, what
to focus on - functionality, UI, response, etc.
Schedule: We have to specify, clearly the start and ending date with time, number of
cycles, and duration per cycle.
Tools: Bug logging tools and the usage of the machines should identify.
4. It helps to detect the defect and issues in the system, which is overlooked and
undetected by the team of software testers.
5. Beta testing helps the user to install, test, and send feedback regarding the
developed software.
What are the disadvantages of Beta Testing?
Disadvantages of beta testing is:
1. In this type of testing, a software engineer has no control over the process of
the testing, as the users in the real-world environment perform it.
2. This testing can be a time-consuming process and can delay the final release of
the product.
3. Beta testing does not test the functionality of the software in depth as software
still in development.
4. It is a waste of time and money to work on the feedback of the users who do not
use the software themselves properly.
Wrap Up
Keeping in mind the characteristics of beta testing can be concluded that beta testing
may be considered desirable for the organization. Beta testing provides the feedback
of the real-users, which helps improve the software quality before the product
released in the market.
Testing techniques:
4 test cases required such that all branches of all decisions are covered, i.e, all edges of flowchart are
covered
● Condition Coverage: In this technique, all individual conditions must
be covered as shown in the following example:
1. READ X, Y
2. IF(X == 0 || Y == 0)
3. PRINT ‘0’
● In this example, there are 2 conditions: X == 0 and Y == 0. Now, test
these conditions get TRUE and FALSE as their values. One possible
example would be:
1. #TC1 – X = 0, Y = 55
2. #TC2 – X = 5, Y = 0
● Multiple Condition Coverage: In this technique, all the possible
combinations of the possible outcomes of conditions are tested at
least once. Let’s consider the following example:
1. READ X, Y
2. IF(X == 0 || Y == 0)
3. PRINT ‘0’
4. #TC1: X = 0, Y = 0
5. #TC2: X = 0, Y = 5
6. #TC3: X = 55, Y = 0
7. #TC4: X = 55, Y = 5
● Hence, four test cases required for two individual conditions.
Similarly, if there are n conditions then 2n test cases would be
required.
● Basis Path Testing: In this technique, control flow graphs are made
from code or flowchart and then Cyclomatic complexity is calculated
which defines the number of independent paths so that the minimal
number of test cases can be designed for each independent path.
Steps:
1. Make the corresponding control flow graph
2. Calculate the cyclomatic complexity
3. Find the independent paths
4. Design test cases corresponding to each independent path
● Flow graph notation: It is a directed graph consisting of nodes and
edges. Each node represents a sequence of statements, or a decision
point. A predicate node is the one that represents a decision point
that contains a condition after which the graph splits. Regions are
bounded by nodes and edges.
Advantages:
1. White box testing is very thorough as the entire code and structures
are tested.
2. It results in the optimization of code removing error and helps in
removing extra lines of code.
3. It can start at an earlier stage as it doesn’t require any interface as in
case of black box testing.
4. Easy to automate.
Disadvantages:
In this method, tester selects a function and gives input value to examine its
functionality, and checks whether the function is giving expected output or not. If the
function produces correct output, then it is passed in testing, otherwise failed. The
test team reports the result to the development team and then tests the next function.
After completing testing of all functions if there are severe problems, then it is given
back to the development team for correction.
● In the second step, the tester creates a positive test scenario and an adverse
test scenario by selecting valid and invalid input values to check that the
software is processing them correctly or incorrectly.
● In the third step, the tester develops various test cases such as decision table,
all pairs test, equivalent division, error estimation, cause-effect graph, etc.
● In the fifth step, the tester compares the expected output against the actual
output.
● In the sixth and final step, if there is any flaw in the software, then it is cured
and tested again.
Test procedure
The test procedure of black box testing is a kind of process in which the tester has
specific knowledge about the software's work, and it develops test cases to check the
accuracy of the software's functionality.
It does not require programming knowledge of the software. All test cases are
designed by considering the input and output of a particular function.A tester knows
about the definite output of a particular input, but not about how the result is arising.
There are various techniques used in black box testing for testing like decision table
technique, boundary value analysis technique, state transition, All-pair testing, cause-
effect graph technique, equivalence partitioning technique, error guessing technique,
use case technique and user story technique. All these techniques have been
explained in detail within the tutorial.
26.8M
607
Test cases
Test cases are created considering the specification of the requirements. These test
cases are generally created from working descriptions of the software including
requirements, design parameters, and other specifications. For the testing, the test
designer selects both positive test scenario by taking valid input values and adverse
test scenario by taking invalid input values to determine the correct output. Test cases
are mainly designed for functional testing but can also be used for non-functional
testing. Test cases are designed by the testing team, there is not any involvement of
the development team of software.
Techniques Used in Black Box Testing
Decision Decision Table Technique is a systematic approach where various
Table input combinations and their respective system behavior are
Technique captured in a tabular form. It is appropriate for the functions that
have a logical relationship between two and more than two inputs.
All-pair All-pair testing Technique is used to test all the possible discrete
Testing combinations of values. This combinational method is used for
Technique testing the application that uses checkbox input, radio button input,
list box, text box, etc.
Use Case Use case Technique used to identify the test cases from the
Technique beginning to the end of the system as per the usage of the system.
By using this technique, the test team creates a test scenario that
can exercise the entire software based on the functionality of each
function from start to end.
Verification Validation
It includes checking documents, It includes testing and validating
design, codes and programs. the actual product.
It consists of checking of
It consists of execution of program
documents/files and is performed
and is performed by computer.
by human.