Quiz
QA final
This quiz has question types that open in the usual player.
Questions in this quiz (76)
1Statement coverage is a ___________ testing technique.
- ABlack box
- Bgrey box
- Cwhite box
2In statement coverage, we execute each statement _______________.
- Amore than once
- Bonce
- Cat least once
- Das few times as possible
3The formula to calculate the percentage of statement coverage is:
- A(# executed statements/all statements)
- B(# executed statements/all statements) *100
- C(# predicate statements / all statements)
- D(# predicate statements / all statements) *100
4Question #4 of 7
Missing statements are covered in statement coverage.- ATrue
- BFalse
5Basis path coverage explicitly identifies ______________.
- Adead code
- Bunused statements
- Cunused branches
- Dmissing statements
6The formula for cyclometric complexity is ___________.
- AE - N
- BE + N + 1
- CP + 1
- DP - N + 2
7Cyclomatic complexity is used to _____________.
- Adetermine missing statements
- Bdetermine the number of test cases required for path coverage
- Cdetermine the number of test cases required for branch coverage
- Ddetermine the number of test cases required for statement coverage
8Manual testing is better than automated testing
- ATrue
- BFalse
9Automation testing and manual testing
- Aare best used independently
- Bare best used together
10Manual testing is a _______ testing technique
- Awhite box
- Bgrey box
- CBlack box
11Releasing software relying solely on the automated tests is done by organizations whose software is
- Afocused on the user experience
- Bfar removed from user experience
12Releasing software relying solely on the automated tests is done by organizations that have
- Aa high level of confidence in their automated tests
- Ba high level of confidence in their manual tests
13Releasing software relying solely on the automated tests is done by organizations which
- Ahave very established automated testing practices
- Bare especially foolhardy
14Which of the following are testing techniques?
- Adesign by contract
- Bassertions
- Cclass invariants
- Dnone of the these
15Which of the following are debugging techniques?
- Adesign by contract
- Bassertions
- Cclass invariants
- Dall of these
16Which debugging technique documents the state change caused by code?
- Adesign by contract
- Bassertions
- Cclass invariants
17Which debugging technique avoids performance overhead?
- Adesign by contract
- Bassertions
- Cclass invariants
18Which debugging technique uses pre & postconditions as boolean expressions that must hold true?
- Adesign by contract
- Bassertions
- Cclass invariants
19Which debugging technique manipulates compiled byte code at run-time?
- Adesign by contract
- Bassertions
- Cclass invariants
20Which of the following are testing techniques?
- Adesign by contract
- Bassertions
- Cclass invariants
- Dall of the above
21Which of the following are debugging techniques?
- Adesign by contract
- Bassertions
- Cclass invariants
- Dall of the above
22Regression testing is a debugging technique
- ATrue
- BFalse
23Which of the following debugging techniques are similar?
- Adesign by contract
- Bassertions
- Cclass invariants
- Dall of the above
24Regression testing debugging technique is similar to class invariants technique
- ATrue
- BFalse
25An assertion is a
- Acontract
- Bpreconditions & postconditions
- Cinvariants
- Dsoftware construct
26Assertions are available in almost every programming language.
- ATrue
- BFalse
27Defects arise due to the browser / compiler / interpreter / OS /server / hardware / power supply / universe ___________
- Amost of the time
- Brarely
28Assertions are the _________ assumptions
- Ausers
- Bdevelopers
- Ctesters
29Which of the following can the developer's assumptions be incorrect?
- Apreconditions & postconditions
- Binvariants
- Cnone of the above
- DA (preconditions & postconditions) & B (invariants)
30The best practice for documenting assumptions is
- Arequirements
- Bcomments
- Cversion control
- Dassertions
31Assertions
- Aare boolean expressions
- Bare executed to test code
- Cencapsulates some testable logic
- Dall of the above
32If all assertions are true then there __________
- Aare some defects
- Bare zero defects
- Care zero defects unless the assumptions are incorrect
33Your software is developed using OOP, which debugging technique should you use?
- Adesign by contract
- Bassertions
- Cclass invariants
- Dregression testing
34What percentage of production code do assertions make up?
- Aapproximately 5%
- Bapproximately 10%
- Capproximately 25%
- Dapproximately 50%
35You need to assert even when you know this condition is always true.
- ATrue
- BFalse
36What's the biggest advantage of assertions?
- Amakes code fail early
- Bmakes code self-checking
- Ccan assign blame to cause
- Dexecutable documentation
37Disadvantages occur when an assertion contains an incorrect assumption
- ATrue
- BFalse
38What are the advantages of disabling assertions?
- Acode runs faster
- Bcode keeps going
- Call of the above
- Dnone of the above
39Julian Seward of Valgrind testing framework for C states that "it’s acceptable to spend 10% of the total running time doing assertion checks"
- ATrue
- BFalse
40Your software is being developed using OOP, which debugging technique should you use?
- Aassertions
- Bclass invariants
- Cregression
- Dall of the above
41Class invariants are an assertion type for objects
- ATrue
- BFalse
42Class invariants must hold for every observable point
- ATrue
- BFalse
43Assertions strengthen preconditions and postconditions
- ATrue
- BFalse
44Invariants are executable documentation
- ATrue
- BFalse
45Regression testing is done during which software testing level?
- ALevel 1: Unit Testing
- BLevel 2: Integration & Level 3: System Testing
- CLevel 4 Acceptance Testing
- Dall of the above
46Regression testing requires writing regression testing test cases
- ATrue
- BFalse
47Regression testing confirms that a recent code change has not adversely affected existing functionality through _____ selection of already executed test cases
- Afull
- Bpartial
- Call of the above
48Regression testing test cases are re-executed to ensure existing functionalities work
- ATrue
- BFalse
49Regression and re-testing are the same testing technique
- ATrue
- BFalse
50When is regression testing most relevant?
- ALevel 1: Unit testing
- BLevel 2: Integration testing
- CLevel 3: System testing
- DLevel 4: Acceptance test
51When is regression testing necessary?
- AChange in requirements
- BCode is modified
- CNew feature is added
- Dall of the above
52Which of the following are regression testing techniques?
- ARetest all
- BTest selection
- CTest case prioritization
- Dall of the above
53Which of the following are regressing testing tools?
- ARanorex Studio
- BSelenium
- CQTP
- Dall of the above
54Which of the following regressing testing tools supports automation frameworks?
- ARanorex Studio
- BSelenium
- CQTP
- Dall of the above
55White Box Testing Techniques
- AUnit / Component testing
- BControl flow coverage testing
- CStatement coverage testing
- DBranch coverage testing
- EPath & Basis Path coverage testing
56Statement Coverage
Execution of all executable statements in the source code at least once
Statement coverage = (Number of executed statements / total number of statements) X 100- ATrue
- BFalse
57What is covered by Statement Coverage?
Unused statements
Unused branches
Dead code
What is NOT covered by Statement Coverage?
Missing statements in the source code- ATrue
- BFalse
58Control Flow Coverage
depicts a program as a graph with nodes & edges
node represents an indivisible group of code statements
edge connects 2 nodes (If the 2nd statement might be executed immediately after the 1st statement)
nodes & edges are arranged to clearly indicate the following:
•Sequences
•Branches (if-then-else)
•Loops- ATrue
- BFalse
59Branch Coverage
Also called decision coverage
Execute all branches
Branches are outgoing edges of a decision point
Covers missing statements
Branch coverage = Number of executed branches / Total number of branches
100% Branch coverage implies 100% Statement coverage- ATrue
- BFalse
60Path Coverage
Also called structural testing
Execute every path at least once
Can we reduce the challenges & time required to perform Path Testing?
Reduce redundant tests & Achieve maximum test coverage
•By using basis path testing- ATrue
- BFalse
61Basis Path Coverage
Executes every path at least once
is same as path testing, except it defines test cases based on the flow or logical paths that can be taken
Independent path has at least one edge not traversed before in any other paths
How is basis path coverage different from path coverage?
Achieves maximum path coverage with least number of test cases by:
Defines the number of test cases, which are the number of independent paths
Maximizes the coverage of each test case- ATrue
- BFalse
62 Cyclomatic Complexity
metric determining the number of paths ie. maximum number of independent paths in the graph
Independent path - has at least one edge not traversed before in any other paths
Basis Set - a set of all independent paths of a program
How to reduce cyclomatic complexity?
1. Count the complexity of modules they develop
2. If the cyclomatic complexity of the module exceeded 10, then split them into smaller modules- ATrue
- BFalse
63Cyclomatic Complexity number meaning

- Athis one
- B2
64Basis Path Testing: guarantees execution of at least one statement during testing
Helps to reduce the redundant tests
Focuses attention on program logic
Helps facilitate analytical vs. arbitrary test case design- ATrue
- BFalse
65white box testing comparison

- Athis
- Ba
66Cyclomatic Complexity Formulas
V (G) = E - N + 2
Where,
G = a control flow graph
E = Number of edges
N = Number of Nodes
OR
V (G) = P + 1
Where,
G = a control flow graph
P = Number of predicate nodes (nodes that contain conditions)- ATrue
- BFalse
67Benefits of Manual Testing
- AIt’s simple and straightforward
- BIt’s cheap
- CIt’s easy to set up
- DNo additional s/w to learn, purchase, or write
- EIt’s extremely flexible
- FYou are more likely to test things you care about
- GHumans can catch issues that automated testing does not
68Drawbacks of Manual Testing
- AIt’s boring
- BIt’s often not repeatable
- CSome tasks are difficult, maybe impossible to test manually.
- DHuman error is a possibility
- EIt is extremely time and resource intensive
- FLimits you to black box and grey box testing
69Benefits of Automated Testing
- AThere is no chance of human error during test execution
- BTest execution is extremely fast
- CIt is easy to execute, once the system is set up
- DIt is easily repeatable
- EIt is simple to analyze the process
- FIt is less resource intensive
- GIt is ideal for testing some aspects of the system which
- Hmanual testing is bad at testing
- IIt scales very well
70Drawbacks of Automated Testing
- AIt requires extra setup time up front
- BIt may not be able to catch some user-facing defects
- CIt requires learning how to write automated tests, as well as additional tools and frameworks
- DIt requires more skilled staff
- EAutomated tests only test what they are looking for
- FTautological tests and other bad tests may creep in
71Design by Contract
• Design By Contract (DbC) is a SW correctness methodology
It documents the state change caused by code
• By using preconditions & postconditions
• boolean expressions that must hold true at certain execution points
The “client” & “supplier” agree on a “contract”- ATrue
- BFalse
72Design by Contract (continued)
preconditions (client obligations, supplier benefits)
postconditions (client benefits, supplier obligations)
invariants (general rules)
Example:
Bank account - transfer funds
• Refer to the Account.java class on SLATE
• Step 1: Identify the following to complete Step 2
• contract
• preconditions
• postconditions
• Step 2: Write methods for each of the above in Account.java
contract - transfer(Account from, Account to, double amount)
preconditions - amount > 0.00 & from.getBalance >= 0.00
postconditions - to.getBalance >= amount- ATrue
- BFalse
73Assertions & Assertion Testing
Documentation: requirements &/ comments
Assertions - write your assumptions as executable code
boolean expression at a specific point in a program which will be true unless there’s a defect / bug
Advantages of disabling assertions:
• Code runs faster
• Code keeps going
Disadvantages of disabling assertions:
• What if our code relies on a side-effecting assertion?
• Even in production code, may be better to fail early- ATrue
- BFalse
74Class Invariants
An assertion type that holds true for all objects
- always, no matter what other code does (Ex: Account balances must always be positive)
- must hold at every observable point (Ex: Every iteration)
• checked at beginning & end of every public method- ATrue
- BFalse
75Regression Testing
Testing to confirm that a recent code change has not adversely affected existing functionality
How is regression testing different from re-testing?
Re-testing: tests to ensure defect is fixed
Regression testing tests SW when code changes- ATrue
- BFalse
76Regression Testing Tools
1. Ranorex Studio - Includes a full IDE & tools for codeless automation
2. Selenium - Open source, used for browser-based regression testing
3. Quick Test Professional - Automate functional & regression test cases in VBScript- ATrue
- BFalse
Information
- Description
- Computer Science Quiz on QA final, created by Duncan Levings on 13/12/2021.
- Author
- Duncan Levings
- Language
- English
- Views
- 2
- Tags
- Rating
- No ratings yet Rate this quiz