mardi 2 octobre 2018

When someone says to "(only) test the public api", what exactly do they mean by "public api"?

For example, given a gui application, like a word processor, is the public api the gui itself? Does testing the public api then mean writing tests that start the application and manipulate the mouse and keyboard to press buttons? I assume you are not expected to parse the gui display itself to test expected results, like a user real user would.

The public api for a library seems a bit more straightforward. I assume it is the functions and classes that are accessible when the library is imported into another project.

What about a library written in a functional paradigm? Procedural? Object oriented? What about languages without explicit public and private division.

In essence: can the term "public api" be described in a language, paradigm, and application independent way, with minimal jargon? Examples could be helpful.

Aucun commentaire:

Enregistrer un commentaire