Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java-Based Regression Testing [closed]

How is regression testing performed in Java? Are there automated regression test frameworks or do you just write (JUnit) unit tests that help ensure against regressions?

Is there a way or set of best practices for coding unit tests so that they also serve the dual purpose of being regression tests, or do you need to keep regression tests separate from your unit tests?

like image 952
IAmYourFaja Avatar asked Sep 21 '11 15:09

IAmYourFaja


People also ask

What is regression testing Java?

Regression Testing, by its definition, is a type of software testing to confirm that a recent program or code change has not adversely affected existing features. It is done to make sure that the existing application is intact with the newly added features and nothing is broken.

Is regression testing end to end?

Regression testing should happen at all levels of testing, starting from the unit tests. End-to-end testing encompasses regression testing but testing end-to-end is rarely possible at the lower testing levels because you need to have all involved parts of the process in place to test it as a whole.

When should regression testing be performed?

When Should Regression Testing Be Taken Up? Whenever a new feature is developed, or when an existing feature is improved or if there are any UI updates made, ideally there is a dier need to perform software regression testing.


2 Answers

Regression testing has nothing to do with a language. It is a technique that is used to ensure future code changes do not break existing features. In Java you can use junit or testng or anything else. Typically a regression test is a functional test and is not a pure unit test.

like image 106
Woot4Moo Avatar answered Oct 24 '22 13:10

Woot4Moo


JUnit is generally aimed for unit tests rather than full-scale functional testing (of which regression testing is an example if one is looking at the system as a whole).

However, it is not uncommon to use a separate test suit to perform "heavy" functional and integration tests that connect to actual backends, etc., and verify results against expectations.

One reason for the use of JUnit here is the ability to go from 'mocked tests' to actual functional tests using dependency injection. You could provide, for example, a mock collaborator in the lighter test, and an actual collaborator instance in the full functional test.

like image 20
Uri Avatar answered Oct 24 '22 13:10

Uri