Lecture 3-Test driven development Flashcards

1
Q

What is a test-driven development(TDD)?

A

Software development process that relies on the repetition of a very short development cycle:
-requirements are turned into very specific test cases
-then the software is improved so that the tests pass

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

What is TDD opposed to?

A

Opposed to software development–> because it allows software to be added that is not proven to meet requirements.

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

What is the TDD algorithm?

A

1.Writing a failing test case
2.Get it to compile
3.Make it pass
4.Remove duplication
5.Make the test case pass, but not good in all cases
6.Write a failing test case
7.Get it to compile and make it pass

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

Why do TDD and Legacy code mesh well together?

A

We use TDD to EITHER write code or refactor. WE ARE NEVER DOING BOTH AT THE SAME TIME. –> This is valuable in legacy code because it lets use write new code independently of old code.After we write code, we can refactor to remove duplication between it and the old code.

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

What is the TDD legacy code algorithm?

A

1.Get the class you want to test
2.Write a failing test case
3.Get it to compile
4.Make it pass
5.Remove duplication
6.Repeat

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

What is a software test?

A

-A software test is a piece of software, which executes another piece of software.

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

State testing vs behaviour testing

A

State testing: It valides if that code results in the expected state.
Behaviour testing : It executes the expected sequence of events.

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

What are software unit tests?

A

Help with the developer to verify that the logic of a piece of the program is correct.

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

What is the structure of test approach(4)?

A

1.Setup
2.Run Test
3.Validate Results
4.Cleanup

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

What is the test of a TDD cycle? (6)

A

1.add a test
2.Run all tests and see if the new test fails
3. Write the code
4.Run tests
5.Refactor code
6.Repeat

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

TDD vs UAT

A

TDD: primarily a developer’s tool to help create well-written unit of code
UAT: communication tool between the customer, developer and tester to ensure that the requirements are correctly implemented.

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

What is JUnit?

A

-It’s a Unit testing framework for the Java programming language.
-Important in the develop ment of test-driven development.

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

How can we use JUnit in a TDD approach?

A

It can be used within a build pipeline for continuous integration.

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

Give an example of JUnit in Java

A

-JUnit as the testing framework
-Jenkins as the continuous integration server
-Git as a version control system.

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