continuous integration - Where should unit tests live? -


I'm relatively new to the unit testing, and I've found that many sources say that you should write unit tests, Where can some of them put you in your project.

Whatever suggestions I have seen, they are asked to produce them with a production code or to create a directory structure that mirrors your output code. With the first problem, I see that when you make the system complete, it will be difficult to remove those tests; For the second, what kind of performance will you test that will only appear at the package level?

Is a good way to organize unit tests so that you can easily automate the process of construction and still need all

edit: < / Strong> For those thinking about a specific language, I am mostly working in Java, however, I want to find a solution which is relatively language-an agnostic, so I will be able to apply it on the platform Only I can apply

With the first issue I see that when you make the system complete It will be difficult to remove those tests.

You can always filter classes based on some naming conventions like special suffixes or prefixes when packaging (for example ** / * Do not include test.class with Java). I really do not like this approach, though, I find it messy and fragile.

For the second, how would you test the functionality that will only appear at the package level?

As long as I'm missing something, I can see the issue, you can do classes in the same package and different trees

  • src / main / java
  • for test sources / test / java
    • src / test / java / foo / barteest.java

Both Bar.Java and Bartex.Java same foo Package but different directories In I use this method.

Is there a decent way to organize unit tests so that you can easily automate the manufacturing process and still reach all those things that require testing?

< live in the same project but different and application source / em> directory trees and This works really well for me

This is actually the default layout given by Maven (see). The language you use can give you some ideas.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -