I find TDD an excellent way of working, but there are times when one need to retrospectively implement tests for an existing code base in order to make further changes or maintenance possible. Achieving that with JSP had some intriguing challenges I wrote about in this DZone article. https://lnkd.in/da-_3gGe
Zoltán Csorba’s Post
More Relevant Posts
-
DAY 57/100 | Building Consistency 🏇 Showing up every day. Learning, growing, and improving. Ever wondered what pom.xml is used for in backend? 🤔 If you’ve worked on a Java #backend project, you’ve definitely seen this file sitting quietly in the root folder. That file belongs to Apache Maven — and it controls how your entire project is built. pom.xml (Project Object Model) is the backbone of dependency management in Java projects. Here’s what it actually does: 🔹 Defines your project details (name, version, packaging) 🔹 Manages dependencies like Spring Web, JPA, MySQL drivers 🔹 Controls build configuration 🔹 Uses plugins to compile, test, and run the application When working with Spring Boot, adding a dependency inside pom.xml automatically downloads and configures everything needed. No manual jar files. No messy setups. It’s not just a configuration file. It’s what makes large-scale backend development clean, scalable, and manageable. Understanding how Maven works changes how you look at backend architecture — it’s not only about writing APIs, but about structuring projects professionally. Going one level deeper every day. #Day56 #Java #SpringBoot #Maven #BackendDevelopment #SoftwareEngineering #LearningInPublic
To view or add a comment, sign in
-
-
"Claude Code Only Works on New Code" You’ve likely heard it before: developers getting amazing results when asking agents like Claude to build something from scratch, but having comparatively less success using it for "actual work", you know, that 10-plus-years-old Java monolith everything actually runs on. It doesn't have to be this way. The core issue is context. When you build something new, Claude is there from the first prompt. It understands every design decision because it made them. But when you drop Claude into a legacy codebase, that contextual knowledge is gone. Even worse, if you try to "fix" this by shoehorning your entire architecture into a single, top-level CLAUDE.md file, you’ll likely hit a wall, once that file exceeds ~200 lines, instruction reliability craters. The solution? Don't document your codebase all in one place! Instead, leave a trail of "breadcrumb" CLAUDE.md files throughout your directory structure. By scoping context files to specific modules or packages, they are only loaded when Claude is actually working in that section of the code. Here is a prompt to help Claude automate this organization for you: --- "Document everything you know about this project so that a new session of Claude Code can be productive immediately. Analyze and survey the entire project first to understand the architecture, purpose, and README. Create fine-grained context files scoped to the specific directories where they matter. Keep the main CLAUDE.md minimal. Include only a single-paragraph synopsis of the project goal. Define slash commands and skills for repeatable tasks to ensure new sessions follow established architectural and stylistic patterns. CRITICAL: Present a plan of the changes you intend to make before modifying any files." --- I also created a command version of this prompt, for usability. It has additional instructions to force Claude in creating skills (LI post limits wouldn't allow to show entire prompt). You can find this command, along with a helpful hook, in a cleaner format on GitHub here: https://lnkd.in/gGk6hR4Y
To view or add a comment, sign in
-
-
I built a Spring Initializr terminal UI with Java. If you're like me and find yourself living in the terminal, switching to a browser just to scaffold a new Spring project breaks your flow. So I built a TUI (terminal user interface) that brings Spring Initializr right into your terminal. In this video I walk through how to build one from scratch, beginner-friendly. You'll see how Java can power solid terminal interfaces, not just backend services. https://lnkd.in/gnxJFq6c
To view or add a comment, sign in
-
A couple of weeks back, our team delved into an intriguing investigation concerning the prevalent languages employed by companies for crafting test automation solutions. Among the top contenders in our exploration were Java and TypeScript. Java stands...
To view or add a comment, sign in
-
🔍 Ever opened a Spring Boot project and felt overwhelmed by the file layout? Let's fix that today. When you generate a project via Spring Initializr, you get a carefully designed structure — and every single file has a purpose. Understanding it is foundational to writing clean, maintainable code. Here's what matters most: src/ ├── main/ │ ├── java/com/example/app/ │ │ └── AppApplication.java ← Entry point │ └── resources/ │ ├── application.properties ← Config │ ├── static/ ← CSS, JS, images │ └── templates/ ← Thymeleaf views └── test/ └── java/com/example/app/ ← Test classes pom.xml ← Dependencies & build The src/main/java folder is where your business logic lives — controllers, services, repositories. The resources/ folder holds configuration and static assets. And pom.xml is the brain of your build. Pro tip: Keep your package structure mirroring your domain (e.g., controller/, service/, repository/, model/) — it makes navigation effortless and follows the Single Responsibility #Java #SpringBoot #BackendDevelopment #SoftwareEngineering #Programming
To view or add a comment, sign in
-
✨🪄 Day 40 of 90 – Java Backend Development 🔥☄️ JUnit is a popular unit testing framework for Java used to test individual components (methods/classes) of an application. It helps developers verify that their code works correctly by writing automated test cases. JUnit is widely used in Java Backend Development, especially in frameworks like Spring Boot, where testing controllers, services, and repositories is very important. 👉 Why JUnit is important? i)Ensures code correctness ii) Prevents bugs during refactoring iii) Supports Test-Driven Development (TDD) iv) Improves code quality. v) Used in real-time industry projects. 👉 Key features of JUnit i) Test Annotations – @Test, @BeforeEach, @AfterEach ii) Assertions – assertEquals(), assertTrue(), assertNotNull() iii) Test Suites – Group multiple test cases iv) Integration with Maven/Gradle v) Works with Mockito for mocking. 👉 Code Explanation: 👉 Original class: public class Calculator { public int add(int a, int b) { return a + b; } } 👉 Test class: import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class CalculatorTest { @Test void testAddition() { Calculator calculator = new Calculator(); int result = calculator.add(2, 3); assertEquals(5, result); } } Here: @Test tells JUnit this is a test method. assertEquals() checks if expected and actual values match. 👉Conclusion: JUnit is an essential framework in Java backend development that helps ensure your code works correctly through automated unit testing. Instead of testing Java’s built-in operations (like 2 + 3), proper unit testing focuses on validating your own business logic by calling methods from real classes and verifying their outputs using assertions. By writing meaningful test cases, developers improve code quality, prevent future bugs, support refactoring safely, and follow industry practices like Test-Driven Development (TDD). Mastering JUnit is crucial for building production-ready Spring Boot applications. #Junit #TestingMethodology #UnitTesting #BackendDevelopment
To view or add a comment, sign in
-
-
🚀 How to Kickstart a Spring Boot Project in Under 2 Minutes Every professional Java developer knows this secret weapon: Spring Initializr — the project scaffolding tool that eliminates boilerplate setup forever. Before Initializr existed, developers had to manually wire together Maven configs, dependency versions, and project structure. Now? Visit start.spring.io, make a few clicks, and you're coding in minutes. Here's what you configure upfront: ✅ Build tool → Maven or Gradle ✅ Language → Java / Kotlin / Groovy ✅ Boot version → Always pick latest stable ✅ Java version → 17 or 21 (LTS recommended) ✅ Dependencies → Web, JPA, Security, Actuator… The generated structure is clean and ready: src/main/java/ → Your application code src/main/resources/ → application.properties src/test/java/ → Test classes pom.xml → Dependency management mvnw / mvnw.cmd → Maven wrapper 💡 Pro tip: You don't even need a browser. Use IntelliJ's built-in wizard, VS Code Spring Extension, or a single curl command to generate the project directly from your terminal. The real magic? Each selected dependency auto-configures its entire stack — no XML hell, no manual wiring. #Java #SpringBoot #BackendDevelopment
To view or add a comment, sign in
-
Master error handling with Custom Exception. Learn when and how to create them for clearer, more robust and maintainable application code
To view or add a comment, sign in
-
Every Java/Kotlin project on Claude Code Web hits the same wall: java.net.UnknownHostException The sandbox routes traffic through an HTTP proxy. Tools like curl pick it up automatically — but Java's HttpURLConnection completely ignores https_proxy. Gradle can't resolve a single host. I built a Claude Code PreToolUse Hook that fixes this once and for all: ✅ Parses the proxy URL and writes ~/.gradle/gradle.properties with the correct JVM proxy settings ✅ Downloads the Gradle distribution and warms the dependency cache ✅ Runs before every Bash invocation but exits instantly in local environments — zero overhead ✅ Deterministic — unlike a CLAUDE.md instruction, a hook can't be forgotten or skipped If you're using Spring Boot, Kotlin, or any JVM project with Claude Code Web, drop this hook into .claude/hooks/ and it just works. Full writeup with the script and setup 👇 https://lnkd.in/gki-9D9G #ClaudeCode #Gradle #SpringBoot #Kotlin #DevTools #AI
To view or add a comment, sign in