question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[High Scores]: Improve Test Cases / Exercise for Mutability Discussions

See original GitHub issue

I just did this exercise in php and python and I think that the Python version would require some improvement. I would like to discuss if it makes sense and eventually contribute via PR.

explanations

When you jump in the exercise, the explanation are very small. the user faces 4 functions and without looking at the test I would have never understood what the last were about (https://github.com/exercism/python/blob/main/exercises/practice/high-scores/high_scores.py).

def latest(scores):
    pass

def personal_best(scores):
    pass

def personal_top_three(scores):
    pass

def latest_after_top_three(scores):
    pass

def scores_after_top_three(scores):
    pass

In some exercises there is a complete description of the tasks and in other the function objective is described in the docstring (or bot). Would it make sens to add this for this exercise?

latest_after_top_three and scores_after_top_three

I think these 2 functions are perfectly useless in Python. I actually validated the tests (https://github.com/exercism/python/blob/79515ffbee47c1cff2d625c363592b3d73357513/exercises/practice/high-scores/high_scores_test.py#L50) with the following:

def latest_after_top_three(scores):
    return latest(scores)

def scores_after_top_three(scores):
    return scores

From what I did in php I think that these function reflect the C like behavior where passing scores by reference in the latest or personal-top-three function could have altered the initial scores list.

So instead of having these functions, I think it would make more sense to test the scores variable after running personnal_top_three.

let me know what you think and more importantly let me know if I’lm wrong.

PS: As mentioned at the top of the issue I’m happy to contribute

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
BethanyGcommented, Apr 22, 2022

Closing, as #3013 and #3016 are merged.

1reaction
12rambaucommented, Nov 30, 2021

I think this exercise could be super useful for mutability, unfortunately, I’m swamped in webinars for work and preparation is so much time-consuming…

Thanks a lot for your PR and I agree we should leave it open, at some point I’ll have time to breath and work a PR for this exercice!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit Tests, How to Write Testable Code, and Why It Matters
We will discuss what makes code hard to test, which anti-patterns and bad practices we should avoid to improve testability, and what other...
Read more >
Multi-objective test suite optimization for detection and ...
Minimization of test cases has been done on the basis of statement coverage, branch coverage and diversity aware mutation adequacy criterion (D-criterion).
Read more >
How to Write Test Cases: The Ultimate Guide with Examples
You can use any encoding for defining the priority of a test. It is better to use any of the 3 levels, high,...
Read more >
11 Ways to Improve Software Testing through Planning, Work ...
This article will discuss the best practices of how to improve the software testing process and to increase the quality of your software ......
Read more >
What is Mutation Testing? (Example) - Guru99
The goal of Mutation Testing is to assess the quality of the test cases which should be robust enough to fail mutant code....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found