TESTING Flashcards

1
Q

What is Testing?

A
  • Google says “Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test.”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What testing cant do?

Hints: (Prove bug-free, Try all conditions)

A
  • Prove the software is entirely bug-free
    o Certain bugs may only arise in certain situations.
    o Possible test data could be too large.
  • Try all conditions the software might encounter
    o Sometimes difficult to trial in intended working environment.
    o Users might try to find new uses for the software which were not originally considered.
    o User errors could be difficult to predict.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some things that can go wrong?

A
  • Magnetic/electrical interference
  • Memory corruption by other programs
  • Network problems/data corruption
  • Hardware faults
    o Modern hardware is incredibly reliable
    o However, safety-critical systems still compensate for the fact it may occur
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Test Driven Development?

A
  • TDD is an alternative approach to programming.
  • It comes from the agile software development methodologies.
  • It is very different to the traditional, waterfall, approach where testing occurs after code is completed.

There are three phases

  • Write a test (which will fail as there is no code to test) – the red phase.
  • Write code to pass this test – the green phase.
  • Refactor (rename, adjust, etc.)

The idea is that you write the tests before writing the code
- Think of the test as the formal specification.

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

What TDD can’t do?

A
  • TDD is no quick fix for a poor specification.
  • TDD can help you write code which meets the existing specification.
  • However, it cannot find what is missing from the specification, hence there is still the need for system testing and acceptance testing by the customer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Junit test?

A
  • In general, in a test, we want to do some actions, then check that the system is in an expected state.
  • We do this by writing normal code, then using assert statements to test that the actual state matches the expected state.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly