Week 6 - Testing and Build Management Flashcards
What is a unit?
Typically a single function or method
What is a good unit testing plan?
To have one test module/class per production module/class, which tests the public interface of the production class
What does the Arrange-Act-Assert Pattern divide tests into?
The arrange section
The act section
The assert section
What happens in the arrange section of the Arrange-Act-Assert Pattern?
You bring the system under test and its dependencies to a desired state
What happens in the act section of the Arrange-Act-Assert Pattern?
You can call functions/methods on the system under test, passing the prepared dependencies, and capturing the output value (if any)
What happens in the assert section of the Arrange-Act-Assert Pattern?
You verify the outcome. The outcome may be represented by the return value, the final state of the SUT and its collaborators, or the methods the SUT called on those collaborators
What does SUT stand for?
System Under Test
What are the phases of Test-Driven Development (TDD)?
Red, Green and Refactor
What does TDD stand for?
Test-Driven Development
Describe the red phase of TDD.
Write an automated test for some behaviour
Describe the green phase of TDD.
Write just enough code to pass the test
Describe the refactor phase of TDD.
Change the code so it becomes better
What is build management driven by?
Version control
What are the three benefits version control provides?
Change histories
Branching and merging
Traceability
What do change histories do?
Change histories make it possible to quickly and reliably get any version of a file