Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better test. #397

Closed
wants to merge 3 commits into from
Closed

Conversation

wizzwizz4
Copy link

I wrote another test. This one's better than the existing one in several respects:

  • It's a fifth of the length (18 v.s. 3).
  • It's written entirely using descriptive variable names, including utility functions (excluding the one copied from Stack Overflow).
  • It can test an arbitrary number of Fizz Buzz cases.
  • It's entirely hand-written; no copying and pasting to be found (excluding from Stack Overflow).
  • Variable names make it clear where the values come from.
  • It favours conciseness over needless padding of line numbers; you get what you pay for.
  • It uses primitives wherever possible to save memory.
  • It favours clarity over conciseness; no one-letter variable names here (except from Stack Overflow).
  • It's consistent with previously-defined programming standards.
  • It's backwards-compatible.
  • I made sure to use the latest in programming techniques.
  • It's easy to follow, if you're a good, talented programmer.
  • It's platform-agnostic.

The addition of this test ensures that no cheating has occurred in the implementation of FizzBuzz. It hasn't so far (as demonstrated by the fact that this test succeeds) but might do in future; this will catch it when it's introduced, identify where it's introduced and identify the source of its introduction so you know who's responsible.

This test better emulates the process of a human scanning over the output manually, which is what automated tests are supposed to do, isn't it?

Better still, I've done this with only a three line test so it's easy to read!
The string constants aren't consistent, but I can sort that out in another Pull Request.
@emiln emiln closed this Jul 5, 2020
@emiln
Copy link
Member

emiln commented Jul 6, 2020

As a company we are deeply grateful for the many open source contributions we're receiving, but we can no longer in good faith support merge requests into the problematically named master branch, which has been removed.

Instead we hope that you will reopen your merge request and target the new default branch, artisanally crafted by our Swedish Inclusivity Consultant, called uinverse. You can read more about the inclusivity success story in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants