Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Should use JUnit 4 syntax
  • File name ends with *Test
  • Should use Category annotation of type UnitTest
  • Should complete in milliseconds 
  • Should generally test a single class
  • Typically uses white-box testing, uses Mocks/Fakes and helps guarantee internal quality (quality of code and class design)
  • Follows "A Set of Unit Testing Rules" by Michael Feathers
    • A UnitTest should not do any of the following:
      • communicate with a database
      • communicate across the network
      • access the file system
      • prevent the running of other unit tests in parallel
      • require anything special in the environment (such as editing config files or running an external process)

2. IntegrationTest: a test involving inter-operation of components or subsystems.

...