I want to link test codes and product codes

Asked 2 years ago, Updated 2 years ago, 150 views

Does anyone know how to link test codes and product codes?
I'm currently developing software in Java, but it's getting a little complicated.
I want to do the test well, so I want to know which test code is testing which product code...
I would appreciate it if you could let me know if anyone knows.
By the way, we are building using maven.
Also, I have used SonarQube, so I would appreciate it if you could link with these tools.
Of course, I would like to actively use any other useful tools.

java test maven junit

2022-09-30 20:56

1 Answers

If you are using Maven, use the folder structure according to the rules like src/main/java and src/test/java.If the class name of the product code is FooBar, you should create a test class in the same package as FooBar under src/test/java under the terms FooBarTest

With Eclipse, you can go back and forth between the testing pairs (FooBar and FooBarTest) with Ctrl+9, and if there is no test class, they will ask you if you want to create a new one.

Creating product and test codes one-on-one like this is the easiest configuration for a single test.

Since the merge test cannot be done on a per-class basis, it is often created on a functional basis with a name like XxxIntegrationTest (sometimes it's a separate project).


2022-09-30 20:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.