Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] How to name tests for bugs after GitHub move



On Thu, Jul 28, 2022 at 6:41 PM S A <simeon.danailov.andreev@xxxxxxxxx> wrote:
Hi all,

Hi, 

are there guidelines on how to name tests for specific bugs/issues, now that the Eclipse code base has mostly moved to GitHub?

There is no particular guidelines for test method names. It's up to the contributor to name the tests as they prefer. If there are concerns, they're discussed during the reviews; but usually the name of test methods is not something that is argued.

How do I name tests similarly, referring to GitHub issues?

You can name them `TestGitHubIssue1234" or similar.

I specifically want to name the test after the bug, I don't want to "invent" a name that tries to summarize the bug in 3-4 words (the JavaDoc comment explains the bug).

It's also up to you and the reviewers; but usually the other way round is more productive: test method describe roughly the case and the Javadoc points to the ticket with details. That allows to more easily understand what the test is about when it fails without requiring to navigate to the bug; if tests name and assertions are good enough, the failure is pretty explicit. 

Also what about adding links to GItHub issues in the JacaDoc comment of the test? I assume that is OK (though will the links continue to work if/after repositories get "merged")?

Yes, links are welcome. Merging repositories doesn't make that we delete the previous ones, they're usually just made read-only, so content is still accessible.
But in case they're removed, it's a good argument for my suggestion above that good naming and description in code is more sustainable that relying in references to external resources. In the end, code is the real substance, every tool or workflow around is just "decoration" that come and go according to trends that are usually beyond our control.

HTH

Back to the top