Software Testing Previous QSN Solv
Software Testing Previous QSN Solv
1(a).Define graph. Write down the set representation of the graph mentioned in Figure-1. 2.0
Answer: Any Graph G(N, N0, Nf, E), can be defined as-
– A set N of nodes, N is not empty
– A set N0 of initial nodes, N0 is not empty and 𝑁0 ⊆ 𝑁
– A set Nf of final nodes, Nf is not empty and 𝑁𝑓 ⊆ 𝑁
– A set E of edges, each edge from one node to another ( ni, nj ), where i is predecessor, j
is successor and E ⊆ 𝑁𝑥𝑁
(b). Draw the control flow graph for each of the following code snippet. 3.0
Answer:
(c). Define detour and def-clear path with appropriate example. 2.0
Answer: Tour With Detours : A test path p tours subpath q with detours iff every node in q is also in p in
the same order.
1
def-clear path:A path from li to lj is def-clear with respect to variable v
if v is not given another value on any of the nodes or edges in the path
2.
2
Failure: A static defect in the software
Mutation Testing: Mutation Testing is a type of white box testing in which the source code of one of the program is
changed and verifies whether the existing test cases can identify these defects in the system.
The change in the program source code is very minimal so that it does not impact the entire application, only the
specific area having the impact and the related test cases should able to identify those errors in the system.
Happy path testing: The objective of Happy Path Testing is to test an application successfully on a positive flow.
It does not look for negative or error conditions.
The focus is only on the valid and positive inputs through which application generates the expected output.
Stress testing: This testing is done when a system is stressed beyond its specifications in order to check how and
when it fails.
This is performed under heavy load like putting large number beyond storage capacity, complex database queries,
continuous input to the system or database load.
Regression testing: Testing an application as a whole for the modification in any module or functionality is termed
as Regression Testing.
It is difficult to cover all the system in Regression Testing, so typically Automation Testing Tools are used for these
types of testing.
(b). Give a comparison between functional testing and non-functional testing. 3.0
Functional testing verifies each function/feature of the software whereas Non Functional testing verifies non-
functional aspects like performance, usability, reliability, etc.
Functional testing can be done manually whereas Non Functional testing is hard to perform manually.
Functional testing is based on customer’s requirements whereas Non Functional testing is based on customer’s
expectations.
Functional testing has a goal to validate software actions whereas Non Functional testing has a goal to validate
the performance of the software.
A Functional Testing example is to check the login functionality whereas a Non Functional testing example is
to check the dashboard should load in 2 seconds.
Functional describes what the product does whereas Non Functional describes how the product works.
Functional testing is performed before the non-functional testing.
(c). With necessary diagram briefly describe the software testing V-Model. 4.0
Answer:
3
1.The requirements analysis phase of software development captures the customer’s needs.
Acceptance testing is designed to determine whether the completed software in fact meets these needs. In other
words, acceptance testing probes whether the software does what the users want.
– Acceptance testing must involve users or other individuals who have strong domain knowledge.
2.The architectural design phase of software development chooses components and connectors that together realize a
system whose specification is intended to meet the previously identified requirements.
System testing is designed to determine whether the assembled system meets its specifications. It assumes that
the pieces work individually, and asks if the system works as a whole.
– This level of testing usually looks for design and specification problems.
– It is a very expensive place to find lower-level faults and is usually not done by the
programmers, but by a separate testing team
3. The subsystem design phase of software development specifies the structure and behavior of subsystems, each of
which is intended to satisfy some function in the overall architecture. Often, the subsystems are adaptations of
previously developed software.
Integration testing is designed to assess whether the interfaces between modules (defined below) in a
subsystem have consistent assumptions and communicate correctly.
– Integration testing must assume that modules work correctly.
– Most software development organizations make module testing the responsibility of the
programmer; hence the common term developer testing.
5.Implementation is the phase of software development that actually produces code. A program unit, or procedure, is
one or more contiguous program statements, with a name that other parts of the software use to call it.
– Units are called functions in C and C++, procedures or functions in Ada, methods in Java, and
subroutines in Fortran.
Unit testing is designed to assess the units produced by the implementation phase and is the “lowest” level of
testing.
– As with module testing, most software development organizations make unit testing the responsibility
of the programmer, again, often called developer testing.
3.(a). Define input domain. Write down the properties of domain partitioning. 1.5
Answer: The input domain for a program contains all the possible inputs to that program.For even small programs, the
input domain is so large that it might as well be infinite
Properties of Partitions:
If the partitions are not complete or disjoint, that means the partitions have not been considered
carefully enough
They should be reviewed carefully, like any design
Different alternatives should be considered
We model the input domain in five steps …
4
o Steps 1 and 2 move us from the implementation abstraction level to the design abstraction
level (from chapter 2)
o Steps 3 & 4 are entirely at the design abstraction level
o Step 5 brings us back down to the implementation abstraction level
(b). Define Coverage Criteria. Write down the advantages of Input Space Partitioning. 1.5
Answer: Coverage criteria. To measure what percentage of code has been exercised by a test suite, one or more
coverage criteria are used. Coverage criteria are usually defined as rules or requirements, which a test suite needs to
satisfy.
advantages of Input Space Partitioning:
Can be equally applied at several levels of testing
o Unit
o Integration
o System
Relatively easy to apply with no automation
Easy to adjust the procedure to get more or fewer tests
No implementation knowledge is needed
o Just the input space
5
Answer:
6
(d). Briefly describe the five steps of input domain modeling. 4.0
Answer: Step 1 : Identify testable functions
o Individual methods have one testable function
o Methods in a class often have the same characteristics
o Programs have more complicated characteristics—modeling documents such as UML can be used to
design characteristics
o Systems of integrated hardware and software components can use devices, operating systems, hardware
platforms, browsers, etc.
Step 2 : Find all the parameters
o Often fairly straightforward, even mechanical
o Important to be complete
o Methods : Parameters and state (non-local) variables used
o Components : Parameters to methods and state variables
o System : All inputs, including files and databases
Step 3 : Model the input domain
o The domain is scoped by the parameters
o The structure is defined in terms of characteristics
o Each characteristic is partitioned into sets of blocks
o Each block represents a set of values
o This is the most creative design step in using ISP
Step 4 : Apply a test criterion to choose combinations of values
o A test input has a value for each parameter
o One block for each characteristic
o Choosing all combinations is usually infeasible
o Coverage criteria allow subsets to be chosen
Step 5 : Refine combinations of blocks into test inputs
o Choose appropriate values from each block
4.(a). Define Logic Coverage. Write down the sources of logic expressions and predicates. 2.5
Answer: Logic corresponds to the internal structure of the code and this testing is adopted for safety-critical
applications such as softwares used in aviation industry. This Test verifies the subset of the total number of truth
assignments to the expressions.
7
8
c) Give a comparison between CACC and RACC.
Answer:CACC:
A more recent interpretation
Implicitly allows minor clauses to have different values
Explicitly satisfies (subsumes) predicate coverage
RACC:
This has been a common interpretation by aviation developers
RACC often leads to infeasible test requirements
There is no logical reason for such a restriction
9
Spring-2020
Answer:
10
2. Exhaustive testing is not possible
3. Early testing
4. Defect clustering
5. Pesticide paradox
6. Testing is context-dependent
7. Absence of errors fallacy
Answer: Coverage criteria gives structured, practical ways to search the input space. Satisfying a coverage criterion
gives a tester some amount of confidence in two crucial goals: Search the input space thoroughly Not much overlap
in the tests
MDTD Activities:
1. Test Design – Test design can be further broken into two categories:
Criteria-based: Design test values to satisfy coverage criteria or other engineering goal. It
requires the knowledge of –
- Discrete math
– Programming
Human-based: Design test values based on domain knowledge of the program and human
knowledge of testing. Criteria based approaches can be blind to special situations. It requires
knowledge of –
- Domain
11
- Testing
– UI
2. Test Automation – Embed test values into executable scripts. Its slightly less technical, requires knowledge of
programming, but very little theory. It often requires observability and controllability to solve difficult problems.
3. Test Execution – Run tests on the software and record the results. Its easy and can be automated. Requires basic
computer skills.
4. Test Evaluation – Evaluate results of testing and report to developers. Requires knowledge of:
- Domain
- Testing
- UI
- Psychology
It does not require any traditional CS.
12
(a)(b).Answer:
13
14
(c). Answer: Predicate Coverage (PC) : For each p in P, TR contains two requirements: p evaluates to true, and
p evaluates to false.
Combinatorial Coverage (CoC) : For each p in P, TR has test requirements for the clauses in Cp to
evaluate to each possible combination of truth values.
Answer:
15
16
Node Coverage (NC) : Test set T satisfies node coverage on graph G iff for every syntactically
reachable node n in N, there is some path p in path(T) such that p visits n.
1
2
3
Prime Path : A simple path that does not appear as a proper subpath of any other simple path
Test Path : A path that starts at an initial node and ends at a final node
17
T-wise Coverage: A value from each block for each group of t characteristics must be combined. For example, if
there are 3 blocks with 3 characteristics, and we specify the ‘t’ to be 3, then t-wise coverage would be = 3*3*3 = 27.
Fall-2020
2.(b).
18
2.(d)
19
3.
20