Test software in a modular manner through message passing

Hello everyone,

I am envolved in a project where I have to design an application which implements the following classifications:

  • QNX library functions and system calls (arithmetical fcts, timer fcts, interruption fcts, multi-threaded fcts)

  • POSIX 1003.1 compatible functions

  • and IPC’s

The application will later be tested by a different departement which will use the googletest interface for this purpose.

So now in order to prepare for this task at the moment I am reading into QNX Neutrino’s most distinctive feature, Message passing
and in chapter What it means for you the author wrote the following:

Message passing is elegant and network-distributed. So what? What does it buy you, the programmer?

Well, it means that your programs inherit those characteristics—they too can become network-distributed with far less work than on other systems. But the benefit that I find most useful is that they let you test software in a nice, modular manner.

With message passing, the individual components of a project can be decoupled very easily, leading to a very simple design and reasonably simple testing. If you want to think about this in terms of existing paradigms, it’s very similar to the concepts used in Object-Oriented Programming (OOP).

But I am having a hart time understanding how I could make use of this benefit ? Could it be by implementing all of the above classifications, which I have listed, as clients which have to communicate with a server in a way that uses message-passing ?

Kind regards

It’s really hard to understand what you are talking about. What do you mean by a “classification”. What is “fcts”? Functions?

If you are just learning about QNX and message passing, it’s hard to respond in anything but a superficial way. Message passing is just a synchronized way to pass packets of data between two processes. It is at the heart of the way QNX works. When you call a read() function on a device, a message or packet of data is sent to a resource manager. The replied message has the data you requested or an error code. You can also write your own resource managers to manage physical hardware or something virtual. A rssource manager that deals with hardware is what is commonly called a driver on other OS’s, however drivers are usually part of the kernel. This is not the case with QNX. The kernel is very small and implements a small number of fundamental functions.

QNX 6 and 7 have a layer on top of raw message passing that allows you to simply create a Posix interface that uses open(), close(). read(), write() etc calls. The layer takes care of any calls that you don’t want to write. This layer is optional and there are time when you should use it and other times when you should not.

Beyond this, there is a big issue as to how to construct a well designed QNX system. In the last 20 years I’ve found that many programmers do not take the time to understand this. Instead they just write a big multi-threaded WIndows/Linux like application. This works but doesn’t take advantage of the potenially beautive and robost structure that message passing provides.

Finally, so far QNX has supported the passing of messages across a network. This allows one to transparently access resources, such as disk, devices and cpu as if they were local. Insanely, Blackberry keeps trying to deprecate and remove this feature. Of course they’ve recently remove a number of nice features. There’s no longer a real GUI, only the ability to write graphical programs. QNX also used to be self hosted, not needing a Linux or Windows system to do development. It’s hard to explain to people who haven’t worked on self hosted QNX to understand how awkward the current cross development system is.

I think, this link is useful for you.