Lab4 Entry Test Software Engineering

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/75

encourage image

There's no tags or description

Looks like no tags are added yet.

76 Terms

1
New cards

Unit testing

Testing level where

  • individual code units (functions or classes or a single class)

  • Return values of a single class can be checked.

  • are tested in isolation.


2
New cards

Integration testing

Testing level that

  • examines the interaction

  • between the distinct components of the system.


3
New cards

System testing

Testing level that

  • verifies the operation of the entire system.


4
New cards

Acceptance testing

Test performed

  • by the end user or client

  • to ensure the software meets business needs and requirements.


5
New cards

Regression testing

Re-running existing tests after a change ( bug-fix )

  • to check that working parts still work.


6
New cards

Performance testing

Non-functional test type that

  • checks speed

  • checks response time

  • checks behaviour under load.


7
New cards

Non-functional testing

Testing qualities such as

  • performance, usability or security

  • rather than what the system does.


8
New cards

Black-box testing

Test design technique:

  • test cases are derived

  • from the specification

  • without looking at the code.


9
New cards

White box testing

It is a test design technique

Test cases are derived from

  • the internal structure of the code;

  • measured with coverage.


10
New cards

Model-based testing

Test design technique:

  • Test cases are generated from a model of the system's behaviour

  • (e.g. a state machine).


11
New cards

Test suite

The collection of test cases that are executed together.

12
New cards

SUT

System Under Test:

  • the system which is being tested.


13
New cards

Test oracle

A method or principle that

  • helps the tester decide whether the test was successful.


14
New cards

Test case

A set of defined

  • input values

  • execution conditions and expected results

  • describing a single test for a specific goal.


15
New cards

Test verdict

The result of running a test:

  • pass, fail, error or inconclusive.


16
New cards

Tester

The person who designs, runs and evaluates the tests.

17
New cards

Mocking

Replacing a real dependency of the unit under test

with a fake object that imitates it,

so the unit can be tested in isolation.

18
New cards

Test driven development (TDD)

An approach where the tests are written

  • before the code

  • the code is then written to

make the tests pass.

19
New cards

Test coverage

The proportion of testable items

  • requirements

  • statements

  • decisions

that the tests have exercised.

20
New cards

Statement

A single instruction

  • assigning a value to a variable: int x = 10;


21
New cards

Block

A sequence of statements executed together,

foo = bar / 2;

++i;


22
New cards

Condition

A single boolean expression inside a decision

e.g. bar > 0

23
New cards

Decision

The boolean expression that controls the flow

e.g. if (foo < 10 && bar > 0);

It may contain several conditions and may have more than two outcomes.

e.g. switch


24
New cards

Branch

One possible path out of

  • a decision.

if (array[i] > max) {

max = array[i]; //

}


25
New cards

Statement coverage

Executed statements / total statements

(the number of tests is NOT in the formula).

26
New cards

Decision coverage

  • Decision outcomes taken / total decision outcomes;

  • JaCoCo calls it branch coverage.


27
New cards

100% statement coverage vs decision coverage

100% dec. coverage -→ 100% stat. coverage.

100% stat. coverage -/→ 100% dec. coverage.

28
New cards

100% statement coverage and branches

It guarantees coverage of

  • ALL NON-EMPTY branches,

  • but not of EMPTY branches.


29
New cards

Code coverage and requirements

It helps find

  • untested code

It cannot find

  • missing requirements.

because unimplemented requirements have no code.

30
New cards

Outcomes of an if (with or without else)

2 outcomes:

  • true and false


31
New cards

Outcomes of a switch

One outcome per case

plus the default.

32
New cards

Test verdict when the test runs and every assert evaluates to true

Pass

33
New cards

Test verdict when an assert evaluates to false

Fail

34
New cards

Test verdict:

  • the test cannot run properly

  • (e.g. an unexpected exception or a broken test environment)


Error

35
New cards

Test verdict when it cannot be decided whether the test passed or failed

Inconclusive

36
New cards

Testing level: checking how several components of the system work together

Integration testing

37
New cards

Testing level: verifying the operation of the entire system

System testing

38
New cards

Testing level:

  • the end user or client checks that the software meets the business needs


Acceptance testing

39
New cards

Test verdict vs. test oracle

One is the result of the test:

  • pass or fail.

Other is the method

  • used to decide the test.


40
New cards

Test suite

It is a collection of test cases that are executed together.

41
New cards

Where white-box vs. black-box test cases come from?

White-box testing derives test cases from

the internal structure of the code.

Black-box testing derives test cases from:

from the specification.

42
New cards

Coverage of a whole test suite

Take the UNION of everything covered by all tests divided by the total in the code;

  • do not add the tests' fractions together.


43
New cards

Structural element:

i < array.size()

Condition:

  • a logical expression without logical operators (and, or…).


44
New cards

Structural element:

if (array[i] > max)

{ max = array[i] } //

Branch:

  • one possible outcome of a decision

  • (the code entered after the if).


45
New cards

Is black-box testing only possible for integration testing?

Black-box test design is

  • NOT limited to integration testing.


46
New cards

Which testing strives to cover

  • every possible execution path?


Structure-based (white-box) testing, not black-box testing.

47
New cards

Is black-box testing just jargon for manually trying out the code?

  • It is a real test design technique:

  • Test cases are derived from the specification.


48
New cards

What is characteristic of black-box testing?

It is a specification-based technique.

49
New cards

Equivalence partitioning: how should invalid partitions be covered first?

In equivalence partitioning,

  • invalid partitions should

  • first be covered in separate tests, one at a time.


50
New cards

Equivalence partitioning: what happens if a test contains several invalid values?

If a test contains several invalid values,

they can mask each other's effect.

51
New cards

Why are invalid partitions tested one at a time?

Several invalid values in one test

  • can mask (cancel out) each other's effect.


52
New cards

Should ,nvalid partitions first be covered in separate tests?

Invalid partitions should first be covered in separate tests,

  • one at a time;

  • because several invalid values can mask each other's effect.


53
New cards

When should verification and validation activities start?

As early as possible: early verification and validation activities

  • reduces cost.


54
New cards

Do we test the software in agile development?

It includes

  • testing.


55
New cards

Can specification-based and structure-based test design techniques be differentiated?

  • Specification-based ( black-box testing )

  • Structure-based test design techniques ( white-box testing )

can be differentiated.

56
New cards

What do we do during static analysis?

We examine the product without executing it (e.g. review)

  • It is not about static variables.


57
New cards

Boundary value analysis

It examines

  • the boundaries of data partitions (equivalence classes);

  • it is NOT for increasing statement coverage.


58
New cards

How are equivalence classes defined?

Equivalence classes are

  • selected using heuristics;

  • they are not always defined automatically, algorithmically.


59
New cards
Use cases and test cases (true statement)
Test cases can be derived from use cases.
60
New cards

100% statement coverage and errors (true statement)

With 100% statement coverage

  • you can NOT be sure that your code is error-free.


61
New cards
Is testing always a manual process? (true statement)
Testing is not always a manual process; tests can be automated.
62
New cards
100% statement coverage and system behaviours (true statement)
100% statement coverage does NOT mean that we have tested all possible behaviors of our system.
63
New cards
Typos and testing (true statement)
Testing can help to detect errors in software caused by typos.
64
New cards

Testing and correctness (true statement)

Testing can reveal errors,

  • but it can NOT be used to verify (prove) the correctness of the software.


65
New cards
How many test inputs do we choose from each equivalence class?
One: each equivalence class is represented by one test input.
66
New cards
Is black box testing specification-based or structure-based?
Black box testing is a specification-based technique.
67
New cards

What is SUT the abbreviation of?

System Under Test

68
New cards

Do we check the main path (happy path)?

  • A typical use-case test set has 1 test for the main path (happy path).


69
New cards

Tests from use cases: do we also test alternative paths that deviate from the main path?

  • There are separate tests for each alternative path.


70
New cards

Do we test what happens when the prerequisites are not met?

We DO test generally what happens when the prerequisites are not met.

71
New cards
Tests from use cases: at what level are they typically?
At a higher level: system testing, acceptance testing, etc.
72
New cards
Which statement is FALSE for tests derived from use cases?
'We do not usually check the so-called happy path.' (The happy path is always tested.)
73
New cards

Main difference between specification-based and structure-based testing

It is where the test cases come from:

  • the specification or the code's structure,

  • not the testing framework.


74
New cards

Code coverage measurement

Code coverage measurement can be useful

  • for identifying code sections that have not been tested yet.


75
New cards

Essence of equivalence classes

Inputs are split into classes expected

  • to cover the same faults

  • each class is represented by one test input

  • not one class is represented for every test.


76
New cards

Does specification-based testing replace structure-based testing?

Specification-based testing does not replace structure-based testing;

  • the two complement each other.