Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 152853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:41:51+00:00 2026-05-11T09:41:51+00:00

All the projects I work interface to a piece of hardware and this is

  • 0

All the projects I work interface to a piece of hardware and this is often the main purpose of the software. Are there any effective ways I can apply TDD to the code that works with the hardware?

Update: Sorry for not being clearer with my question.

The hardware I use is a frame grabber that capture images from a camera. I then process these images, display them and save them to disk. I can simulate all the processing that takes place after the images are captured by using previously captured images that are stored on disk.

But it’s the actual interaction with the hardware that I want to test. For instance does my software cope correctly when there isn’t a camera attached, does it properly start and stop grabbing etc. But this is so tied into the hardware I don’t know how to test it when the hardware isn’t present or if I should even be trying to do this?

2nd Update: I’m also looking for some concrete examples of exactly how people have dealt this situation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:41:52+00:00Added an answer on May 11, 2026 at 9:41 am

    Split your test suite into two parts:

    1. The first part runs tests against the real hardware. This part is used to build the mockups. By writing automatic tests for this, you can run them again if you have any doubts whether your mockups work correctly.

    2. The second part run against the mockups. This part runs automatically.

    Part #1 gets run manually after you made sure the hardware is wired up correctly, etc. A good idea is to create a suite of tests which run against something returned by the factory and run these tests twice: Once with a factory that returns the real ‘driver’ and once against the factory of your mock objects. This way, you can be sure that your mocks work exactly as the real thing:

    class YourTests extends TestCase {     public IDriver getDriver() { return new MockDriver (); }     public boolean shouldRun () { return true; }     public void testSomeMethod() throws Exception {         if (!shouldRun()) return; // Allows to disable all tests         assertEquals ('1', getDriver().someMethod());     } } 

    In my code, I usually use a system property (-Dmanual=yes) to toggle the manual tests:

    class HardwareTests extends YourTests {     public IDriver getDriver() { return new HardwareDriver (); }     public boolean shouldRun () { return 'yes'.equals (System.getProperty('manual')); } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer This purely depends on the type of application you are… May 11, 2026 at 12:33 pm
  • added an answer You might consider not setting up those data classes within… May 11, 2026 at 12:33 pm
  • added an answer Yup, you were pretty close, try this: class FooBar1 {… May 11, 2026 at 12:33 pm

Related Questions

I'm working on a project and I'm just starting to do all the work
I have use IlMerge to merge all the dlls of my projects in one
When working on ASP.NET 1.1 projects I always used the Global.asax to catch all
I have a handful of projects that all use one project for the data
I've done several flash projects working as the ActionScripter with a designer doing all
At work, we use Team Foundation Server for source control. I work from home
I have a class library with all my database logic. My DAL/BLL. I have
I'm working on an ASP .NET 2.0 site which uses a Web Application project
I have over the course of a few projects developed a pattern for creating
I have a challenge I need some input on. I am currently recruiting programmers

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.