Demonstration project showcasing comprehensive code quality practices:
- 100% Test Coverage with JaCoCo
- DRY (Don't Repeat Yourself)
- KISS (Keep It Simple, Stupid)
- SOLID Principles
- BDD (Behavior-Driven Development) with Cucumber
- DSL (Domain-Specific Language) patterns
This project follows the Codev SPIDER-SOLO methodology for context-driven development.
Current Phase: Phase 1 - Foundation ✅
- Java 10+ (JDK 10 or higher)
- Maven 3.8+
# Clone the repository
git clone <repository-url>
cd java_10
# Build the project
mvn clean install
# Run tests
mvn test
# Compile only
mvn compilejava_10/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/example/demo/
│ │ │ └── HelloWorld.java
│ │ └── resources/
│ └── test/
│ ├── java/
│ │ ├── com/example/demo/
│ │ │ └── HelloWorldTest.java
│ │ └── steps/ # BDD step definitions (Phase 5)
│ └── resources/
│ └── features/ # BDD feature files (Phase 5)
├── codev/
│ ├── specs/ # Specifications
│ ├── plans/ # Implementation plans
│ └── reviews/ # Reviews and lessons learned
├── pom.xml
├── README.md
└── .gitignore
# Run all tests
mvn test
# Run tests with detailed output
mvn test -DtrimStackTrace=false
# Run specific test class
mvn test -Dtest=HelloWorldTest
# Run specific test method
mvn test -Dtest=HelloWorldTest#shouldGreetWithProvidedName- Maven project structure
- Java 10 configuration
- JUnit 5 for testing
- AssertJ for fluent assertions
- Example code with comprehensive tests
- Phase 2: JaCoCo coverage (100% enforcement)
- Phase 3: Static analysis (Checkstyle, PMD, SpotBugs)
- Phase 4: SOLID validation (ArchUnit)
- Phase 5: BDD framework (Cucumber)
- Phase 6: DSL development
- Phase 7: CI/CD integration
- Phase 8: Documentation and training
HelloWorld greeter = new HelloWorld();
String greeting = greeter.greet("World");
// Returns: "Hello, World!"The project includes comprehensive tests demonstrating:
- Positive test cases: Valid inputs
- Negative test cases: Invalid inputs (null, empty, blank)
- Edge cases: Single character, long names, special characters
- Parameterized tests: Multiple test cases with different data
- BDD-style naming: Clear, descriptive test names
- Fluent assertions: AssertJ DSL for readable assertions
Example test:
@Test
@DisplayName("Should greet with provided name")
void shouldGreetWithProvidedName() {
// Given
String name = "World";
// When
String result = helloWorld.greet(name);
// Then
assertThat(result)
.as("Greeting should contain the name")
.isEqualTo("Hello, World!");
}# Clean build artifacts
mvn clean
# Compile source code
mvn compile
# Run tests
mvn test
# Package JAR
mvn package
# Install to local repository
mvn install
# Full clean build and install
mvn clean install
# Skip tests (not recommended!)
mvn install -DskipTestsFollowing Codev SPIDER-SOLO protocol:
- Specification: Define requirements in
codev/specs/ - Planning: Create implementation plan in
codev/plans/ - IDE Loop: Implement, Defend (test), Evaluate
- Review: Document lessons learned in
codev/reviews/
- Code duplication target: < 3%
- Reusable utilities and helpers
- Shared test fixtures and builders
- Cyclomatic complexity: < 10 per method
- Clear, descriptive naming
- Single responsibility per method/class
- Single Responsibility: Each class has one reason to change
- Open/Closed: Open for extension, closed for modification
- Liskov Substitution: Subtypes substitutable for base types
- Interface Segregation: No unused interface dependencies
- Dependency Inversion: Depend on abstractions
- Write specification in
codev/specs/ - Create implementation plan in
codev/plans/ - Implement with tests (100% coverage required)
- Run all quality checks
- Create pull request
- Document review in
codev/reviews/
[Specify your license here]
For questions or issues, please refer to the project documentation in the codev/ directory.