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?

3
  • 1
    Possible duplicate of Library vs. framework vs API?
    – gnat
    Aug 23, 2016 at 11:06
  • @gnat: I updated my question, with more detail. Aug 23, 2016 at 12:16
  • 2
    Top comment on the answer you cite: "That's not a very good definition of a framework.". Look at the other comments and the others answers. Aug 23, 2016 at 12:18

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.