![]() |
Serial Port Devices and Unit Tests
I am looking for some insight on writing unit tests for serial port devices. In my case I can't depend on the device being attached every time I build and run the tests. I am finding it difficult to write the code without the device being attached. Thanks ahead of time for any information on this.
|
Re: Serial Port Devices and Unit Tests
What's not always attached? The external (target) device, or the local device? If you have the local device, you might consider some sort of loopback tests.
Without the local device, I don't see how you can be expected to verify the software, since there's a successful software-to-hardware transition, relying on accurate timing, involved. |
Re: Serial Port Devices and Unit Tests
The external device would not be attached to the other end of the serial cable. I am assuming that without writing some sort of simulator, that it will not be possible to write any useful unit tests without the external device being connected.
|
Re: Serial Port Devices and Unit Tests
You might be able to with a loopback situation.
If your external device is very complex and expensive, with the serial interface being a small part, then you might consider building some kind of simulator that involves only the serial interface and some display/measurement attachments. Otherwise, I would consider the investment in an external device, as a permanent tool in your set, to be wise. If this is a reasonably important project, your bosses are being shortsighted. |
| All times are GMT -5. The time now is 3:23 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC