{"id":16141216,"url":"https://github.com/pikastech/pikapythontool","last_synced_at":"2025-04-06T18:40:49.985Z","repository":{"id":175582512,"uuid":"654148644","full_name":"pikasTech/PikaPythonTool","owner":"pikasTech","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-15T14:42:56.000Z","size":2178,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T00:38:08.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/pikasTech.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-15T13:40:25.000Z","updated_at":"2023-07-05T15:09:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"af574ae9-c924-45a1-b95c-5b7dae4b9d44","html_url":"https://github.com/pikasTech/PikaPythonTool","commit_stats":null,"previous_names":["pikastech/pikatesttool","pikastech/pikapythontool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikasTech%2FPikaPythonTool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikasTech%2FPikaPythonTool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikasTech%2FPikaPythonTool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pikasTech%2FPikaPythonTool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pikasTech","download_url":"https://codeload.github.com/pikasTech/PikaPythonTool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535006,"owners_count":20954570,"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-10-09T23:54:46.594Z","updated_at":"2025-04-06T18:40:49.946Z","avatar_url":"https://github.com/pikasTech.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PikaTestTool\n\n[中文页](README_zh.md)\n\nPikaTestTool is a software and hardware testing system designed for the PikaPython device framework. Connected to the test board via the ESP32S3 main control chip, it can test and validate peripheral functions of boards that support PikaPython, such as GPIO, UART, IIC, SPI, CAN, as well as Wifi, BLE, Modbus protocol stacks, and more. PikaTestTool provides a Python module, allowing developers to easily utilize its testing capabilities.\n\n## Background\n\nIn software engineering, unit testing is a key aspect in ensuring code quality. Ignoring unit testing may lead to many issues, that could have been identified and resolved at the unit level, becoming exposed only during system integration—potentially causing critical setbacks to the project. In complex software systems, the importance of unit testing becomes even more apparent as it assures crucial abilities like software usability, refactorability, maintainability, and more, thereby providing stability for software development.\n\nAs a redesigned embedded Python interpreter, PikaPython relies on unit testing techniques to enhance software stability, increase the reliability of delivery, and support rapid iteration. For instance, after each addition of new features, bug fixes, or performance optimization, unit tests are needed to validate the correctness of the modifications and whether they affect other parts' functionalities.\n\nIn the field of embedded systems, testing peripheral functionality poses a significant challenge. The functions of peripherals generally can't be verified directly from the main control and often require the aid of actual hardware devices. Traditional hardware devices, like oscilloscopes and logic analyzers, offer low levels of automation, leading to a steep increase in maintenance costs. If manual driver testing is needed every time, it will drastically lower development efficiency.\n\nMoreover, during system iteration that involves peripheral adaptation—like driver adaptation iteration, driver framework iteration, Python interpreter iteration, and main control SDK iteration—each link could potentially affect the usability of the system peripheral driver. As the driver volume increases, manual testing for each iteration becomes unrealistic for an open-source project without substantial funding and a stable workforce.\n\nIn light of these problems, an automated, highly customizable testing solution is urgently needed. PikaTestTool was created to meet this demand.\n\n## Necessity of the Project\n\nIn the development of embedded systems, especially in system iterations that involve peripheral adaptation, each iteration requires a large amount of manual testing. This process is not only time-consuming but also labor-intensive. The emergence of PikaTestTool will greatly alleviate the burden of developers, improve testing efficiency, and assist developers in faster product iteration.\n\nAs a testing tool based on ESP32S3, PikaTestTool can automatically complete testing for all kinds of peripheral functionalities supported by the PikaPython device framework. This includes testing communication interfaces like GPIO, UART, IIC, SPI, CAN, as well as protocol stacks like Wifi, BLE, Modbus. This greatly improves development efficiency and ensures comprehensive testing after each software update, securing software stability and reliability.\n\nMoreover, PikaTestTool is programmed using Python, enabling developers to quickly get started and swiftly write test cases. This not only improves development efficiency but also enhances code readability and maintainability.\n\n## Contributions of PikaTestTool to PikaPython Device Framework\n\nThe contributions of PikaTestTool to the PikaPython device framework are mainly manifested in the following aspects:\n\n- Automated testing: PikaTestTool can automatically complete testing for all types of peripheral functionalities supported by the PikaPython device framework, significantly improving testing efficiency and saving manpower.\n\n- Continuous integration testing: PikaTestTool, programmed in Python and supporting Wifi connection, can trigger a complete automatic test of the actual hardware system whenever the PikaPython device framework is updated, ensuring continuous maintainability and deliverability of the software.\n\n- Improving software quality: Comprehensive testing by PikaTestTool guarantees the stability and reliability of the PikaPython device framework, reducing product issues due to software defects.\n\n- Promoting the development of the open-source community: As an open-source project, PikaTestTool not only aids in the development of the PikaPython device framework but also offers an automated testing solution for other open-source projects, thereby fostering the growth of the open-source community.\n\n## Extensibility to Other Testing Scenarios\n\nAside from the PikaPython device framework, PikaTestTool is also applicable to other scenarios that require hardware functionality testing. For example, you can use PikaTestTool to test whether your hardware device is working properly, or use PikaTestTool to test if your software can correctly drive hardware devices.\n\n## Example\n\nBelow is an example of using PikaTestTool to test GPIO:\n\n``` python\nimport PikaTestTool\nimport PikaStdDevice\n\n# Connect to PikaTestTool via UART 3\nPikaTestTool.connect(mode = 'UART', id = 3)\n\n# Initialize a GPIO object\ntest_io = PikaStdDevice.GPIO()\n\n# Set GPIO pin and mode\ntest_io.setPin('PA1')\ntest_io.setMode('out')\n\n# Enable GPIO\ntest_io.enable()\n\n# Set GPIO to output a high level, then read the GPIO value, and verify it's high\ntest_io.high()\ntest_tool_io_number = 1\ntested_value = PikaTestTool.read_gpio_value(test_tool_io_number)\nassert tested_value == 1\n\n# Set GPIO to output a low level, then read the GPIO value, and verify it's low\ntest_io.low()\ntested_value = PikaTestTool.read_gpio_value(test_tool_io_number)\nassert tested_value == 0\n```\n\nIn this example, we first create a GPIO object and set its pin and mode. Then, we enable this GPIO, set it to output a high level, read the GPIO value, and verify it's high. Afterward, we set the GPIO to output a low level, read the GPIO value, and verify it's low. This example clearly demonstrates how to use PikaTestTool for hardware functionality testing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpikastech%2Fpikapythontool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpikastech%2Fpikapythontool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpikastech%2Fpikapythontool/lists"}