{'fraction_non_alphanumeric': 0.020901371652514697, 'fraction_numerical': 0.0, 'mean_word_length': 5.304526748971194, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Software Design of Protocol Conversion between Instruments Based on Test-Driven Development

Aiming at the differences in the data frame format, transmission rate and medium access mechanism of the bus protocol used in the interaction between the Rotary Steering System (RSS) tool and the Measurement While Drilling (MWD) tool in the downhole petroleum instrument, as well as many challenges faced by traditional embedded software development question. In this paper, the test-driven development method is used to develop the inter-instrument communication protocol conversion software, which improves the robustness and stability of the code, and effectively solves the problems faced by the traditional embedded development mode. The software is based on TI's cross compiler CCS as a development tool. Firstly, through analyzing the overall scheme of the system design, the software functions during software development are analyzed in detail. The software is divided into three modules: command receiving, conversion, and transmission module. Secondly, according to the test-driven development mode, write a list of test cases and design test cases for each functional module in sequence. Then write the product code to make the test case pass. After the test is passed, refactor the code to eliminate duplication. After confirming the correctness of the product code and optimizing the code, write the following test case and the corresponding function code in the list until the code design of the entire module is completed.