[test-improver] Add bug-pin tests for Project model (getProgress + getMemberIds)#68
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Conversation
Documents known bugs: - getProgress() returns NaN when taskCount == 0 (division by zero) - getMemberIds() throws NPE when members field is null - getMemberIds() throws NumberFormatException on whitespace-padded IDs Also documents safe/correct behaviour (valid inputs, trailing comma). 9 tests total; all pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Test Improver — automated AI assistant focused on improving tests.
Goal & Rationale
Projectis a core domain model used across controllers and services, yet had zero unit tests. Two of its methods have documented bugs that could silently break after refactoring:getProgress()taskCount == 0— returnsNaNinstead of0.0getMemberIds()membersisnull(field not set in constructor)getMemberIds()NumberFormatExceptionwhen IDs have whitespace padding (e.g."1, 2, 3")This PR pins those bugs so they cannot be silently swallowed by future changes.
Approach
Pure POJO unit tests — no Spring context, no H2, completes in ~60ms:
ProjectTest.javaassertThrowsto document currently broken behaviour with clear BUG messagesString.split(",")drops trailing empty tokens (not a bug — documented as safe behaviour)Coverage Impact
ProjectTrade-offs
assertThrowstests should be updated to verify the corrected behaviour.Reproducibility
Test Status
✅ All 9 new tests pass.
✅ No regressions — pre-existing failures (Bug #3 DateUtils, Bug #6 TaskService) are unchanged.
Add this agentic workflows to your repo
To install this agentic workflow, run