Software Testing - 10

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

1/37

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:34 PM on 4/11/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

38 Terms

1
New cards

What is Testing in this context?

Testing is the process of analyzing a software item to detect the differences between existing and required conditions (that is, bugs) and to evaluate the features of the software item.

2
New cards

Why is Software Testing important?

High-level goal: Ensure software behaves as intended

  • Software developers are humans

    • We all make mistakes

    • These mistakes can lead to faults/bugs in software

  • Testing helps us to identify and fix bugs!

    • Preventing a system from failure

    • Includes identification of security critical bugs (i.e., vulnerabilities)

3
New cards

Mistake

A human action that produces an incorrect result - synonym: Error

4
New cards

Fault

An imperfection or deficiency in a work product where it does not meet its requirements or specifications - Synonyms: Defect, Bug

5
New cards

Failure

An event in which a component or system does not perform a required function within specified limits.

6
New cards

What is the errors flow diagram?

knowt flashcard image
7
New cards

What are the four levels of testing?

knowt flashcard image
8
New cards

What is Unit Testing?

  • Tests functionality of basic building blocks (e.g, single functions)

  • Focuses on components in isolation

  • May include stubs or drivers to execute test

<ul><li><p>Tests functionality of basic building blocks (e.g, single functions) </p></li><li><p>Focuses on components in isolation </p></li><li><p>May include stubs or drivers to execute test</p></li></ul><p></p>
9
New cards

What is integration testing?

  • Tests functionality of building blocks when combined together

  • Focuses on interaction between components

  • Usually groups (unit tested) modules together following fixed strategies:

    • E.g, top-down, bottom-up, hybrid

<ul><li><p>Tests functionality of building blocks when combined together </p></li><li><p>Focuses on interaction between components </p></li><li><p>Usually groups (unit tested) modules together following fixed strategies: </p><ul><li><p>E.g, top-down, bottom-up, hybrid</p></li></ul></li></ul><p></p>
10
New cards

What is system testing?

  • Tests functionality of fully integrated system

  • Focuses on interaction between all components and the correctness of system as a whole

  • May be guided by requirement specifications

<ul><li><p>Tests functionality of fully integrated system </p></li><li><p>Focuses on interaction between all components and the correctness of system as a whole </p></li><li><p>May be guided by requirement specifications</p></li></ul><p></p>
11
New cards

What is acceptance testing?

  • Tests whether system fulfills acceptance criteria (e.g., requirement/specification)

  • May involve (end-)users of the system

  • Includes well-known testing types:

    • Alpha testing, beta testing

<ul><li><p>Tests whether system fulfills acceptance criteria (e.g., requirement/specification) </p></li><li><p>May involve (end-)users of the system </p></li><li><p>Includes well-known testing types:</p><ul><li><p>Alpha testing, beta testing</p></li></ul></li></ul><p></p>
12
New cards

What is a test type?

A group of test activities based on specific test objectives aimed at specific characteristics of a component or system

  • Focus on specific objectives and characteristics

    • While test levels focus on which parts of the system are tested

    • However: each level can also be seen as a test type

13
New cards

What are some example test types?

Regression tests, smoke tests, conformance tests, security tests

14
New cards

What are regression tests?

  • Tests to ensure that introduced changes do not cause new defects

    • These defects would be “regressions”

  • Most common method: re-run all tests after change

    • If not possible: selection of specific regression tests or prioritization of specific test cases

  • Does not assess correctness of new parts of the software!

15
New cards

What are smoke tests?

  • Non-exhaustive tests to assess main/critical functionality of the software

    • Usually early on in testing/development process

  • Used to determine if further testing should proceed

    • If smoke test fails, additional tests make likely no sense!

  • Examples:

    • Does the software start?

    • Can a user provide input?

16
New cards

What are conformance tests?

  • Tests to ensure that software behaves according to their respective standard/specification

    • Test cases itself may be standardized as well

    • May be part of certification process

    • Especially relevant for safety-critical systems

  • Example applications:

    • Compilers

    • Cellular Basebands

17
New cards

What are security tests?

  • Specialized tests to find security critical defects in the target software

    • May be carried out by 3rd-parties, rather than development team

  • Can focus on different types of security related bugs, for instance:

    • Logic bugs (e.g., authentication bypass, API misuse, etc.)

    • Configuration errors (e.g., use of weak ciphers, default credentials, etc)

    • Memory corruptions (e.g., stack-based buffer overflows, use-after-free, etc)

  • Examples:

    • Source code audits, fuzz testing, symbolic execution

18
New cards

Why do we do Test Automation?

Automating test execution and result analysis is highly beneficial - Most languages provide test automation frameworks

19
New cards

CI/CD

Continuous integration and deployment

Commonly used in modern software engineering

- Core ideas:

  • Merge changes frequently into a single mainline

  • Before merge, ensure functionality via automated tests

Examples are Github actions and gitlab runners

20
New cards

What is The “Box Model”?

Testing can be classified based on the information provided to the test/tester:

  • black-box

  • grey-box

  • white-box

21
New cards

What does the black-box mean?

- No information about the internal structure

- Tester observes input and output

22
New cards

What does the grey-box mean?

- Partial information about the internal structure

- Tester can create informed tests

23
New cards

What does the white-box mean?

- Full information about the internal structure

- Tester can leverage source code

24
New cards

What is static testing?

- Also called “off-line” testing

- Testing without execution

- Reasons about the code

- May create false-positives

25
New cards

What is dynamic testing?

- Also called “on-line” testing

- Testing by executing the target

- Observes the code’s behavior

- May not cover full program

26
New cards

What is test coverage?

Metrics to understand how complete given tests are

  • Provides insights which parts of a software are tested

27
New cards

What types of test coverage are there?

  • Requirement coverage (which of the requirements are tested?)

  • Compatibility coverage (which hardware/software targets is the target tested with?)

  • Code coverage (which parts of the code are tested?)

28
New cards

What is code coverage?

Useful metric for security testing

More code coverage == more parts of the system tested

29
New cards

What are the types of code coverage?

  • Function coverage

    • Which parts of the software are executed?

  • Line coverage

    • Which parts of the source code are executed?

  • Block coverage

    • Which parts of the machine code are executed?

  • Edge coverage

    • Which parts of the control flow graph are executed?

<ul><li><p>Function coverage </p><ul><li><p>Which parts of the software are executed? </p></li></ul></li><li><p>Line coverage </p><ul><li><p>Which parts of the source code are executed? </p></li></ul></li><li><p>Block coverage </p><ul><li><p>Which parts of the machine code are executed? </p></li></ul></li><li><p>Edge coverage </p><ul><li><p>Which parts of the control flow graph are executed?</p></li></ul></li></ul><p></p>
30
New cards
term image
knowt flashcard image
31
New cards

What are some limitations of code coverage?

  • Writing complete tests is not trivial!

  • Edge coverage most complete:

    • Function coverage may miss large parts of functionality

    • Line coverage assumes functionality isolated in individual lines

    • Block coverage does not track all transition

  • Code coverage may not give insights about data-dependent faults: - E.g., consider off-by-one errors in loops or the arguments to a strcpy call

32
New cards

What is Static Code Analysis?

Most common scenario: source code analysis - However, techniques for static binary code analysis exist as well!

Scales well to full programs - But may report many false positives

33
New cards

What is an example of static code analysis?

  • Example: Detecting vulnerable calls to APIs

    • Could be as simple as $ grep strcpy

    • Or using advanced tooling such as CodeQL [1]

<ul><li><p>Example: Detecting vulnerable calls to APIs </p><ul><li><p>Could be as simple as <code>$ grep strcpy</code> </p></li><li><p>Or using advanced tooling such as CodeQL [1]</p></li></ul></li></ul><p></p>
34
New cards

What is Taint Analysis?

  • Testing techniques which can be implemented both dynamically or statically

  • Aims to identify flow of user input throughout the program

    • And whether it can has security implications

  • Core idea:

    • Tagging user input and tracking (“tainting”) its use through the program

    • Check whether tainted values ever reach vulnerable functions (“sinks”) without prior sanitization

35
New cards

What is Fuzzing?

  • Executing the target program repeatedly with (pseudo-)random input

    • Mutate existing or generate new input for each run

  • Monitor program behaviour for crashes

    • Crashes demonstrate shortcomings (failures) of the target software

  • Fuzzing has been shown very effective for finding security vulnerabilities

    • We will have a deep dive next lecture

  • Scales well to full programs

    • But may miss substantial parts of the target

36
New cards

What is Symbolic Execution?

  • Instead of testing/executing the target with concrete inputs “execute” it with symbolic values

    • Goal: “Exploring” all states of a program

  • On each branch, collect constraints on inputs

    • If test case to reach a certain state is required, invoke a solver

37
New cards

What are the issues with symbolic execution?

- Scalability issues:

  • State/Path explosion

  • Constraint solving

38
New cards
<p>How does symbolic execution work on this code?</p>

How does symbolic execution work on this code?

knowt flashcard image