Packages, Libraries and Bindings

Course Home

A library is usually a collection of code that someone has designed to do a specific purpose. It will be a single file in a specific format for that language, such as a .jar or .dll file.

Bindings bind a programming language to a library or service. A common example in the world of testing is Selenium WebDriver. The WebDriver API exists in the Selenium server, and expects to receive HTTP requests are per the WebDriver specification. We can use the click command as an example, the HTTP request for a click is ‘/session/{session id}/element/{element id}/click’ however in our code we just write MyElement.Click(). That’s because the bindings are doing all the hard work for us. The bindings know the API specification, they know the sessionId, they lookup the elementID and then formulate the HTTP request for us. Without the bindings we’d have to create this code on our own! Bindings hide all the magic and complexity allowing us to take full advantage of libraries and services without having to implement that service in multiple programming languages.

A package is similar to a library but usually, involves some addition logic/automation. Packages are usually supported by a package manager. For example, it will download the library, put it in a specific place, and add an entry to a config file. Or it may download several libraries and its dependencies. A dependency being another library that another library may reference/use.

I’ve listed some example package managers in the resources below, which is a good place to start if you want to explore existing packages.

Next Lesson ➔

Resources

NPM
Maven
NuGet

Richard Bradshaw's photo
Author

Richard Bradshaw

@FriendlyTester

Software Tester, speaker and trainer at Friendly Testing. BossBoss at Ministry of Testing. Whiteboard Testing creator. Striving to improve the testing craft.

Comments