Lecture
Dummy data - in computer science, dummy data with useful information that does not contain any useful data, but serves to return a formally correct result with all the necessary fields and values. Dummy data - can be used as a placeholder for testing and functional purposes. For testing, dummy data can also be used as stubs or pedes (pad) to avoid problems with software testing, ensuring that all variables and data fields are transferred. In functional use, dummy data can be transmitted for OPSEC purposes. Bogus data must be rigorously evaluated and documented to ensure that they do not cause unpredictable effects.
In addition to testing, for example, for REST API (backend + frontend) Dummy data can be used to generate dummy data in the database itself - dummy users, their actions, etc.
There are online services and offline programs for generating data in different formats from JSON to XLS
There are three MySQL tables, all InnoDB:
users:
- id (index)
friend_requests:
- user1 (index)
- user2 (index)
friend_data:
- user1 (index)
- user2 (index)
For fake users,
You need to generate 10 friend requests and 10 friendships for each user with other random users.
SELECT u.id FROM users AS u LEFT JOIN friend_data AS f ON u.id IN (f.user1, f.user2) AND $ ID IN (f.user1, f.user2) LEFT JOIN friend_requests AS fr ON u.id IN (fr.user1, fr.user2) AND $ ID IN (fr.user1, fr.user2) WHERE (f.id IS NULL) AND (fr.id IS NULL) AND u.id <> $ ID ORDER BY RAND () LIMIT 1
Comments
To leave a comment
Software and information systems development
Terms: Software and information systems development