Introduction
Brief Overview of API Testing and Importance of API Client Tools
Application Programming Interface(API) testing is a crucial aspect of software testing that focuses on testing API endpoints to ensure they meet standards and provide an optimal developer experience. The significance of API testing has grown with the separation of web applications into frontend and backend components, primarily communicating through APIs or other protocols. This division has resulted in faster execution and increased flexibility, particularly as software teams expand. This has made testing only more important and brought forth intuitive tools like Postman to serve this purpose.
Purpose of the Article
The purpose of this article is to compare the two API clients: Postman and Bruno. It is a guide for software engineers and other technical individuals considering moving to Bruno, enlightening them on whatever the decision might be good or bad for their use case, and also for those struggling to choose between the two tools as their main tool. This article will touch on various areas including ease of use, performance, data portability etc.
Postman: Features and Strengths
Overview of Postman as an API client tool
Postman is described on its landing page as `An API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.’, From this, we can discern the vision the creators had for this tool. In this article, we're going to dive in and see if it truly lives up to its basic expectation as an API testing tool.
Postman boasts numerous features. For the sake of brevity and accuracy, we'll concentrate on the following key features: HTTP requests, Scripting, Collections, Collaborations, and Data portability.
Key Features of Postman
HTTP requests
Requesting Postman is easy, as shown in the screenshot above. You can set the request parameters, body, and headers. Additionally, there is a separate Authorization tab to help you with the specific authorization and authentication techniques required by the API you are accessingScripting
Writing a test in Postman is also straightforward, as seen in the screenshot to write test cases in Postman you rely on the global object pm which contains most of the utils that you will need such as the request and response data, variables, testing functions and more. For edge cases, you can import NPM packages. However, it can be quite a hassle to do so. I will discuss this in more detail later.Collections
In Postman, each request is saved in a collection, which serves as Postman's way of grouping related requests. Another useful aspect of a collection is that it provides an efficient way to export saved requests in JSON format for sharing through the Postman platform or manually. Additionally, there are tools available that support converting Postman collections to other formats such as Swagger APIs or OpenAPI definitions.Collaborations
In line with the collection feature, there's another, called workspaces. This is where your collections are stored. You can also invite other users to your workspaces, allowing for collaborative interaction with your collections. However, it's worth noting that this feature is heavily restricted for non-paying users.Data portability
We touched a little on this in the collections, So I will be taking it from there. On Postman itself, unfortunately there isn’t an option to export collections in other formats. Importing on the other hand is quite advanced, you can import data in formats such as Curl, Insomnia, Swagger APIs or OpenAPI definition, cURL commands and New Relic.
Limitations and Drawbacks
One aspect that can be both a stress point and a strength for me when using Postman is its suite of tools. They are quite extensive and may even seem redundant at times. Additionally, it's important to note that Postman is strictly an online platform with no offline support. So, be prepared to always have access to the internet, which might not be ideal for some individuals who face connectivity challenges.
Postman scripts also face challenges when importing NPM packages. I won't go into details here, but you can find more information here.
Moreover, the scratchpad, which was the only way to use Postman without connecting to the Postman server, has been discontinued.
Regarding the subscription model, if you're planning to onboard at least three members (including yourself), expect to pay a minimum of $14 per member. This cost can increase if you're interested in additional features which, in my opinion, may not be essential.
Bruno: Features and Strength
Introduction to Bruno as a new API client tool
Bruno is described by its creator as a Fast and Git-Friendly Open Source API client, aimed at revolutionising the status quo represented by Postman, Insomnia and similar tools out there.
, in a space that’s dominated by tools like postman that have been refined over time, bruno brings in a new offline-first file-based paradigm.
Having been in development for over two years, Bruno has recently gained popularity. This surge in interest can be attributed to the recent action by the Insomnia Team, which now requires some users to sign up for a plan before they can access their existing API collection.
Currently, their Github repository is growing, boasting an impressive 7k stars. In this section, I will discuss what sets Bruno apart, its special features, as well as its limitations. I'll also address reasons why you might choose not to make the switch.
Key Features of Bruno
File Based Sync
One of Bruno’s unique features is that each request is saved in a file and the entire collection is saved in one folder. This makes collaboration straightforward and intuitive because it doesn’t depend on proprietary version control. The single file for each request approach also makes it easier to read and manage the collection files, whenever you wish to do so compared to when you are using something like swagger and your YAML file has over a large number of lines.Git Based Collaboration
Since your API requests are saved in the file system, Git (and by extension, git repository managers like Github, Gitlab, and Bitbucket) is used for versioning, forking (creating a clone of the API docs), diff view (to see the difference between two versions/forks of the same API docs), and more.Light App Size
Bruno is a much more lightweight application compared to Postman. Bruno has fewer features, as it's unlikely most use cases would require the full extent of Postman's extensive capabilities. Additionally, Bruno loads much faster due to its leanness. In summary, Bruno is intentionally designed to be lightweight with only essential features and Bruno's focus on core functionality enables notably faster load times. On the other hand, Postman offers a wider range of functionality resulting in a larger app sizeOffline Capabilities
Postman is now completely unusable offline in its latest version. This is because Postman has removed the 'Scratch Pad' feature. Therefore, the only way to use Postman offline and without an account no longer exists. On the other hand, as promised by its founder, Bruno will always be offline first with no cloud sync. Bruno's founder has promised that Bruno will always prioritise working offline without requiring a cloud account.
Limitations and Drawbacks
If you have a large team or company and prefer to keep your documentation separate from your codebase, you can create a dedicated repository for your docs. However, this introduces an additional step in your documentation process. You may choose to export the collection each time a change is made and share it with team members without codebase access. By doing so, you voluntarily opt out of the benefits Bruno brings.
Bruno offers a limited set of options for exporting collections. Currently, you can only export Postman format in addition to the default Bruno format. Please note that this information may have changed by the time you read this article, so it's advisable to do your research.
Caution Notes on migration
Summary of Findings and Insights
Postman may be better suited for larger organisations, particularly those where many team members lack access to the codebase. These users can easily be invited to Postman workspaces to interact with collections. Postman also provides a documentation tool for browsing collections online without the need to load the full app, though testing endpoints still requires running Postman.
On the contrary, Bruno is well-suited for smaller teams, allowing API docs to reside in the same repository as code. While not strictly necessary, this proximity accelerates doc updates and reviews.
Bruno also attracts users who prefer self-hosted data to relying on Postman's remote servers, which offer no direct control.
Postman, an established player, has been used by major companies like GitHub, Microsoft, Slack, WhatsApp, and Datadog. Due to this traction, Postman is likely to continue thriving for the foreseeable future.
In comparison, Bruno, while backed by years of effort from its creator and the open-source community, is a relative newcomer. On the plus side, Bruno is fully offline-capable and self-reliant. Even if official support were to end unexpectedly, users could continue leveraging the latest Bruno release indefinitely. The open-source community could potentially fork Bruno's code for ongoing maintenance.
Postman has separate "Pre-Request Script" and "Tests" tabs, while Bruno consolidates these into a single "Script" tab. The Bruno "Script" tab contains the pre-request script and post-response script sections, functioning similarly to Postman. However, Bruno's post-response script runs after receiving a response.
These two clients differ in their scripting utilities. Bruno uses a global variable called "bru," while Postman uses "pm."
Bruno provides an "Assert" tab with a simple user interface for easily testing API responses. Users can validate status codes, response bodies, header values, and more by selecting an assertion type and specifying expected values. Everything is automatically translated into assertion scripts without needing to write code from scratch.
It's important to note compatibility issues between Postman and Bruno regarding testing. This trade-off enables a better developer experience, at least based on my trials with Bruno. However, Bruno does not currently offer auto-completion in these scripting tabs.
Potential Areas for Improvement for Both Tools
The Postman team could consider enhancing offline capabilities and reducing application bloat, perhaps by releasing a lightweight version. However, the likelihood of this happening seems doubtful.
Meanwhile, most issues I currently have with Bruno are already on its public roadmap for future improvement. I highly recommend checking out Bruno's roadmap, as it may help inform decisions about potentially switching to Bruno or sticking with Postman down the line. The visible roadmap may provide better insight into Bruno's future direction.
Acknowledgements and Closing
Acknowledgement
Bruno Talk - IndiaFoss 3.0 Conference
Bruno (#3) - Why Bruno has a chance to dethrone 5.6 BILLION dollar Postman
Postman Blog
[Bruno Docs
](usebruno.com)
Closing Remarks
I want to thank my friend Francis Shonubi(not shinobi btw) and Nwizugbe Samson, who took their precious time to review this article, which is my first by the way.
You can get in contact with me via my email adetunmbikenny_at_gmail_dot_com and linkedin. I am currently volunteering to write technical guides for products or tools targeted towards developers.