{"id":23390694,"url":"https://github.com/devonestes/device_tracker","last_synced_at":"2025-04-08T14:36:24.454Z","repository":{"id":43969520,"uuid":"235654158","full_name":"devonestes/device_tracker","owner":"devonestes","description":"Example application for testing workshop","archived":false,"fork":false,"pushed_at":"2023-01-05T10:36:15.000Z","size":457,"stargazers_count":2,"open_issues_count":12,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T10:56:08.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devonestes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-22T19:53:00.000Z","updated_at":"2022-06-21T20:01:11.000Z","dependencies_parsed_at":"2022-08-31T02:50:13.631Z","dependency_job_id":null,"html_url":"https://github.com/devonestes/device_tracker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonestes%2Fdevice_tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonestes%2Fdevice_tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonestes%2Fdevice_tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devonestes%2Fdevice_tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devonestes","download_url":"https://codeload.github.com/devonestes/device_tracker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247862146,"owners_count":21008641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-22T03:43:18.056Z","updated_at":"2025-04-08T14:36:24.429Z","avatar_url":"https://github.com/devonestes.png","language":"Elixir","readme":"# DeviceTracker\n\nAn example app used for a really great Elixir testing training! This application\nis \"complete\" and \"works\". The thing is, it has bugs. Lots of bugs 🐛🐞🐛🐞🐛🐞\n\nOur goal today is to find these bugs! If you have time and you want to you can\ntry and fix them, but that's not actually the goal of the exercises today. Today\nwe're just writing tests that will illustrate these bugs, and hopefully give us\nsome really great error messages so we can have a really easy time fixing the\nbug (and get good information if we happen to introduce a regression in the\nfuture).\n\n## What it does\n\nThis application serves as an API for devices out in the world that send\nmeasurements to the application. There is no database backing the app - all\ninformation about these devices is stored in memory. These measurements can then\nbe accessed in a web app to get data about the devices.\n\nDevices can be registered, unregistered and configured. The configuration\nincludes the following options:\n\n* Is the device on or off?\n* What type of measurements does it store?\n* What is the maximum number of measurements a device should store for a certain\n  type? For all types?\n* Is there a warning threshold for a certain type of measurement?\n* Does a device belong to a group of devices?\n\n# Bugs\n\n## Unit tests\n* Division by 0 error when calculating the average of an empty list.\n* Measurements don't show up in views if there aren't any measurements, but\n    should show that there are 0 measurements.\n* Exception when trying to get information for a device that hasn't been\n    registered.\n\n## Unit test GenServer\n* Adding a measurement to a type that hasn't been registered doesn't raise an\n    error\n* Triggering the alarm when a device is turned off shouldn't be possible because\n    we shouldn't accept new measurements when the device is off\n* Max number of measurements doesn't get updated when adding a new measurement\n  type and so we go over the max number of all measurements\n* Test crash and restart behavior for linked devices\n* Improve tests in DeviceTests because they're flakey and not isolated\n\n## Wallaby integration tests (UI and API)\n* UI only displays 3 measurement types even if a fourth is added.\n* UI shows data for a device that is off even though it shouldn't.\n* UI shows groups with the fewest devices first, but should show groups with the most devices\n    first.\n* Return 500 for the API because of malformed JSON (include a tuple or\n  something that can't be encoded).\n\n## Stateless property based tests (UI fuzzing, number crunching)\n* Ensure the API never returns 500.\n* Ensure that all webpages can always be rendered correctly in the UI.\n\n## Stateful property based tests (Device server state transitions)\n* Ensure allowed actions for device states.\n*   Only config that can change when off is to turn it back on again\n*   No measurements are stored when the device is off\n*   We remain in a warning state when we've gone over the threshold until we've\n    seen another measurement that is under the threshold\n* We never exceed the max number of measurements (if set).\n* We never have more than the max number of measurements after setting the max\n    number of measurements.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevonestes%2Fdevice_tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevonestes%2Fdevice_tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevonestes%2Fdevice_tracker/lists"}