Virtual IoT Devices: Advantages & Applications
In this article, you will learn what are Virtual IoT Devices, their advantages, and applications, and how to create & use an IoT Device Simulator using mock service Mock.IO.
Technology has been making our lives easier by the day! Till now the focus was on making the technology available to humans to use intelligently but with the Internet of Things, the focus is shifted to making the devices intelligent and self-learning. Today a smart washing machine can connect to the network, download updates to the software, and learn from the experience of other machines all by itself. A smart refrigerator can suggest recipes to you based on the groceries stored in it.
The global Internet of Things market is growing at an exponential rate. According to a report by Fortune Business Insights, it was USD 308.97 billion in 2020 and is expected to grow from $381.30 billion in 2021 to $1,854.76 billion in 2028 at a CAGR of 25.4% in the forecast period.
Technology advances always amaze us but have you ever wondered how these devices work so efficiently and flawlessly?
The answer lies in testing the software applications thoroughly. Developing and testing software apps for IoT Devices pose a significant challenge of mimicking the actual pool of physical IoT devices and that’s where the Virtual IoT devices come into the picture.
What is a Virtual IoT Device
A virtual IoT device is a software service that mimics the behavior of an actual IoT device in use. It is a solution to easily create and simulate thousands of virtual connected devices without actually owning or managing even a single physical device! Isn’t it cool? Let us explore how this is done.
What is a Mock Service
The primary player in the Virtual IoT device creation is the Mock Service. Mocking is nothing but an imitation. It simulates the behavior of a real API but in a more controlled manner. A simple mock service consists of a server, which on matching certain requests returns a predefined response and other parameters associated such as response code, headers, etc. exactly as a real API would.
What can be Mocked
Many common operations can be mocked. Some of them are listed below-
- CRUD Operations — Create, Read, Update, and Delete operations in the application’s main user flows
- Authentication and Authorization Flow
- File Download
- Error Handling — e.g., Timeouts, delays, validations, etc.
Why use a virtual IoT device instead of an actual device
There are many reasons to use mock devices instead of actual ones. Here is the list of the main reasons-
- Real backends are costly
- Real services are a limited resource
- Real data seeding is a pain
- Real environments are unstable
- Real vendor backend troubleshooting is slow
- Real environments are low capacity
- Can’t test special cases against real backends
Top Mocking Service Providers
Many mocking service providers are available. The top options across North America are listed below-
Advantages of Mock Service
The main advantages of using Virtual IoT devices using mock service are listed below-
- The frontend and backend teams can work parallelly
- Removes dependency and work-block between teams
- Mocking for Functional Tests
- Mocking during development
- Mocking for External Components
- Mocking for Non-Functional Testing
Best practices while creating the Virtual IoT Devices
- Make the mock virtual devices 100% technically equivalent
- Use recording tools or log files to create complex mock behavior
- Use mocks to create negative tests
- Create a mock so that it can forward requests
- Use mocks to enable continuous testing
Applications of Virtual IoT Devices
Virtual IoT Simulators can be used to develop and test software applications for –
- Smart Waste Management
- Water Usage Management
- Monitoring energy usage
- Simulate Connected cars driving in real conditions etc.
Integrating Veora with Mock.IO
At Incepta, we test various applications using Virtual IoT simulators with our IoT integration platform, Veora.
To integrate Veora with Mock.IO we need to create a specific data model for our Mock IoT devices. The next step is to create the necessary resources in MOCK IO and populate the data. Finally, create necessary endpoints in the process API that will send requests to MOCK services and integrate the responses to the Experience API which will send the data to the front end. See the image below for details:
Other common IoT device properties: location, status, site, device_id, created_at, disconnected, and type.
- After creating the data fields in Mock.IO, we populate those fields with a mock response.
- Next, we include those endpoints in the process APIs request flow.
- Then we pass the response to the experience-API which will send the response to the front end.
As discussed above, Virtual IoT devices are quite helpful and play an important role in developing and testing various software applications for IoT-enabled systems. We also discussed the advantage of virtual IoT simulators and best practices while designing such systems. We hope you enjoyed reading this blog post. For any queries feel free to contact us.