You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Grant Rettke <gr...@acm.org> on 2009/04/20 22:44:02 UTC

A style question about testing

Hi folks,

I've got a question for you about managing unit testing.

The situation that we are in is that right now, we have a single
module 'Products' that has a lot of classes in it. We know that
eventually we will refactor it into multiple modules (one for each
Product), but at this moment we have no clue when. However, we do know
that we have this goal in mind and that we would adhere to the
standard main/test structure in those separated modules

That said, there is a desire to get this stuff in place. The sooner I
have a plan there the sooner I feel like it might happen. Here is how
I am thinking I would do it:

For each product that we break out, create a module, and basically
don't have any source in it yet, just the tests, and add a test-time
dependency for the classes being tested (back to the mega module
basically).

This way all of the individual product moules would be in place, their
tests would be set up, developed and running, and it would allow for
developers to migrate over the product functionality source code when
they are ready.

Is this a good approach?

It makes sense, but I want to do idiomatic Maven, and I am just getting started.

I will give this a try tomorrow.

Best wishes,

Grant

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: A style question about testing

Posted by Stephen Connolly <st...@gmail.com>.
If anything I see problems in untangling the rats nest of dependencies
between code and tests if you don't just pull each one out one by one.

Since the tests will initially have the entire dependency tree available,
you could have a situation that tests fail to compile as you move the main
code into the sub-modules... requiring adding the module that the main code
was moved to as a dependency... which could result in a circular dependency
hell

-Stephen

2009/4/22 David Hoffer <dh...@gmail.com>

> I read it fast so maybe I missed something but I don't think I would create
> modules with only tests in the hopes you will move the source there
> someday.  Generally speaking the maven way would be to refactor out the
> source and the tests into modules and then add the new dependencies as you
> go.  I don't see value in moving tests first/only.
>
> -Dave
>
> On Mon, Apr 20, 2009 at 2:44 PM, Grant Rettke <gr...@acm.org> wrote:
>
> > Hi folks,
> >
> > I've got a question for you about managing unit testing.
> >
> > The situation that we are in is that right now, we have a single
> > module 'Products' that has a lot of classes in it. We know that
> > eventually we will refactor it into multiple modules (one for each
> > Product), but at this moment we have no clue when. However, we do know
> > that we have this goal in mind and that we would adhere to the
> > standard main/test structure in those separated modules
> >
> > That said, there is a desire to get this stuff in place. The sooner I
> > have a plan there the sooner I feel like it might happen. Here is how
> > I am thinking I would do it:
> >
> > For each product that we break out, create a module, and basically
> > don't have any source in it yet, just the tests, and add a test-time
> > dependency for the classes being tested (back to the mega module
> > basically).
> >
> > This way all of the individual product moules would be in place, their
> > tests would be set up, developed and running, and it would allow for
> > developers to migrate over the product functionality source code when
> > they are ready.
> >
> > Is this a good approach?
> >
> > It makes sense, but I want to do idiomatic Maven, and I am just getting
> > started.
> >
> > I will give this a try tomorrow.
> >
> > Best wishes,
> >
> > Grant
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: A style question about testing

Posted by Stephen Connolly <st...@gmail.com>.
If anything I see problems in untangling the rats nest of dependencies
between code and tests if you don't just pull each one out one by one.

Since the tests will initially have the entire dependency tree available,
you could have a situation that tests fail to compile as you move the main
code into the sub-modules... requiring adding the module that the main code
was moved to as a dependency... which could result in a circular dependency
hell

-Stephen

2009/4/22 David Hoffer <dh...@gmail.com>

> I read it fast so maybe I missed something but I don't think I would create
> modules with only tests in the hopes you will move the source there
> someday.  Generally speaking the maven way would be to refactor out the
> source and the tests into modules and then add the new dependencies as you
> go.  I don't see value in moving tests first/only.
>
> -Dave
>
> On Mon, Apr 20, 2009 at 2:44 PM, Grant Rettke <gr...@acm.org> wrote:
>
> > Hi folks,
> >
> > I've got a question for you about managing unit testing.
> >
> > The situation that we are in is that right now, we have a single
> > module 'Products' that has a lot of classes in it. We know that
> > eventually we will refactor it into multiple modules (one for each
> > Product), but at this moment we have no clue when. However, we do know
> > that we have this goal in mind and that we would adhere to the
> > standard main/test structure in those separated modules
> >
> > That said, there is a desire to get this stuff in place. The sooner I
> > have a plan there the sooner I feel like it might happen. Here is how
> > I am thinking I would do it:
> >
> > For each product that we break out, create a module, and basically
> > don't have any source in it yet, just the tests, and add a test-time
> > dependency for the classes being tested (back to the mega module
> > basically).
> >
> > This way all of the individual product moules would be in place, their
> > tests would be set up, developed and running, and it would allow for
> > developers to migrate over the product functionality source code when
> > they are ready.
> >
> > Is this a good approach?
> >
> > It makes sense, but I want to do idiomatic Maven, and I am just getting
> > started.
> >
> > I will give this a try tomorrow.
> >
> > Best wishes,
> >
> > Grant
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: A style question about testing

Posted by Grant Rettke <gr...@acm.org>.
Hi David and Stephen,

Thank you for the feedback!

Modules should have their tests with them, that is the ideal lifecycle
and nothing would add value in the path that I was wondering.

I believe that my train of though largely reflected a lack of
internalization of the "Maven way" of doing things.

Best wishes,

Grant

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: A style question about testing

Posted by David Hoffer <dh...@gmail.com>.
I read it fast so maybe I missed something but I don't think I would create
modules with only tests in the hopes you will move the source there
someday.  Generally speaking the maven way would be to refactor out the
source and the tests into modules and then add the new dependencies as you
go.  I don't see value in moving tests first/only.

-Dave

On Mon, Apr 20, 2009 at 2:44 PM, Grant Rettke <gr...@acm.org> wrote:

> Hi folks,
>
> I've got a question for you about managing unit testing.
>
> The situation that we are in is that right now, we have a single
> module 'Products' that has a lot of classes in it. We know that
> eventually we will refactor it into multiple modules (one for each
> Product), but at this moment we have no clue when. However, we do know
> that we have this goal in mind and that we would adhere to the
> standard main/test structure in those separated modules
>
> That said, there is a desire to get this stuff in place. The sooner I
> have a plan there the sooner I feel like it might happen. Here is how
> I am thinking I would do it:
>
> For each product that we break out, create a module, and basically
> don't have any source in it yet, just the tests, and add a test-time
> dependency for the classes being tested (back to the mega module
> basically).
>
> This way all of the individual product moules would be in place, their
> tests would be set up, developed and running, and it would allow for
> developers to migrate over the product functionality source code when
> they are ready.
>
> Is this a good approach?
>
> It makes sense, but I want to do idiomatic Maven, and I am just getting
> started.
>
> I will give this a try tomorrow.
>
> Best wishes,
>
> Grant
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>