Skip to content

London | 26-ITP-Jan | Angela McLeary | Sprint 3 | Coursework/sprint 3 implement and rewrite test#1031

Open
AngelaMcLeary wants to merge 9 commits intoCodeYourFuture:mainfrom
AngelaMcLeary:coursework/sprint-3-implement-and-rewrite
Open

London | 26-ITP-Jan | Angela McLeary | Sprint 3 | Coursework/sprint 3 implement and rewrite test#1031
AngelaMcLeary wants to merge 9 commits intoCodeYourFuture:mainfrom
AngelaMcLeary:coursework/sprint-3-implement-and-rewrite

Conversation

@AngelaMcLeary
Copy link

@AngelaMcLeary AngelaMcLeary commented Feb 23, 2026

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I developed an understanding of function scope and implemented Test-Driven Development (TDD) using Jest.

Questions

Why do we have to write so many validating cases?

@AngelaMcLeary AngelaMcLeary added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 23, 2026
@AngelaMcLeary AngelaMcLeary changed the title London | 26-ITP-Jan | Angela McLeary | Sprint 3 | Coursework/sprint 3 implement and rewrite London | 26-ITP-Jan | Angela McLeary | Sprint 3 | Coursework/sprint 3 implement and rewrite test Feb 23, 2026
@cjyuan cjyuan added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 4, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have to write so many validating cases?

Have you tried looking up the info or ask ChatGPT "Why is it important to prepare comprehensive tests in programming"?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 4, 2026
@AngelaMcLeary
Copy link
Author

Why do we have to write so many validating cases?

Have you tried looking up the info or ask ChatGPT "Why is it important to prepare comprehensive tests in programming"?

@cjyuan
Thank you for your suggestion.
Comprehensive tests are important in programming because they help ensure that software works correctly and reliably. They identify bugs early, check different scenarios (including edge cases), and prevent new changes from breaking existing features. Strong testing improves code quality, increases developer confidence, and makes programs easier to maintain.

@AngelaMcLeary AngelaMcLeary added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good! Well done!


test("should return false when absolute numerator is greater than or equal to absolute denominator", () => {
expect(isProperFraction(2, 1)).toEqual(false);
});
Copy link
Contributor

@cjyuan cjyuan Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test category is good.
To make the test more comprehensive, we could choose different combination of positive an negative values to test. For examples,

  expect(isProperFraction(2, 1)).toEqual(false);
  expect(isProperFraction(2, -1)).toEqual(false);
  expect(isProperFraction(-2, 1)).toEqual(false);
  expect(isProperFraction(-2, -1)).toEqual(false);

  expect(isProperFraction(2, 2)).toEqual(false);
  expect(isProperFraction(2, -2)).toEqual(false);
  expect(isProperFraction(-2, 2)).toEqual(false);
  expect(isProperFraction(-2, -2)).toEqual(false);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cjyuan Thank you. I will take note and make improvements in my future coding projects.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants