Skip to content

Commit c50d228

Browse files
authored
docs: present Java algorithms reliability showcase (#69)
docs: present algorithms reliability showcase
1 parent 0f5bc19 commit c50d228

13 files changed

Lines changed: 103 additions & 136 deletions

File tree

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Feature request
3-
about: New kata, test strategy, or repository quality improvement
3+
about: New reference implementation, test strategy, or repository quality improvement
44
title: "[feat] "
55
labels: ["enhancement"]
66
assignees: ["krotname"]

.github/workflows/no-releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ jobs:
1919
steps:
2020
- name: Explain release policy
2121
run: |
22-
echo "::error title=No releases::CodewarsKataJava is a kata practice repository and does not publish GitHub releases or release tags. Use the regular CI workflow for validation."
22+
echo "::error title=No releases::JavaAlgorithmsShowcase publishes reference implementations without GitHub releases or release tags. Use the regular CI workflow for validation."
2323
echo "This workflow exists only to make accidental release or release-tag events visible."
2424
exit 1

.sonarcloud.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# SonarQube Cloud automatic analysis ignores sonar-project.properties.
2-
# These kata/algorithm files intentionally repeat contest-style I/O and setup patterns.
2+
# These source-derived algorithm files intentionally repeat contest-style I/O and setup patterns.
33
sonar.cpd.exclusions=src/main/java/algorithms/sprint1/SleightOfHand.java,src/main/java/algorithms/sprint8/PackedPrefix.java,src/main/java/algorithms/sprint2/Deque.java,src/main/java/algorithms/sprint6/DorogayaSet.java,src/main/java/algorithms/sprint8/Crib.java,src/main/java/algorithms/sprint6/WaterWorld.java,src/main/java/algorithms/sprint2/Calculator.java,src/main/java/algorithms/sprint7/EqualSums.java,src/main/java/algorithms/sprint1/Distances.java,src/main/java/algorithms/sprint7/LevenshteinDistance.java,src/main/java/algorithms/sprint5/PyramidSort.java,src/main/java/algorithms/sprint4/FindSystem.java,src/main/java/algorithms/sprint3/FastSort.java

ARCHITECTURE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Repository model
44

5-
- `src/main/java` contains production kata implementations grouped by family (`kyu3`, `kyu4`, `kyu5`, `kyu6`, `kyu7`, `leetcode`, `interview`, `coderun`, `other`, `transactions`).
5+
- `src/main/java` contains reference implementations grouped by engineering concern (`algorithms`, `transactions`, `common`) and by retained source provenance (`kyu3`, `kyu4`, `kyu5`, `kyu6`, `kyu7`, `leetcode`, `interview`, `coderun`, `other`).
66
- `src/test/java` mirrors the same package layout.
77
- `src/test/java/quality` contains suite-level entry points for local and CI review:
88
- `SmokeSuite` – fast baseline visibility of all unit tests.
@@ -14,7 +14,7 @@
1414
## Design principles used in this repo
1515

1616
- Deterministic API behavior where possible.
17-
- No mutable side effects in pure kata methods.
17+
- No mutable side effects in pure algorithm methods.
1818
- Input validation and boundary handling through explicit conditions.
1919
- Shared conventions and reviewability:
2020
- test classes are colocated with implementation packages;
@@ -29,7 +29,7 @@
2929
- **Security**: CodeQL workflow and Security policy in the repo root.
3030
- **Intentional static-analysis exceptions:** `config/checkstyle/suppressions.xml`
3131
documents generated smoke wrappers, while `config/spotbugs-exclude.xml` keeps
32-
Codewars-compatible public API names documented instead of hiding them in code.
32+
source-compatible public API names documented instead of hiding them in code.
3333

3434
## Future quality directions
3535

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Unreleased
44

5-
- Corrected boundary, overflow, validation, determinism and complexity defects across kata utilities.
5+
- Corrected boundary, overflow, validation, determinism and complexity defects across algorithm utilities.
66
- Hardened transaction validation and made returned status collections immutable.
77
- Replaced unbounded iteration in encryption and range-counting helpers with logarithmic algorithms.
88
- Made the generated smoke harness fail when every executable API path fails.
@@ -14,7 +14,7 @@
1414
## 1.1 - public quality hardening (2026-06-09)
1515

1616
- Added CI, static analysis, and dependency management updates for repository quality.
17-
- Standardized test strategy and introduced a shared smoke harness for kata classes.
17+
- Standardized test strategy and introduced a shared smoke harness for reference implementations.
1818
- Added dedicated integration tests for the transactions validation flow.
1919
- Expanded README with bilingual project guidance.
2020
- Added community/maintenance docs (`CONTRIBUTING`, `SECURITY`, `CODE_OF_CONDUCT`).
@@ -27,5 +27,5 @@
2727
- Added repository-level line-ending normalization with `.gitattributes`.
2828
- Expanded the meaningful test baseline to 455 tests across unit/smoke, integration and property categories.
2929
- Set enforced JaCoCo coverage gates to 70% line, branch and instruction coverage.
30-
- Reduced SpotBugs debt to zero reported findings with explicit compatibility exclusions for Codewars API names.
30+
- Reduced SpotBugs debt to zero reported findings with explicit exclusions for source-compatible API names.
3131
- Reduced PMD debt to zero reported findings by removing unused code/imports and simplifying safe expressions.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ Thank you for interest in this repository.
4141
- `mvn -B verify` runs the full quality stack: tests, coverage, checkstyle, PMD and SpotBugs.
4242
- CI enforces reproducible builds on Java 17 and 21.
4343
- Prefer explicit comments for non-obvious logic in complex methods.
44-
- If you touch static API in a kata class, keep test names meaningful and deterministic.
44+
- If you touch a source-compatible static API, keep test names meaningful and deterministic.

README.en.md

Lines changed: 43 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,71 @@
1-
# Codewars Solutions
1+
# Java Algorithms & Reliability Showcase
22

3-
[Russian](README.md)
3+
[Русская версия](README.md)
44

5+
Curated Java reference implementations for deterministic algorithms and stateful validation. The project demonstrates API design, edge-case handling, property-based testing, static analysis, and reproducible CI.
56

6-
This repository is a portfolio-grade Java kata workspace focused on deterministic algorithms, reproducible tests, visible quality workflows, readable production code, and bilingual project documentation.
7+
[![CI](https://github.com/krotname/JavaAlgorithmsShowcase/actions/workflows/maven.yml/badge.svg)](https://github.com/krotname/JavaAlgorithmsShowcase/actions/workflows/maven.yml)
8+
[![Quality Gates](https://github.com/krotname/JavaAlgorithmsShowcase/actions/workflows/quality.yml/badge.svg)](https://github.com/krotname/JavaAlgorithmsShowcase/actions/workflows/quality.yml)
9+
[![CodeQL](https://github.com/krotname/JavaAlgorithmsShowcase/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/krotname/JavaAlgorithmsShowcase/actions/workflows/codeql-analysis.yml)
10+
[![Coverage](https://codecov.io/gh/krotname/JavaAlgorithmsShowcase/branch/main/graph/badge.svg)](https://app.codecov.io/gh/krotname/JavaAlgorithmsShowcase)
11+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/krotname/JavaAlgorithmsShowcase/badge)](https://securityscorecards.dev/viewer/?uri=github.com/krotname/JavaAlgorithmsShowcase)
12+
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13151/badge)](https://www.bestpractices.dev/projects/13151)
13+
[![License: GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-0f8a16)](LICENSE)
14+
[![Java](https://img.shields.io/badge/Java-17%2B-007396.svg)](https://adoptium.net/)
15+
[![JUnit](https://img.shields.io/badge/JUnit-6-25A162.svg)](https://junit.org/)
16+
[![Maven](https://img.shields.io/badge/Maven-3.9%2B-C71A36.svg)](https://maven.apache.org/)
717

8-
## Why This Repository Exists
18+
![Java Algorithms & Reliability Showcase](docs/assets/project-icon.svg)
919

10-
- It demonstrates practical coding and test engineering from problem solving to delivery quality.
11-
- Solutions are organized by difficulty/source: kyu, LeetCode, interview, transactions, and other groups.
12-
- Static checks and tests are visible and runnable in one place.
20+
## Selected engineering components
1321

14-
## Repository Map
22+
| Component | Engineering problem | What it demonstrates |
23+
| --- | --- | --- |
24+
| [Transaction validation](src/main/java/transactions) | Ordered, stateful operations; cascading invalidation; balance and overflow boundaries | Deterministic state transitions, immutable results, integration scenarios |
25+
| [Algorithm utilities](src/main/java/algorithms) | Boundary conditions, complexity, stream and file I/O | Deterministic APIs, explicit complexity tradeoffs, edge cases, and property-based invariants |
26+
| [Parsing / validation](src/main/java/common/SafeParse.java) | Malformed numeric and text input | Explicit contracts, preserved exception causality, unit tests, and static analysis |
1527

16-
- `src/main/java` - production solutions and domain classes.
17-
- `src/test/java` - tests and quality suites:
18-
- `quality.SmokeSuite` for unit/smoke tests.
19-
- `quality.IntegrationSuite` for transaction scenario tests.
20-
- `quality.PropertySuite` for curated property-based tests.
21-
- `.github` - CI workflows, Dependabot, and repository templates.
22-
- `ARCHITECTURE.md` - architectural and reviewability notes.
23-
- `CHANGELOG.md`, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`, `TESTING.md` - project governance.
28+
This is an engineering demonstration repository, not a commercial product. Implementations are selected to make code quality, test strategy, and the development process directly reviewable.
2429

25-
## Testing Strategy
30+
## Verification strategy
2631

27-
- Smoke/unit tests cover each kata directly and are grouped by `quality.SmokeSuite`.
28-
- Integration tests cover transaction validation state and ordering through `quality.IntegrationSuite`.
29-
- Property-based tests are grouped in `quality.PropertySuite`.
30-
- UI tests are not applicable because this repository has no UI layer.
31-
- Static quality gates include Checkstyle, PMD, and SpotBugs in Maven verify.
32-
- JaCoCo fails `mvn verify` below 70% line, branch, or instruction coverage.
32+
- **Smoke / unit:** baseline contracts for public APIs.
33+
- **Integration:** transaction state and ordering, plus algorithm CLI contracts.
34+
- **Property-based (jqwik):** invariants over broad generated input sets.
35+
- **Static analysis:** Checkstyle, PMD, and SpotBugs with a zero-new-violation baseline.
36+
- **Coverage:** JaCoCo fails `mvn verify` below 70% line, branch, or instruction coverage.
37+
- **Security:** CodeQL, dependency review, and OpenSSF Scorecard.
38+
- **Reproducibility:** Java 17/21 CI and a strict offline Windows gate after Maven cache priming.
3339

34-
## CI and Quality Signals
35-
36-
- `.github/workflows/maven.yml` runs category jobs on JDK 21 and full `mvn verify` on JDK 17 and 21.
37-
- The same workflow validates the strict offline PowerShell gate on Windows after an explicit dependency-prime step.
38-
- `.github/workflows/quality.yml` runs Checkstyle, PMD, and SpotBugs without executing tests.
39-
- `.github/workflows/codeql-analysis.yml` runs security analysis.
40-
- `.github/dependabot.yml` keeps dependency automation visible.
41-
42-
## Default Branch Governance
43-
44-
`main` intentionally uses lightweight branch governance. This is a personal educational kata journal where small solution, test, and explanation updates are often pushed directly to keep a fast practice loop. Public quality assurance comes from CI, CodeQL, quality gates, Dependabot, the Security Policy, and reproducible local commands. Substantive changes that affect kata behavior or quality policy still use the normal PR/review workflow.
45-
46-
The absence of branch protection on `main` is an intentional project-specific exception and should not be treated as a hardening defect.
47-
48-
## Local Run
40+
## Local verification
4941

5042
```bash
5143
mvn -B verify
52-
mvn -B test
5344
mvn -B test -Dgroups='smoke'
5445
mvn -B test -Dgroups='integration'
5546
mvn -B test -Dgroups='property'
5647
mvn -B -DskipTests checkstyle:check pmd:check spotbugs:check
57-
mvn -B test -Dtest='quality.SmokeSuite'
58-
mvn -B test -Dtest='quality.IntegrationSuite'
59-
mvn -B test -Dtest='quality.PropertySuite'
6048
```
6149

62-
Run the complete PowerShell gate without network access:
50+
Run the complete offline gate in PowerShell:
6351

6452
```powershell
6553
.\scripts\run-offline-gate.ps1
6654
```
6755

68-
See [`TESTING.md`](TESTING.md) for strict dependency-cache mode and the documented
69-
cached-JUnit fallback.
56+
See [TESTING.md](TESTING.md) for the complete test matrix and dependency-cache rules.
57+
58+
## Repository map
7059

71-
## Reviewer Checklist
60+
- `src/main/java/transactions` — stateful validation and its transaction domain model.
61+
- `src/main/java/algorithms` — sorting, graphs, dynamic programming, data structures, and CLI algorithms.
62+
- `src/main/java/common`, `interview`, `leetcode`, `coderun`, `other`, `kyu*` — utilities and implementations with provenance-preserving layout.
63+
- `src/test/java/quality` — entry points for smoke, integration, and property suites.
64+
- `.github/workflows` — CI, quality gates, CodeQL, dependency review, and supply-chain checks.
65+
- [ARCHITECTURE.md](ARCHITECTURE.md), [TESTING.md](TESTING.md), and [SECURITY.md](SECURITY.md) — architecture, test strategy, and security policy.
7266

73-
- No hidden mutation of test inputs inside algorithmic methods.
74-
- Meaningful method-level comments in non-obvious logic.
75-
- Deterministic edge-case handling in boundary tests.
76-
- Governance artifacts for maintainability and process.
67+
## Sources & provenance
7768

78-
## Local Quality Policy
69+
Problems and APIs come from several sources: Codewars, LeetCode, Yandex algorithm tracks, CodeRun, interview tasks, and standalone exercises. Links to original statements and compatible signatures remain in the code where they help verification.
7970

80-
- Use ASCII-only patch style unless a file already contains another script.
81-
- Keep public method behavior deterministic.
82-
- Add or adjust tests for changed branch behavior.
83-
- Keep comments close to complex algorithmic logic.
71+
The `kyu*` packages are retained as internal provenance and compatibility structure. They are not the project's primary taxonomy; the showcase is organized around engineering problems, contracts, and test strategy.

0 commit comments

Comments
 (0)