Slidings 8 + 9 - Junit Test Framework Flashcards

1
Q

Constructive Approach (Ansatz)

A

“Whenever you are tempted to type something into a print statement or a
debugger expression, write it as a test instead.”

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

Requirements for a Unit Test Framework

A
  1. Simple and suitable for programmers
    ● No unnecessary effort
    ● No new language!
  2. Automated test execution
    ● Regression testing anytime and efficiently
    ● Integration in automated build-processes
  3. High Reuse (Hohe Wiederverwendung)
    ● Existing tests should be used to create new ones
    ● Extending a test suite should be easily possible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Concepts

A

Test class
● contains all test methods and all lifecycle methods

Test method
● implements a test case and especially the expected/actual-comparison

Lifecycle method
● Set-up: prepares the precondition
● Tear-down: cleans up after the execution

Suite
● aggregates many test classes

Runner
● executes a single test class or a test suite 

Result
● contains statistic information about the tests (number etc.)
● contains information about tests detecting an error/failure

Failure
● contains information for every test that fails

Error
● indicates, that a test case has been terminated unexpectedly

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

Testing

A

Activity in which a system or component is executed under specified conditions, the results are observed or recorded, and an evaluation is made of some aspect of the system or component
- Testing is the process of executing a program with the intent of finding errors.

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

What is not a test?

A

● any kind of program inspection

● program demonstration

● program analysis by means of software tools

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

What is a Successful Test?

A

● Detect errors!

● A test (case) is successful, if it discovers an error!

● A test is never a proof for a correct program!
-> It has just found no errors!

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

Classification - Systematics

A

Trial run
● Developer compiles, binds and starts the program
● Eventually the program can be executed
● Results are not obviously wrong

Throw-away Test
● Somebody provides input data and executes the program
● Sometimes errors are discovered

Systematic Test
● The test data (test input data and expected results) is systematically derived from the specification/test model
● The program is executed
● The actual results are compared again the expected results
● The test process is documented (test item, test data,
actual results)

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

Classification – Unit under Test (UuT)

A

● Unit Test

● Component Test

● System Test

● Integration Test

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

Acceptance Testing

A

● Examines a system/ a component against defined
acceptance criteria
- User Acceptance Test
- Operational Acceptance Test
● The goal is not to discover errors!
- It should be shown, that the system fulfills the given
criteria, i.e., it works in all tested cases

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

Difference: Alpha and Beta Testing

A

● Alpha testing is done by the development organization

● Beta testing is done by selected special customers

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

Test Case Selection

A

● Black-Box Testing (functional testing)
->Design based on the specification

● Glass-Box Testing (structural testing)
-> aka white-box testing
-> Design based on internal structure
-> Specification is needed, too (to determine the
expected results)

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

Exhaustive Test

A

There are x alternatives to execute a program and all x alternatives are tested.
–> This is only feasible in rare cases (in seltenen fällen)

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

Advantages of Tests

A
  1. Testing is a natural examination process!
  2. Tests are reproducible! (→ objective)
  3. The invested effort is reusable several times!
  4. The target environment is also tested!
  5. System behavior is made visible!
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Drawbacks

A
  1. Results are often overrated! (no correctness statement)
  2. Not all program properties can be tested!
  3. Not all application situations can be simulated!
  4. The test does not show the defect
How well did you know this?
1
Not at all
2
3
4
5
Perfectly