Lecture 4 Flashcards

1
Q

What does testing a program consist of?

A

It consists of providing the program with a set of test inputs or test cases and observing if the program behaves as expected

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

What happens if the program fails to behave as expected?

A

The conditions under which failure occurs are noted for later debugging and correction

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

What is failure?

A

It is the manifestation of an error or bug. The mere presence of an error may not necessarily lead to a failure

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

What is a test case?

A

This is the ISO triplet, I is the data input to the system , S is the state of the system when the data is input and O is the expected output of the system.

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

What is a test suite?

A

The set of all test cases with which a given software product is to be tested, it tries to get all of the test cases from the equivalence classes

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

What is the aim of testing?

A

To identify all defects existing in a software product

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

Is it possible to guarantee that software is error free after testing?

A

No it is not possible to guarantee the software is error free because the input data domain of most software is very large and it isn’t practical to test them all.

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

Why is testing important?

A

It exposes many defects existing in a software product

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

What is the difference between verification and validation?

A

Verification is the process of checking whether a product or system meets specified requirements and standards, and is usually performed during the design and development phases before the product is released to market. Essentially are we building the product right?

Whereas validation takes place after verification and involves testing the product in real world scenarios to see how it behaves and performs. It ensures the product meets the needs of end users and satisfies all relevant quality criteria. Essentially did we build the right product?

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

Why is exhaustive testing of non trivial systems impractical?

A

Because the domain of input data values to most practical software systems is either extremely large or infinite.

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

Why must we design optimal test suites?

A

We must design optimal test suites of reasonable size so that we uncover as many errors existing in the system as possible

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

Is having a large collection of random test cases effective?

A

No it is not because it doesn’t guarantee that all or even most of the errors in the system will be uncovered. The test suite would have to be carefully designed to detect more errors.

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

What is the difference between functional testing and structural testing?

A

Functional testing is where test cases are designed using only the functional specification of the software for example black box testing where you test without any knowledge of the internal structure of the software.

Structural testing is where test cases are designed having thorough knowledge about the internal structure of software, for example white box testing

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

How do you perform black box testing?

A

You design the test cases from an examination of the input and output values only with no knowledge of the design or code.

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

Describe the two main approaches to designing black box test cases

A

Equivalence class partitioning and Boundary value analysis. Equivalence class partitioning is where the domain of input values to a program is partitioned into a set of equivalence classes. This partitioning is done such that the behaviour of the program is similar for every input data in the same equivalence class. The main idea is that testing with any one value in an equivalence class should be as good as testing with any other value in the same equivalence class.

Boundary value analysis is the selection of test cases at the boundaries of the different equivalence classes. This is done because programmers often fail to see the special processing required by the input values that lie at the boundary of the different equivalence classes. Using < instead of <=

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

What are the general guidelines for designing equivalence classes?

A

If the input values to a system can be specified by a range of values then one valid and two invalid equivalence classes should be defined.

If the input data assumes values from a set of discrete members of a domain then one equivalence class for valid input values and one for invalid input values should be defined.

17
Q

What is the difference between stronger and complementary testing?

A

Stronger testing is where the types of errors detected by a testing strategy are also detected by another testing strategy which also detects other types of errors. Complementary testing where the types of errors detected by a testing strategy are not detected by another testing strategy. They instead both detect different types of errors.

18
Q

What is code coverage?

A

An important unit testing metric which shows how effective unit tests are. It measures what percentage of source code would get executed while testing. If all of the code including branches, conditions or loops gets executed then it has complete coverage and code coverage is 100%.

19
Q

What is the formula for code coverage?

A

(No lines of code execute/ total lines of code) * 100

20
Q

What are the three methodologies of code coverage?

A

Statement coverage
Condition coverage
Branch coverage

21
Q

Describe each methodology of code coverage

A

Statement coverage is a measure that tells if all possible executable statements in source code have been executed at least once.

Condition coverage is a measure that ensures all conditions are evaluated for both true and false states.

Branch coverage aims at ensuring all branches appearing in each conditional structure gets executed in source code. E.g. is all the if statements and else statements get covered.