☕ B1 · Project Skeleton: Maven, spring-boot-starter-web
B1 · Project Skeleton: Maven: Setting up a Spring Boot project is like **fitting out a kitchen before opening a restaurant**: before cooking a single dish (endpoint) you prepare
Setting up a Spring Boot project is like **fitting out a kitchen before opening a restaurant**: before cooking a single dish (endpoint) you prepare the stove, counter, and electricity (web server, dependencies, run mechanism). `spring-boot-starter-web` is a "starter pack" — you add one dependency line and behind it come an embedded Tomcat server, a JSON converter (Jackson), and the whole web stack. But why use a "starter" instead of adding each piece by hand? Because manually matching compatible versions (Tomcat X, Jackson Y, Spring Z) takes hours and one version clash crashes the whole app; the starter brings that compatible set in a single decision. Its meaning for a tester: even before the API does any "work", `mvn spring-boot:run` must bring it up and even an empty `/api/v1/bugs` should return a response — if setup is broken, no test can run. In QA the first "smoke test" is that the app starts without error and listens on a port; moving to functional tests before that passes is a waste of time.
Minimum Skeleton: pom.xml + Application Class
Micro Lab: Code practice
Replace the TODO line with the critical line from the expected solution. This is not a real runtime; the goal is to reinforce writing the correct structure in a controlled way.
Step by Step: Code practice
Identify goal and input
Complete the critical line
Check output or behavior
Read the error message as evidence
Order the code reading and verification flow.
**🐞 Defect Birth — if `spring-boot-starter-validation` is forgotten** **Code:** only `starter-web` was added to `pom.xml`, `starter-validation` is MISSING. **What happens:** in B6 you write `@Valid` with `@NotBlank`, but with no validation library on the classpath Spring SILENTLY ignores those annotations. A `POST /api/v1/bugs { "title": "" }` returns 201 instead of 400 and an empty-title bug is saved. **Why sneaky:** the code compiles, the app starts, `@Valid` sits there — no error. Only at runtime is "validation never fires" noticeable, and only if someone tries sending an empty title. **Where the tester catches it:** on the first negative test after setup — sending an empty `title` and getting 201 while expecting 400. It proves a "missing dependency causing a silent behavior change".
🎬 One Starter, a Whole Web Server: How Boot Starts Up
You add a single line to `pom.xml`: spring-boot-starter-web. What does this one decision bring behind it?
The starter brings an embedded Tomcat web server — no separate server to install and deploy, it lives inside the app.