Week 3 & 4 Flashcards

1
Q

What is software testing

A

process of evaluating a software solution to ensure it behaves as expected

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

What is a bug

A

a bug or defect is a fault of either errors in software or hardware causing a 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
ensuring quality
validating requirements
improving user experience

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

With proper testing can we ensure no bugs

A

Nah bro, shit isn’t that simple
can never be 100% but using proper testing methodology we can get close.

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

What is Test Driven Development

A

TDD is a development approach where test are written before any implementation of code.

First plan how you can verify you results meets a goal before any UML , source code etc.

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

what is the cycle involved in TDD

A

Red green refactor cycle

red = write a failing test, it will fail initially because of no code.

green = implement minimal code to pass the test

refactor = improve design, readability, maintainability etc while making tests cases still pass.

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

Which methodology does TDD fall under

A

It is iterative
after code is refactored, cycle repeats adding more test cases

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

TDD pros

A

improved code quality - write modular and readable code

reduced bugs - continuously testing and catching early

faster feedback - rapid feedback and address issues faster

better documentation - tests serve as documentation by showing intended behaviour and examples of usage

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

wie se testcase

A

particular choice of input and expected output

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

whats a test

A

finite collection of test cases

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

What is white box testing

A

Testing the internal structure, design and code
done by dev team - need to understand the code and algorithms

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

What is black box testing

A

testing the system from perspective of end users
done by end users

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

so we cannot completely test systems, so how do we test.

A

basically that correct behaviour on critical parts represent correct behaviour on untested parts.

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

is acceptance tests white or black? hehe

A

its black box
don’t need to understand working of code

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

What are the broad testing seen in a logical organisation of testing

A

Unit testing
Integration testing
system testing

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

Unit testing?

A

smallest possible parts of a system are tested individually and independently

white

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

what is integration testing

A

Testing how components of a system interact with each other

white

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

what is system testing and its 4 applications

A

System testing involves testing the entire system

white
Functional testing
Quality testing - non functional stuff

black
Acceptance testing
Installation testing - works when deployed

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

what is coverage

A

helps us measure the degree of which the software program is tested

Test coverage - specification testing like acceptance tests

Code coverage - testing code like unit tests

20
Q

Do all tests weigh the same

A

No, testing can be prioritised because some tests can likely reveal more faults than others

21
Q

What are some testing techniques to achieving high coverage

A

Black
equivalence testing
boundary testing

white
control flow testing
state based testing

22
Q

what is equivalence testing

A

dividing possible inputs into equivalence groups such that the program is expected to behave the same with inputs from the same group

we can do this because we assume we dont have shit programmers like muzzi that hard code for inputs. So mistakes likely affect a whole class of input values

e,g. input must be a 4 digit so we split < > = 4
we have valid and invalid groups

23
Q

what is boundary testing

A

special case of equivalence testing where we test the boundary values of ranges.
e.g we code for mark between 0 and 100 but input like 101 cooks us.

24
Q

what is control flow testing

A

we draw flow graphs representing the logic of the code

nodes = statements
edges = transitions between statements

these graphs help us measure coverage

25
Q

what types of coverage can we measure with control flow testing

A

Statement coverage - every statement run at least once

Edge coverage - every branch is traversed at least once

Condition coverage - every condition tested with true or false at least once

Path coverage - every distinct path through the program traversed at least once

NB 100% statement coverage does not mean 100% edge coverage as we might have if statement. with it always true you get statement coverage but since not tested when false its not full edge coverage.

26
Q

What is state based testing

A

testing software by defining a set of abstract states and checking if it behaves as expected when changing between states

components include:
States - condition of object attributes
Events - input given to system
Actions - the output following an event
Transitions - change in states
Guard - condition associated with a even which determines if a transition is triggered or not

27
Q

types of state based coverage

A

event coverage - every event tested
state coverage - every state visited
action coverage - every action triggered

28
Q

what are control faults

A

refers to errors in control flow logic

missing or incorrect transitions
missing or incorrect actions
sneak path - event is accepted when it shouldn’t
trap door - accepting undefined events
deadlocks - permanent blocking of system

29
Q

How do we unit testing with regards to testing it in isolation

A

This is done by creating mock objects

Test driver - simulates part of a system to invoke operation on the unit such as calling the function

Test stub - simulates parts of the system that the unit needs to interact with.

30
Q

what’s the convention for naming test cases

A

method name _ starting state _ expected result
e.g. checkKey_anyState_invalidKeyRejected()

31
Q

what are assert statments

A

using in unit testing
assertTrue(4 == (2 * 2));
assertEquals(expected, actual);

32
Q

What are the different types of Integration testing

A

Big bang
Top down
Bottom up
Sandwich

33
Q

What is big bang integration testing and why we shouldn’t dala

A

Where all units are linked at once and test

Faults only identified after whole system is implemented
might miss bugs and hard to isolate them
hard to ensure all cases are tested

34
Q

What is bottom up testing

A

lowest level subsystems tested first and integrated components only tested once what it relies on is tested.

35
Q

Bottom up pros and cons

A

Pros:
dont need stubs
disjoint systems can be tested simultaneously
lower level operations are usually critical to higher level ones so testing that first is usually a priority

Cons:
Drivers are needed
Some higher level components like UI can be the source of many bugs and thus found late.
if you have alot of lower level components, bottom up can almost seem like big bang

36
Q

what is top down testing

A

highest levels are tested first and work it way down

37
Q

Top down Pros and Cons

A

Pros:
no need for drivers
easier to write functional requirement test cases
can deal with major design flaws earlier

Cons:
alot of stubs needed
low level can only be tested once higher level are implemented

38
Q

What is sandwich testing

A

combination of top down and bottom up

39
Q

Sandwich Pros and Cons

A

Pros:
low and high level tested simultaneously
easier to test larger systems

Cons:
Can be expensive
Need more devs, drivers and stubs
Not suitable for systems with highly independent subsystems as this approach may force these parts to be tested together even tho they are not relevant to each other

40
Q

What is front end component testing

A

Involves testing components of UI like buttons, drop downs and other elements in ISOLATION.

41
Q

what type of testing does front-end component testing encompass

A

Unit
Integration
Snapshot - comparing rendered component output to detect UI changes
End-to-End - testing whole app from user view
Accessibility - people with disabilities
Visual regression - detecting unintended visual changes
Performance testing- responsiveness and efficiency
Component Storybook - way to render and test UI features in isolation

42
Q

What is horizontal integration testing

A

focuses on testing layers of a system with new layers incrementally added to the last
e.g. top down, bottom up, sandwich

43
Q

what is vertical integration testing

A

focuses on testing user stories, so testing components needs for a particular user story

44
Q

What is continuous integration

A

Continuous Integration (CI) is a software development practice where developers frequently integrate or add their code changes to a shared repository (usually multiple times a day).
Builds and tests are automated to ensure it works

45
Q

what are types of quality testing

A

stress testing - bots to moer servers load
volume testing - big data
compatibility testing - older versions of software
Timing testing - response time
Security testing - attempt to hack
recovery testing - responding to erros, lack of data, handling restarts and loadshedding cut offs etc.

46
Q

alpha vs beta testing

A

alpha is acceptance testing done in developer environment where beta is done in target environment.