Unit Testing
In this chapter, we will discuss the Software Development Lifecycle (SDLC) and the role that testing has in it.
Updated
SDLC
- SDLC (Novice): The five phases of the software development lifecycle (requirements, design, code, test, deploy), and how Agile and test-driven development change their order.
Unit Testing
- Unit Testing: an overview (Novice): What a unit test is, and why small classes with clear responsibilities can be tested on their own.
- JUnit Testing Framework (Apprentice): JUnit gives you a ready-made test runner, and you write one test class for each class you want to test.
- Planning Unit Tests (Apprentice): Plan unit tests from the requirements as a list of scenarios, each with its pre-conditions, inputs, expected output and expected property values.
- Adding Test Classes (Apprentice): Add the JUnit dependency to pom.xml, then let IntelliJ generate a test class for the class you want to test.
- Writing Tests (Apprentice): Write a JUnit test by marking it with @Test, giving it a descriptive name, and laying it out as Arrange, Act, Assert.