Test Coverage Flashcards

1
Q

What is C0 in software testing?

A

C0 is a criterion in software testing that aims to find a set of test cases that traverse every node of the program at least once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the rationale of C0 testing?

A

The rationale of C0 testing is to guarantee that no line of code will be executed the first time after the code has been deployed and that any line of code has been executed at least once in a testing environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the goal of C0 testing?

A

The goal of C0 testing is to ensure that all nodes of the program are executed at least once, providing basic coverage of the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the significance of C0 testing?

A

C0 testing is significant because it helps to detect errors and bugs in the code and ensures that all parts of the code are executed at least once, thereby increasing the overall quality of the software product.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the limitations of C0 testing?

A

The limitations of C0 testing are that it only focuses on node coverage and does not take into account other factors such as data flow and control flow. Also, it may not be sufficient to ensure complete coverage of the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the program graph corresponding to a program?

A

The program graph corresponding to a program is denoted as G(Prog).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the execution of a program with the inputs of a test case correspond to?

A

The execution of a program with the inputs of a test case corresponds to one path through the program graph G(Prog).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does it mean for a test suite to “cover” certain elements of G(Prog)?

A

For a test suite to “cover” certain elements of G(Prog) means that these elements appear in one of the paths corresponding to the test cases from the test suite.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the definition of a minimal test suite for a test approach?

A

A test suite is called minimal for a test approach if there is no other test suite for this test approach that includes fewer test cases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Cp testing?

A

Cp testing is a type of testing in software engineering that aims to cover every branch of a program’s code. It involves finding a set of test cases that when executed, ensures that all branches in the program are covered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between C0 and Cp testing?

A

C0 testing aims to cover every node of a program while Cp testing focuses on every branch of the program’s code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does Cp testing guarantee code coverage?

A

Cp testing guarantees code coverage by ensuring that every branch of the program is executed at least once in a testing environment, thereby reducing the risk of undiscovered defects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a branch in a program graph?

A

In a program graph, a branch is an edge (a,b) where the graph contains another edge (a,c) with b != c.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the rationale behind testing for Cp?

A

The rationale behind Cp testing is to ensure that every possible execution path of the code has been executed at least once, which reduces the likelihood of undetected defects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Can there be multiple minimal test suites for Cp testing? Why or why not?

A

Yes, there can be multiple minimal test suites for Cp testing since a minimal test suite is one that cannot be reduced without losing branch coverage, and there may be multiple test suites that satisfy this condition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How is a branch identified in a program graph?

A

A branch in a program graph is identified as an edge (a,b) where the graph contains another edge (a,c) with b != c.

17
Q

What is the significance of testing for every branch in a program?

A

Testing for every branch in a program is significant because it ensures that all possible execution paths of the code have been executed at least once, reducing the likelihood of undiscovered defects and improving overall software quality.

18
Q

. What is the difference between branch coverage and statement coverage?

A

Branch coverage and statement coverage are two types of code coverage metrics used in software testing. Branch coverage measures the number of branches in a program that have been executed during testing, while statement coverage measures the percentage of statements in the code that have been executed during testing.

19
Q

How can Cp testing contribute to improving software quality?

A

Cp testing can contribute to improving software quality by identifying undiscovered defects that could lead to software failure or security breaches. By ensuring that every possible execution path of the code has been executed at least once, Cp testing increases the reliability and robustness of the software, reducing the risk of defects and improving overall quality.

20
Q

What is the approach when complete coverage is not possible during testing?

A

In such situations, along with a white box test suite, an argument is provided to justify why complete coverage is not possible. This argument could explain the reason for the impossibility of achieving coverage, such as an input that does not follow a specific path through the program graph. For instance, an argument can be made that it is impossible to cover a particular edge in the graph because the condition associated with the node always evaluates to false.

21
Q

What is the purpose of Ci(k) testing?

A

The purpose of Ci(k) testing is to find a set of test cases that ensure every loop in the program is not taken, taken 1 time, taken 2 times, and so on, up to k times.

22
Q

Why is it difficult to define Ci(k) on the graph level?

A

It is difficult to define Ci(k) on the graph level because it requires defining what is a control node and what is an exit node, which can be complex.

23
Q

What does testing for Ci(k) guarantee?

A

Testing for Ci(k) guarantees that no code repetition thanks to a loop will be executed the first time after the code has been deployed, and any code repetition thanks to a loop has been executed at least once in a testing environment.

24
Q

How is Ci(k) different from other types of testing such as C0 and Cp?

A

Ci(k) focuses specifically on testing loops in a program, whereas C0 and Cp are concerned with overall code coverage and branch coverage, respectively.

25
Q

What are some limitations of Ci(k) testing?

A

One limitation of Ci(k) testing is that it assumes the loops in the program will never be executed more than k times, which may not always be the case. Additionally, defining Ci(k) on the graph level can be complex.

26
Q

How can Ci(k) testing contribute to improving software quality?

A

By ensuring that every loop in the program is tested for different scenarios, Ci(k) testing can help to uncover potential bugs or issues that may arise when the loop is executed a certain number of times. This can ultimately lead to a higher quality software product.