Testing Flashcards

1
Q

Why is testing early important?

A

The later that the bug is found… the more expensive it is.

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

Unit testing

A

Test a single unit of your program:

  • Typically: functions
  • Success cases, error cases
  • easy to automate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Integration testing

A

Test several units together

  • Several functions working together
  • Several modules/classes working together
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

System testing

A

Test the entire system

  • Use cases
  • Test case should cover a reasonable real-life scenario
  • Is the correct behaviour visible in the system
  • Tricky to automate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Acceptance testing

A

Test the entire system from a customers viewpoint

  • Use cases
  • Focus on visible functionality
  • What do I get back if i put in X?
  • Tricky to automate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What to test?

A
UI testing
User experience testing
Functional testing
Performance testing
Robustness testing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Test Driven Development TDD

A

Write tests before you write code

Forces you to think about input/output, behaviour and, error cases

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

Behaviour Driven Development

A

Write tests before you write code, but in a specific format “Given-When-Then”

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

HTML what to test?

A

W3C validator

Check that elements exist

Check that HTML functionality works

Mainly in system testing (with css and JS)

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

CSS what to test?

A

W3C validator

Check that elements have the right look (UI testing)

Check that responsive design works (resizing, media queries) (functional testing)

system testing with html and js

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

JavaScript what to test?

A

Unit tests

Integration tests

System/acceptance tests in combination with HTML and CSS

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

Mocha

A

Unit testing framework for JS

Requires some kind of assertion library

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

Chai

A

Assertion library that allows the TDD/BDD styles

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

mocha/chai syntax

A
describe('name of test suite' function () {
    it('name of test', function() {
        chai.expect(bla).to.equal(bla);
     }
})
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Mocha cleanup and preperations

A

Inside describe blocks there can be

before(function() {})

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

Mocha asynchronous functions

A

use a function(done) {
done();
}
callback function… otherwise it always passes…