Testing Flashcards

1
Q

What is unit testing?

A

Unit testing is the testing method linked to “module design”. In other words, we test small modules - or blocks - of code in terms of correctness, typically at method, class or object level.

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

What is integration testing?

A

Integration testing is a testing method linked to “software design”. In other words, we test the software as a whole, and how well it runs.

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

What is system testing?

A

System testing is the testing method linked to “system analysis”. In other words, we test the system holding the server or application as a whole.

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

What is acceptance testing?

A

Acceptance testing is the testing method linked to “requirement analysis”. In other words, we make sure that the delivered system meets the user’s requirements and is ready for use in real time.

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

What is the V-Model approach to software development?

A

The V-Model is a model that links every development phase to a corresponding testing phase, to ensure that each aspect of the software is tested fully.

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

What is static testing?

A

Static testing is a category of testing where we assess documents - in other words, the files of the program.

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

What is dynamic testing?

A

Dynamic testing is a category of testing that involves executing program code.

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

What is white-box testing?

A

White-box testing is a subcategory of dynamic testing where we know the internals of the program, so we can test explicit paths through the system.

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

What is black-box testing?

A

Black-box testing is a subcategory of dynamic testing where we do not know the internals of the program, so we concern ourselves only with user experience and functionality.

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

What is grey-box testing?

A

Grey-box testing is a subcategory of dynamic testing where we know both the required functionality, and some of the implementation concepts, but without an exposed codebase like in white-box testing.

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

Why would we use black-box testing instead of white-box testing?

A

White-box testing can lead to programmer bias, and can cause a disconnect from the users we are developing the software for. Black-box testing can garner results that the programmer may not expect, or may be intentionally avoiding.

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

What is code coverage?

A

Code coverage refers to how much of the code has been tested, or the degree to which it has been tested, by looking directly at the static code files.

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

What is function coverage?

A

Function coverage refers to how many methods have been covered by testing.

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

What is statement coverage?

A

Statement coverage refers to how many lines have been covered by testing.

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

What is decision coverage?

A

Decision coverage refers to how many branches (if/else) have been covered by testing.

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

What is predicate coverage?

A

Predicate coverage refers to how many conditions have been covered by testing.

17
Q

What are corner cases?

A

Corner cases are cases used in testing where we give the method that is being tested the most extreme possible value - such as the largest integer able to be represented by the number of allocated bits.

18
Q

What is Right-BICEP?

A

Right-BICEP is an acronym for what areas of a unit we should test.

19
Q

What does Right-BICEP stand for?

A

Are the results right?
Are the boundary conditions correct?
Can you check inverse relationships?
Can you cross-check results using other means?
Can you force error conditions to occur?
Are the performance characteristics within bounds?

20
Q

What are the properties of a good test?

HINT: R, B, T, R, I, P

A

We need our tests to follow Right-BICEP, be automatic, thorough, repeatable, independent and professional.

21
Q

What is good practice for naming unit tests?

A

Unit tests should begin with “test”, along with the method name afterwards. If you need to add more context, feel free to either before or after.

Some places recommend adding context after test, but before the method name, separating the two with an underscore.

22
Q

What does fail(…) do?

A

fail(…) fails the unit test. Notifies the unit testing engine that something has gone wrong, and this test has failed.

23
Q

What does assertEquals(String msg, T expected, T actual)

A

assertEquals checks that the expected value is equal to the actual value. If it is not, it will send the message stored in msg to the unit testing engine and fail the test.

24
Q

When might we want to use mock (or dummy) objects?

A

When we want to test a class through a method it provides, but have some unpredictable extraneous variable that gives that method non-deterministic behaviour.

25
Q

How may we implement a mock object?

A

We use an interface to describe the non-deterministic variable. Then, we make our own implementation, and pass it in to our class.

26
Q

What is a test suite?

A

A test suite is a way for us to run multiple test classes in a single batch.

27
Q

How may we create a test suite?

A

We import org.junit.runners.Suite, then use the attribute @Suite.SuiteClasses to implement our separate test classes.

28
Q

What is an invariant?

A

An invariant is an assertion about our object that should not change. For example, ensuring an array’s index is >= 0.

29
Q

T/F: An object should (always/never) be viewed in an inconsistent state.

A

Never