+1. I'll also add a couple of notes.

Why is this important? We want to elevate the quality of the each Druid
release. In order to do that, we need to get even more serious about
testing, make sure that it's easy to author tests, and make sure it's easy
to understand what was tested and what wasn't.

Another advantage: I really like all that info in a test name because
usually that's all you get in the log when the tests are running or when a
test fails. By looking at the pattern of failed test names, you can surmise
where things went wrong in your code.

Jad.

On Mon, Dec 23, 2019 at 11:06 AM Suneet Saldanha <suneet.salda...@imply.io>
wrote:

> Hello,
>
> I've started writing tests in the druid repo and would like to propose a
> new test naming structure for the project. Inspired by this thread -
> https://www.mail-archive.com/dev@druid.apache.org/msg02426.html but
> focused
> only on the naming of tests. I'd like to propose we start using the format
> below
>
> test_<functionUnderTest>_<conditions>_<expectedResult>
>
> This makes it a lot easier for devs to name tests in a way that's easily
> understood by someone else without having to read the test to know what's
> going on. Here's some of my rationale:
>
>    - Explicit - the name tells you everything you need to know about the
>    test
>    - Forces you to write one test per condition/ expected result
>    - Underscores make it easy to delineate the different components of the
>    test
>    - Minimal effort to think of a short name that correctly captures
>    everything about the test while still being different from all the other
>    tests
>
> Happy to hear feedback / concerns about this approach.
>
> Suneet
>

Reply via email to