Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2397

Sort out Unit vs. Integration tests, and run them separately

    Details

    • Attachments:
      0
    • Comments:
      1
    • Documentation Status:
      Not Required

      Description

      To my eye, a lot of our unit tests look more like integration tests. Unit tests should isolate the unit under test and supply all external dependencies – there should be no file or database or network access unless they are mocked, and the rest of the environment should be injected or otherwise supplied by the test.

      Maven provides two plugins, Surefire and Failsafe, to support these different types of testing. One advantage of separation is that true unit tests should be very quick and cheap to run, so we should be able to say "don't run the integration tests yet" to get faster test/refactor cycling.

      Anyway, we should look over our test setup and see if we can improve our development process by segregating unit and integration tests. This may require some redesign of classes to make them more amenable to unit testing (which is widely believed to promote maintainability as a side effect).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mwood Mark H. Wood
                Reporter:
                mwood Mark H. Wood
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: