Chapter 6 - Testing Flashcards

1
Q

Name types of testing

A

Verification: have we built the software right? Validation: have we built the right software?

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

What kind of testing levels are there?

A

Unit tests: testing of classes or components (whitebox tests), Integration tests: testing the interaction of components, System test: end-to-end and use-case testing, functional tests: along use cases (black box test)

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

what kind of “test procedures” are there?

A

regression testing (menge an unit tests durchführen um zu sehen ob system funktioniert) / production testing (fkt. software im produktiven umfeld?) / performance testing / acceptance testing

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

Testing in practice?

A

testing is not taken seriously, testing of code that has been written days/weeks/months ago is difficult / manual testing is expensive

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

How can testing be improved?

A

write production code and test code together, run test every day, practice test-driven-development (test is written prior to implementing a class)

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

What is JUnit?

A

environment for writing test cases

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

What are the fixture keywords in JUnit?

A

@Before and @After are called before/after each test, @BeforeClass and @AfterClass are called one for each test class (e.g. initiate components)

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

How should the Code Layout for Testing look like?

A

either put test code in separate packages (problem: no access to package private variables and methods) or put test code in same package (problem: no clear separation)

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

How can Testability be improved?

A

class interface must support testing, isolate classes which are to be tested, write small and focused methods, avoid global mutable states, avoid deep inheritance, information hiding and encapusulation (spagat zwischen hiding und testing: unit tests möchten vieles internes wissen)

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

What are Mocks?

A

mocks are objects pre-programmed with expectations which form a specification of the calls they are expected to receive, verify correct method calls (number and order of calls)

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

What is a Stub?

A

simulates and verifies a state

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

How can user interfaces be tested?

A

functional tests - test cases are based on use cases

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

What are Automated Tests and their impacts?

A

short-term: code quality, confidence in code and productivity (less debugging) / long-term: system is viable and its possible to do radical changes / refactorings

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