Week 3 Flashcards

(62 cards)

1
Q

What is Software
testing?

A

Software testing is the process of
evaluating a software solution to
ensure that it behaves as expected
and meets the specified
requirements.

It involves executing the software
under controlled conditions and
assessing its behavior to identify
any defects or bugs

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

Bugs?

A

A fault, also called a bug or a defect, is an
erroneous software or hardware element of a
system that can cause the system to fail

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

Why do we test?

A

Finding defects or bugs
Ensuring quality
Validating requirements
Improving user experience

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

Test-Driven Development, what is this

A

is a software development approach in which tests are written
before the actual implementation code

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

What are some core principles of TDD

A
  • Every step in the development process must
    start with a plan of how to verify that the result
    meets a goal
  • The developer should not create a software
    artifact (a system requirement, a UML diagram,
    or source code) unless they know how it will be
    tested

*the process is iterative too

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

TDD Steps: “Red-Green-Refactor” cycle Explain it

A

Write a failing test (Red): In this step, the developer writes a test case that specifies the desired behaviour or functionality of the code to be implemented. Since there is no implementation code yet, the test case will fail initially.

Write the minimal implementation code to pass the test (Green): In this step, the developer writes the minimum amount of code necessary to make the failing test pass. The focus is on writing code that fulfils the requirements of the test case without introducing unnecessary complexity or functionality.

Refactor the code (Refactor): After the test case passes, the developer refactors the code to
improve its design, readability, and maintainability while keeping all tests passing. This step
ensures that the codebase remains clean and well-structured as new functionality is added.

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

What are some benefits of TDD

A

Improved code quality
Reduced bugs
Faster feedback loop
Better documentatio

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

Define a fault

A

A defect or bug, is an erroneous hardware or software element of a system that can cause the system to fail

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

Define a test case

A

is a particular choice of input data to be used in
testing a program and the expected output or behaviour

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

Define testss

A

is a finite collection of test cases

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

Define White-box testing

A

exploits structure within the program (assumes code available)

The internal workings of the system are transparent to whoever is testing, perspective of an end user

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

Define Black-box testing

A

Explores input space of functionality defined by an interface specification

The internal workings of the system
are hidden from the tester

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

Integration test

A

Ensures that all components work together

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

function test

A

checks functional requirements

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

quality test

A

checks nonfunc reqirements

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

acceptance test

A

Customer checks ALL requirements
form of black-box testing

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

installation test

A

Testing in user environment

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

unit test

A

Ensures that each component works as specified

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

what makes up System Testing

A

Functional Testing
Quality Testing
Acceptance Testing
Installation Testing

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

what is coverage

A

measures the degree to which the specification or code of a
software program has been exercised by tests

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

Test Coverage AKA (Big picture):

A

Specification testing focuses on the coverage of the input space, without necessarily testing
each part of the software

ie Acceptance tests

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

Code Coverage (Implementation details):

A

Code coverage measures the degree to which the elements of the program
source code have been tested

ie Unit tests

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

Heuristics for achieving high coverage:

A

Black Box Testing
*equivalence testing
* boundary testing

White Box Testing
* control-flow testing
* state-based testing

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

What is Equivalence testing

A

is a black-box testing method
that divides the space of all possible inputs into
equivalence groups/classes such that the program
is expected to “behave the same” on each input from
the same group
* Assumption: A well-intentioned developer may have made
mistakes that affect a whole class of input values
* Assumption: We do not have any reason to believe that
the developer intentionally programmed special behavior
for any input combinations that belong to a single class of
input values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Heuristics for Finding Equivalence Classes
For range of values : one valid and two invalid classes For single value : one valid and two invalid classes For set of values : one valid and one invalid for Boolean: one valid and one invalid
26
what is Boundary Testing
is a special case of equivalence testing that focuses on the boundary values of input parameters
27
What is control flow testing
organises testing based on the control flow of the software Relies on understanding the code of the software (therefore white-box)
28
How do we measure the differnet types of code coverage with contorl flow testing
Statement coverage – every statement executed at least once by some test case * Edge coverage – every branch of the control flow is traversed at least once by some test case * Condition coverage – every condition takes TRUE and FALSE conditions at least once in some test case * Path coverage – every distinct path through the program has been traversed at least once in some test case
29
What is state based testing
defines a set of abstract states that a software unit (object) can take and tests the unit’s behavior by comparing its actual states to the expected states
30
State based testing is popular with what systems
Object oriented systems
31
how is the state of an obj defied
as a constraint on the values of its attributes
32
what are the state based testing components
State - a constraint on the values of an object's attributes Event - an input given to the system Action - the result that follows an event Transition - a change of state caused by an event Guard - A condition associated with an event which determines weather a transition is triggered or not
33
Types of state based coverage
Event coverage state coverage action coverage
34
what are control faults
In state based testing control faults refer to defects or errors in the control flow logic of the software that is undergoing testing. lead to incorrect transitions or improper handling
35
What are some common control faults
Missing transition – nothing happens with an event * Incorrect transition – resulting state is incorrect * Inconsistent State Transition - inconsistency can lead to non-deterministic behaviour, * Looping or Infinite State Transition – can lead to system being unresponsive * Missing or incorrect action – wrong thing happens on transition * Incorrect State Handling - Extra, missing or corrupt state * Sneak path – event is accepted when it shouldn’t be * Trap door – implementation accepts undefined events * Deadlocks and Livelocks - conflicting resource dependencies or synchronization issues. Deadlocks result in a permanent blocking of system resources, while livelocks involve the system continuously reattempting to make progress without success.
36
what is unit testing
the smallest possible part of a system – called a unit – is tested individually and independently Unit is sometimes called a fixture
37
Test driver
simulates a part of a system that invokes operations on the unit
38
test stub
simulates a part of a system that is called by the unit
39
how do you name a test case
methodnName_startState_expectedResult
40
different integration types
* Big bang integration * Top-down integration * Bottom-up integration * Sandwich integration Horizontal integration vertical integration
41
What is big bang integration
All units are linked at once and the entire system is tested
42
why does big bang integration suck
Faults can only be identified once the whole system is implemented * Very difficult to isolate bugs once they are detected * Highly probable that bugs will be missed in testing * Difficult to ensure that all cases are tested
43
What is bottom up testing
the lowest level subsystems are tested first. An integrated component can only be tested once the components it relies on are tested. relies on drivers to simulate top level execution
44
What are some of the pros /cons of bottom up testing
Pros: * No need to implement stubs * Disjoint subsystems can be tested simultaneously * Lower-level operations are usually critical to higher level components, so testing them first is usually a priority Cons: * Drivers are needed * Certain higher-level components (e.g. user interfaces) can be the source of many bugs * With many lower-level components, bottom-up integration can tend towards big bang integration
45
What is top down testing
highest level subsystems are tested first. An integrated component can only be tested once all components that invoke it are tested. Relies on stubs to simulate lower-level processes
46
Pros and Cons of top down integration
Pros: * No need to implement drivers * Easier to write test cases in terms of functional requirements * Can deal with major design flaws earlier in the process Cons: * Stubs are needed * Often lots of stubs * Lower-level functionality only really tested once higher-level components are implemented
47
What sandwich testing
combines top-down and bottom-up approaches. Testing converges on a target layer
48
What are the pros / cons of Sandwich integration
Pros: * Easier to test larger systems * Low- and high-level components tested simultaneously Cons: * Testing can be expensive * More developers, stubs and drivers * Is less suitable for architectures with highly independent subsystems
49
What is Front-end component testing
* Front-end component testing involves testing individual components of a user interface, such as buttons, forms, dropdowns, and other UI elements, in isolation to ensure they function correctly and meet the specified requirements. These tests are typically performed at the component level and focus on verifying the behavior, appearance, and interactions of individual UI elements.
50
what does front end component testing encomposes
* Unit Testing: Tests individual components in isolation, verifying their behavior and logic. * Integration Testing: Tests how components interact with each other within the application. * Snapshot Testing: Captures and compares rendered component output to detect UI changes. * End-to-End Testing: Tests the entire application from the user's perspective. * Component Storybook: Develops and documents components in isolation with a visual interface. * Accessibility Testing: Ensures components are usable by people with disabilities. * Visual Regression Testing: Compares component screenshots to detect unintended visual changes. * Performance Testing: Evaluates component responsiveness and efficiency.
51
what Horizontal Integration Testing
Assumes a hierarchical design Focuses on testing layers of a system, with new layers incrementally added to a test Examples: top-down, bottom-up and sandwich
52
what Vertical integration Testing
Focuses on testing scenarios or user stories Test all the components needed to realise a particular user story
53
What is continuous integration
Continuous Integration (CI) is a software development practice where code changes are frequently integrated into a shared repository, typically multiple times a day. Each integration triggers automated build and testing processes to detect and address integration errors as early as possible in the development lifecycle.
54
what does CI entail
* Running tests is a big part of continuous integration * Every time a new build is generated (see build automation): * Run unit tests on changed components * Run regression tests on unchanged components to ensure they still work as intended * Run integration tests on the system
55
what is Stress testing
test beyond the normal limits of a system . e.g using bots to push beyond
56
what is Volume testing
Test with large volumes of data
57
Compatibility testing
– test with older versions of software to ensure backwards compatibility
58
time testing
– test response times
59
Security testing
– attempt to violate software security, test how system responds
60
what is Recovery testing
– test how system responds to errors or lack of data etc.
61
* Degrees of acceptance testing
* Alpha Tests – client uses software in development environment; Developers on hand to fix issues * Beta Tests – conducted in production environment. Small subset of user base chosen to use system; Software gets a realistic workout in target environment
62