Skip to content

roman-numerals: make test failures easier to troubleshoot #160

Closed

Description

@jtigger

roman-numerals uses the JUnit Parameterized test runner. This was done to make the test more compact (and once you learn how the mechanism works, easier to read).

However, when a test fails, the error message does not indicate which value failed. This makes it really difficult to know why the test failed.

Test failures should clearly indicate what failed.

To Do:

  • ensure that this exercise is using JUnit 4.12 or later
  • add a format string to the @Parameters annotation.

(ref: #147)

Activity

  1. changed the title [-]roman-numerals: test failures are hard to troubleshoot[/-] [+]roman-numerals: make test failures easier to troubleshoot[/+] on Oct 30, 2016
  2. stkent commented on Nov 26, 2016

    @stkent
    Contributor
  3. bscharm commented on Nov 26, 2016

    @bscharm

    @jtigger is a more "documentation style" description preferred? or a more sentence style description? e.g.:

    @Parameters(name = "#getRomanNumeral() for RomanNumeral({0}) should return \"{1}\"")
    translates to:
    [#getRomanNumeral() for RomanNumeral(3) should return "III"]

    vs.

    @Parameters(name = "Roman Numeral representation of {0} is \"{1}\"")
    translates to:
    [Roman Numeral representation of 3 is "III"]

    EDIT:
    just saw @stkent comment...should descriptions indicate what the test is after as opposed to what it expects?

  4. jtigger commented on Nov 28, 2016

    @jtigger
    ContributorAuthor

    Thanks for looking into this, @bscharm!

    To your question: implementer's choice. Which would you find more useful as the practitioner running through the exercise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    codegood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions