0

I am junior java developer and now working on study project.

We have tests for our classes (unit-tests, integration tests and api). My task is fix unconventional packages naming in test module.

Package for unit tests has similar naming that our classes with business logic has. It's look like - com.companyname.project.dao.ClassUnderTest. As I say we have api tests and naming for this package is invalid (as my mentor says). Now it's look like - api_test. My question is - how I should name package with api tests and maybe I should move this package into package with unit tests?

Nik
  • 3
  • 3
  • 1
    if the mentor says it is invalid, ask him what is valid (part of his job isn't it? - I use the same package name as the class being tested, just a different (root) source folder) – user85421 Nov 01 '19 at 21:39
  • I asked him, but after that i just get recommendation " find documents that are de facto standards, choose those that you think are relevant and make changes according to the outcome." So, I didn't find in java code convention any points about naming tests module. – Nik Nov 01 '19 at 21:47
  • That's I talking about. It's good practice to organize package structure for unit tests. But what I should do with api tests? They don't need my classes from main module and because of this I don't know how organize them. This post that you linked is good for unit, actually I have problem with api tests :) – Nik Nov 01 '19 at 22:02
  • @Nik - what do you mean by API? I didn't get when you said there was no classes from main module. – VeryNiceArgumentException Nov 01 '19 at 22:20
  • @VeryNiceArgumentException I mean tests for our project's API. We developing API and got some tests for our functionality. – Nik Nov 01 '19 at 22:33
  • He hasn't answered your question. Why did he say it is invalid? The quest he has sent you on is futile without some idea of what he thinks. You could produce 10,000 standards documents all of which he considers invalid. – user207421 Nov 02 '19 at 05:01

1 Answers1

0

Unit tests should be in same package as code. This is a good practice so new team members know they exist. Underscores should not be part of package names. Perhaps change "api_test" to "api.test" or "api"?

AndyMan
  • 397
  • 1
  • 7