0

Citing JUnits homepage: "JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks."

According to a the answer of this question: Library vs. framework vs API?, a framework is "a collection of patterns and libraries to help with building an application" and library is defined as "a collection of functions / objects that serves one particular purpose. you could use a library in a variety of projects".

As a framework is said to have collection of libraries, why is junit called a framework and not a library?

1 Answers1

9

A simple rule of thumb that many use for whether to call something a library or framework is:

  1. Does the external code call your code, ie does the external code control your code? Is yes, it's a framework.
  2. Does the external code only get called by your code (ignoring callbacks), ie does your code control the external code? Is yes, it's a library.

"Tool" is a very generic term that could be applied to all frameworks, libraries, apps, APIs, SDKs etc, so probably isn't a good choice of term for JUnit.

David Arno
  • 38,972
  • 9
  • 88
  • 121