Class 5 - Continuous Integration & TDD Flashcards

1
Q

Stinky Fish Exercise

A

An exercise where team members share their individual concerns & worries about the future of the project as a way to start a conversation and begin to confront or overcome concerns

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

Continuous Integration (CI)

A

Developers regularly save, commit, pull, and push their code. An automated build occurs after which automated tests are run to assert code correctness before integration.

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

What is accomplished by saving, committing, pulling, and pushing often?

A

You are less likely to lose work or have to spend time merging two developer’s code

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

What is accomplished by running an automated build after every push?

A

You can quickly catch bugs that cause your code to not compile

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

What is accomplished by running automated tests after every push?

A

Automated tests give developers a better idea of the state of the codebase. They tell developers what functionalities are not working properly and what functionalities need to be worked on.

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

Continuous Delivery

A

Deploy app to staging environment after every push to ensure the app can be reliably released at any time. It is more comprehensive than continuous integration and it provides a more accurate picture of the current state of the codebase

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

Continuous Deployment

A

Same procedure as continuous delivery (push, build, run tests, deploy) with the caveat that the codebase is only deployed to production if all tests pass. Otherwise, a rollback occurs.

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

What is a potential benefit of continuous deployment

A

The development team is forced to write tests everyone REALLY believes in

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

Quality Assurance (QA)

A

Essentially, making sure your code works before something terrible happens

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

What are the different branches of QA?

A
  • Fault Avoidance (verification, reviews, configuration management)
  • Fault Detection (testing, debugging)
  • Fault Tolerance
  • Usability Testing (scenario testing, prototype testing, product testing)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

True or False: Testing is a proof of correctness

A

False. Testing can never completely identify all defects within a piece of software

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

Testing

A

The process of validating and verifying that a software program meets business and technical requirements. Testing is used to determine if software works as expected.

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

What are the five dimensions of testing?

A
  • Testers
  • Coverage
  • Potential Problems
  • Activities
  • Evaluation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Testers (Dimension of Testing)

A

Who does the testing. This includes developers and independent testers.

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

Coverage (Dimension of Testing)

A

What gets tested

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

Potential Problems (Dimension of Testing)

A

Why you’re testing

17
Q

Activities (Dimension of Testing)

A

How you test

18
Q

Evaluation (Dimension of Testing)

A

How to tell whether the test passed or failed

19
Q

What is the disadvantage of having developers test code?

A

Developers are too close to the code and understand it too well. Furthermore, they are often driven by delivery schedules and are busy fixing bugs

20
Q

What is the disadvantage of having independent testers test code?

A

It will take them some additional time to learn the system (since they did not write the codebase)

21
Q

What is needed to develop an effective test?

A
  • Detailed understanding of the system
  • Knowledge of testing techniques
  • Skill to apply testing techniques effectively and efficiently
22
Q

Why does testing require creativity?

A

Programmers have a tendency to stick to the data set that makes the program work (it is intuitive to them since they wrote the program). However, this strategy often does not cover all possible actions a user might take.

23
Q

What are the different types of tests?

A
  • UI tests
  • End-to-end tests (system tests)
  • Integration tests
  • Unit tests
24
Q

UI Tests

A

Simulates a user interacting with the application. Runs in either a real environment or an isolated full development environment

25
Q

End-to-end tests (system tests)

A

Tests the whole program at once. Runs in either a real environment or an isolated full development environment

26
Q

Integration tests

A

Tests involving multiple classes and modules working together. Runs in either a real environment or an isolated full development environment

27
Q

Unit tests

A

Tests a single class/method/function or even a single branch or conditional (if statement). Runs in the development environment.

28
Q

Runtime Assertions

A

A statement that is expected to always be true at the point in the code it appears. This allows programmers to catch problems early before they become bigger problems in production

29
Q

What is the downside of using runtime assertions

A

They can make code hard to read if not used carefully

30
Q

Order the different types of tests from most tests to lest tests in the codebase

A

Highest to lowest: Unit tests, integration tests, end-to-end tests, UI tests

31
Q

In what order do the different types of tests run?

A

First to last: Unit tests, integration tests, end-to-end tests, UI tests

32
Q

Order the different types of tests by the amount of code tested by 1 test

A

Highest to lowest: UI tests, end-to-end tests, integration tests, unit tests

33
Q

Test-Driven Development (TDD)

A
  1. Write test for functionality that does not exist
  2. Test fails (since no implementation has been provided)
  3. Write code to make the test pass
34
Q

What are the 3 rules of TDD?

A
  1. Do not write any production code until you have first written a test that fails due to the lack of that code
  2. Do not write more of a test than is sufficient to fail. Failing to compile counts as a failure
  3. Do not write more production code than is sufficient to pass the currently failing test