Method for testing computer program
By using the debugger-controlled memory monitor on the embedded system and setting watchpoints and breakpoints to monitor the return address and stack base pointer of the subroutine, the problem of memory monitoring testing on the embedded system is solved and effective errors are achieved. Identification and security assurance.
Patent Information
- Application Number
- CN202410213607.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-02-28
- Filing Date
- 2024-02-27
- Publication Date
- 2024-08-30
AI Technical Summary
Existing technology makes it difficult to perform memory monitoring tests on embedded systems, resulting in an inability to effectively identify and correct errors that cause applications to fail, especially because the resource requirements of the sterilizer are too large or not suitable for embedded systems.
By using the memory monitor controlled by the debugger on the embedded system, setting observation points and breakpoints to monitor the return address and stack base pointer of the subroutine, memory monitoring does not require code instrumentation or emulator, and is suitable for many applications. situation.
It implements memory monitoring testing on embedded systems, can detect errors and ensure security, avoids the problem of excessive resource requirements, and is suitable for a variety of embedded platforms.
Smart Images

Figure CN118567971A
Abstract
Description
Technical Field
[0001] The present disclosure relates to a method for testing a computer program. Background Art
[0002] An important component of developing software applications is testing and, if errors are found, the corresponding error correction. In particular, errors that lead to application failures should be identified and corrected. An important aspect here is to test that important memory areas are not accessed unintentionally (or by an attacker), i.e. by memory monitoring, such as is done by so-called (memory) sanitizers. Compiling and testing software on common desktop and server hardware, such as x86, with the aid of various sanitizers is a measure to be able to discover previously long-undetected errors such as the Heartbleed vulnerability.
[0003] Especially for computer programs on embedded systems, such as vehicle control units, which are often safety-related, comprehensive testing, which also includes such memory monitoring, is particularly important. However, sanitizers for desktop and server hardware cannot be used for such systems, or can only be used poorly for such systems, because embedded systems usually have limited resources and the resource requirements of such sanitizers are high, so they cannot be used or can even affect the operation of the computer program so that errors occur in the first place.
[0004] Therefore, a method for testing a computer program that is capable of memory monitoring and that is suitable for embedded systems is desired. Summary of the invention
[0005] According to various embodiments, a method for testing a computer program is provided, comprising: executing the computer program until a subroutine is called; determining a storage location in a call stack where a return address or a stack base pointer of the called subroutine is stored; setting watchpoints to the determined storage location, setting breakpoints to the return command of the called subroutine, continuing to execute the computer program, and indicating that the computer program has an error if the set watchpoint has been triggered before one of the set breakpoints due to writing to the storage location.
[0006] The above method enables testing with a memory monitor on an embedded system with the aid of a debugger (i.e., using a sanitizer). This is particularly applicable in the case of testing with fuzz testing, since fuzz testing can also be implemented in a debugger-controlled manner and can be effectively used on embedded systems in this way.
[0007] Sanitizers can be implemented using code instrumentation. However, for this either source code needs to be available or instruction set specific instrumentation based on binaries (binary instrumentation) is required, which is very vulnerable. Alternative instrumentation based on emulators is also very platform specific and each embedded platform requires its own emulator. The above approach enables testing with a debugger controlled sanitizer and does not require instrumentation or emulation and is therefore applicable to many cases.
[0008] It should be noted that the above operation can be performed for both the return address and the stack base pointer, that is, these two storage locations can be monitored in the above manner to call the subroutine.
[0009] Various exemplary embodiments are given below.
[0010] Embodiment 1 is a method for testing a computer program as described above.
[0011] Embodiment 2 is a method according to embodiment 1, comprising: determining the storage location in the following manner: stopping the execution of the computer program at the command for calling the subroutine and stepping through the machine instructions (Befehl) that implement the command (Instruktion) for calling the subroutine until reaching the machine instruction for storing the return address or stack base pointer, and determining the storage location based on the machine command.
[0012] The call of a subroutine usually includes multiple machine instructions. These machine instructions are executed in sequence until an instruction is reached that stores a return address or a stack base pointer. The storage location can then be determined from this instruction. The execution can be stopped by setting a breakpoint to the instruction used for the call.
[0013] Embodiment 3 is a method according to embodiment 1 or 2, comprising: executing a computer program on an embedded system and setting watchpoints and breakpoints through a test system connected to the embedded system.
[0014] According to various embodiments, it is made possible in particular to test a computer program for an embedded system (including memory monitoring) on the embedded system itself.
[0015] Embodiment 4 is a method according to one of embodiments 1 to 3, comprising: selecting a set of subroutines, and for each subroutine in the selected set: executing a computer program until the subroutine is called, determining a storage location in a call stack storing a return address or a stack base pointer of the called subroutine, setting a watchpoint to the determined storage location, setting a breakpoint to the return command of the called subroutine, continuing to execute the computer program and indicating that the computer program has an error if the set watchpoint has been triggered before one of the set breakpoints due to writing to the storage location.
[0016] Therefore, the set of subroutines can be monitored for possible overlaps Its return address or its stack base pointer. For example, the selected set is subroutines (or at least parts thereof) that are called in another ("superior") subroutine.
[0017] Embodiment 5 is a method according to embodiment 4, comprising: setting a breakpoint on a subroutine of the selected subroutine set.
[0018] Therefore, the execution is automatically stopped when a subroutine is called, so that the storage location of the call stack in which the return address or stack base pointer of the called subroutine is stored can then be easily determined.
[0019] Embodiment 6 is a method according to one of embodiments 1 to 5, comprising: testing a computer program (e.g., on an embedded system) by performing fuzz testing using multiple test cases (e.g., through a test system), wherein each test case specifies a corresponding set of subroutines, and for each subroutine in the set specified for the test case, comprising: executing the computer program until the subroutine is called; determining a storage location in the call stack where a return address or a stack base pointer of the called subroutine is stored; setting a watchpoint to the determined storage location; setting a breakpoint to the return command of the called subroutine; continuing to execute the computer program, and indicating that the computer program has an error if the set watchpoint has been triggered before one of the set breakpoints due to writing to the storage location.
[0020] Thus, memory monitoring can be part of fuzz testing, where the fuzzer can select subroutines to be monitored, thereby being able to find errors in overwriting return addresses or stack base pointers of subroutines of the computer program for many different inputs to the computer program and the computer program, even if only a certain number of breakpoints and watchpoints are available on the (e.g. embedded) system on which the computer program is executed.
[0021] Embodiment 7 is a method according to one of embodiments 1 to 6, comprising: deleting a watchpoint when one of the set breakpoints is triggered.
[0022] Then, the triggering of a watchpoint can only occur before the triggering of one of the breakpoints and can therefore be interpreted as an error without further checking.
[0023] Embodiment 8 is a method according to one of embodiments 1 to 7, wherein the computer program is a control program for a robotic device and the robotic device is controlled using the computer program depending on the result of testing the computer program.
[0024] In other words, a method for controlling a robotic device may be provided in which safety with respect to overwriting of a return address and / or a stack base pointer is ensured by testing using a sanitizer.
[0025] Embodiment 9 is a testing device configured to perform the method according to one of embodiments 1 to 8.
[0026] Embodiment 10 is a computer program having instructions, which, when executed by a processor, cause the processor to perform the method according to any one of embodiments 1 to 8.
[0027] Embodiment 11 is a computer-readable medium storing instructions, which, when executed by a processor, cause the processor to perform the method according to one of embodiments 1 to 8. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In the drawings, like reference numerals generally refer to the same parts in the different views of the whole. The drawings are not necessarily to scale, but emphasis is generally placed on representing the principles of the invention. In the following description, various aspects are described with reference to the following drawings.
[0029] Figure 1 A computer for developing and / or testing software applications is shown.
[0030] Figure 2 A flow chart is shown which represents a method for testing a computer program according to one embodiment.
[0031] The accompanying drawings to which the following detailed description relates illustrate specific details and aspects of the disclosure in which the present invention may be implemented for the purpose of explanation. Other aspects may be used and structural, logical and electrical changes may be performed without departing from the scope of protection of the present invention. Various aspects of the present disclosure are not necessarily mutually exclusive, as some aspects of the present disclosure may be combined with one or more other aspects of the present disclosure to form new aspects.
[0032] Various examples are described in more detail below. DETAILED DESCRIPTION
[0033] Figure 1A computer 100 is shown for use in developing and / or testing software applications.
[0034] The computer 100 has a CPU (Central Processing Unit) 101 and a work memory (RAM) 102. The work memory 102 is used to load a program code from a hard disk 103, for example, and the CPU 101 executes the program code.
[0035] It is assumed in this example that the user intends to use computer 100 to develop and / or test software applications.
[0036] To this end, the user runs the software development environment 104 on the CPU 101 .
[0037] The software development environment 104 enables users to develop and test applications 105 for various devices 106, i.e., target hardware, such as embedded systems for controlling robotic devices (including robot arms and autonomous vehicles) or for mobile (communication) devices. For this purpose, the CPU 101 can run an emulator as part of the software development environment 104 to simulate the behavior of the corresponding device 106 for which the application is or has been developed. The software development environment 104 can also be regarded as or designed as a software testing environment if it is only used to test software from another source.
[0038] The user can distribute the finished application to the respective devices 106 via the communication network 107. Instead of via the communication network 107, this can also be done in another way, for example using a USB stick.
[0039] Before this happens, however, users should test applications 105 to avoid distributing applications to devices 106 that do not function properly.
[0040] One testing method is so-called fuzz testing. Fuzz testing or Fuzz testing (fuzz testing) is an automated software testing method in which invalid, unexpected or random data is fed as input to the computer program to be tested. The program is then monitored for anomalies such as crashes, missing failed built-in code assertions or potential memory leaks.
[0041] Typically, fuzzers (i.e., test programs using fuzz testing) are used to test programs that process structured inputs. The structure is specified, for example, in terms of a file format or file format or protocol and distinguishes between valid and invalid inputs. An effective fuzzer produces semi-valid inputs that are "valid enough" so as not to be rejected outright by the input parser of the program under test, but "invalid enough" to reveal unexpected behavior and edge cases that are not properly handled in the program under test.
[0042] The following describes the terms used in the context of fuzz testing:
[0043] Fuzz testing or fuzz testing is an automated testing process that sends randomly generated inputs to the target program (the program under test) and observes its response.
[0044] A fuzzer or fuzzing engine is a program that automatically generates inputs. Therefore, it is not linked to the software under test and does not perform instrumentation. However, it has the ability to instrument code, generate test cases and execute the program under test. Well-known examples are afl and libfuzzer.
[0045] A fuzz test target is a software program or function that should be tested by fuzz testing. One main feature of a fuzz test target should be that it potentially accepts untrusted inputs generated by the fuzzer during the fuzz testing process.
[0046] A Fuzz-Test is a combined version of a Fuzzer and a Fuzz-Target. The Fuzz-Target can then be instrumented code, in which case the Fuzzer is linked to (i.e. provides) its input. Fuzz-Tests are executable. The Fuzzer can also start, observe and stop multiple Fuzz-Tests (typically hundreds or thousands per second), where each Fuzz-Test uses slightly different inputs generated by the Fuzzer.
[0047] A test case is a specific input and a specific test run from the fuzz test. Usually, the process of interest for reproducibility (discovery of new code paths or crashes) is stored. In this way, a specific test case with the corresponding input can also be executed on a fuzz test target that is not connected to the fuzzer, such as a release version of the program.
[0048] Coverage-guided fuzzing uses code coverage information as feedback during fuzz testing to identify whether an input causes a new code path or block to be executed.
[0049] Generation-based fuzzing uses prior knowledge about the target program (fuzz test target) to create test inputs. An example of such prior knowledge (Vorwissen) is a grammar that matches the input specification of the fuzz test target, i.e., the input grammar of the fuzz test target (i.e., the program to be tested).
[0050] Static instrumentation is the insertion of commands into a program (to be tested) to obtain feedback about the execution. It is usually implemented by a compiler and can, for example, describe the code blocks reached during the execution.
[0051] Dynamic instrumentation is the control of the execution of a program (to be tested) during runtime in order to generate feedback from the execution. It is usually implemented through the system functionality of an operating system or by using an emulator.
[0052] A debugger is a device or program that can control a target device or target program and can provide a number of functions, such as for calling register or memory values and pausing and executing the target program in various steps.
[0053] Setting breakpoints at instructions of the target program or device by means of a debugger so that when they are reached, the execution is stopped and the process to be controlled is notified of this.
[0054] A data watchpoint is set to a storage address of a target program or a target device by a debugger so that the execution is stopped when the storage address is accessed, and the process to be controlled is notified of this situation by triggering an interrupt.
[0055] Embedded systems usually have a microcontroller that processes inputs and responds with outputs to fulfill specific tasks. Although microcontrollers use the same memory model as regular user programs and are programmed in the same programming language, their programs are much more difficult to test. To enable debugging, microcontrollers usually offer the possibility to interrupt the program using breakpoints (stop points), run program instructions in individual steps, and set watchpoints on memory addresses. Watchpoints trigger an interrupt when the corresponding memory area is accessed. Hardware breakpoints and watchpoints are usually implemented as physical registers in the debug unit of the microcontroller, so their number is limited and depends on the corresponding system. For example, the maximum number for a typical microcontroller is four breakpoints and two data watchpoints. Usually watchpoints can distinguish between read access and write access.
[0056] In particular, breakpoints and watchpoints can be used to implement debugger-driven fuzz testing, thus eliminating the need for any instrumentation.
[0057] Fuzz testing, also known as debugger-driven fuzz testing, can be very effective in finding bugs that trigger observable behavior, such as crashes or reboots. However, not all types of bugs can be observed because the program will fail silently. An example is the Heartbleed vulnerability. The nature of the Heartbleed vulnerability is that it only reads beyond the bounds of an array, while writes result in segmentation faults that are easily observable.
[0058] The Heartbleed vulnerability was only discovered with the help of Address Sanitizer (ASan). ASan inserts additional instructions, metadata, and checks during program compilation to prevent errors in storage corruption. When such sanitization instructions are available in a program, more bugs can be found when debugging the program than without the sanitizer. In particular, automated testing such as fuzz testing works well when a sanitizer is available in the program under test (i.e., the fuzz target) to find additional bugs.
[0059] For embedded systems, such as data processing devices with ARM architecture, such sanitizers are not as easy to use as for standard platforms (such as x86 platforms). There are several reasons for this:
[0060] Embedded systems are resource-limited for implementing sanitizers. For example, Asan requires twice the memory, MSan (MemorySanitizer) requires 2.5 times the resources, and UBSan (UndefinedBehaviorSanitizer) even requires three times the program's working memory.
[0061] Sanitizers increase the size of compiled binaries. In the automotive industry, the size of such binaries is often close to the available flash memory of the target hardware. Therefore, the additional instrumentation of sanitizers does not fit in flash memory.
[0062] The use of sanitizers can result in slower runtimes of binaries on the hardware due to the additional instrumentation of sanitizers and the collection and tracking of metadata. Embedded systems rely heavily on asynchronous events, such as interrupts, and sanitizers can cause false positives based on timing, i.e. sanitizers can introduce new errors during runtime.
[0063] Embedded systems usually do not have a user interface for displaying runtime errors. For example, on x86 systems, segmentation faults are passed to STDERR, making the crash visible to the user. Embedded systems, on the other hand, fail silently, i.e. the user does not notice, and reboot after a crash.
[0064] According to various embodiments, a process is thus provided that enables memory monitoring (i.e., sanitizer functionality) for embedded systems, and in particular enables memory monitoring for debugger-driven fuzz testing. Here, memory monitoring itself can be implemented with the help of a debugger (or a debugger for fuzz testing).
[0065] In debugger-based fuzz testing, the interaction between the system performing the test (e.g., corresponding to computer 100) and the target system (target hardware, such as an embedded system, such as target device 106) is carried out via a debug connection (i.e., debug interface), wherein the debug connection is provided, for example, by a dedicated debugger hardware device. Test input data is transmitted to the target system 106 in the form of input vectors, for example via WiFi or CAN bus (depending on the type of target device 106), i.e., the communication network 107 is such a debug connection in the test (when distributing the tested software, the communication network can then be any other communication network). The system performing the test, hereinafter also referred to as test system 100, controls the execution of the target program (i.e., the program to be tested) in the target system via the debug connection, i.e., starts the execution and resumes the execution after an interrupt (in particular, an interrupt triggered by a data observation point).
[0066] A debugger driven sanitizer does not require instrumentation or emulation, but only a debug interface to a target system (e.g. an embedded system on which the software is executed) with the possibility to set breakpoints and watchpoints. Debug interfaces and debugging capabilities of said type are generic and further available, resulting in a wide and easy applicability of the processing approach described below. Furthermore, there is only a small load on the memory of the target system, e.g. for metadata, since most of the information related to the sanitizer is collected and stored on the host side of the debugger (i.e. in the test system 100). The size of the compiled binary file of the target program is not increased, since it can be used in the test just as it is specified for use with the target system 106.
[0067] The debugger stops the target system when a breakpoint is reached. Therefore, the handling described below leads to time-based false alarms only in rare cases. These false alarms can also be eliminated by other testing techniques, such as by subsequently verifying the found bug on the target system. Using a debugger can also provide a clear understanding of the internal structure of the target system.
[0068] The process described below is used for memory monitoring, i.e., detecting undesired writing or reading of memory areas by the program under test. A computer program consists of instructions that act on the memory. In order to avoid unintentional concurrent use of the memory space, the memory is usually divided into different areas, namely the stack, the heap, and the static memory.
[0069] The stack (here referred to as the call stack) is a growing storage area that provides space for subroutines' local variables. Each function has its own storage area on the stack. Stack memory is allocated by decrementing the stack pointer (contiguous memory). Stack frames for called functions are allocated by decrementing the stack base pointer and the stack pointer.
[0070] In C, for example, the required memory size is allocated to the storage area of the heap memory by calling the malloc, realloc or calloc function, and the allocated storage area is released again using the free function, and can be reused in subsequent allocation requests. The heap memory is usually used for long-term variables shared between different functions.
[0071] For correct program execution, it is important not to exceed the bounds of allocated memory. Ensuring correct memory access in memory-unsafe languages such as C and C++ is the programmer's responsibility. Ignoring the bounds of allocated memory may lead to serious security incidents, such as remote code execution or data leakage.
[0072] According to one embodiment, in order to identify a stack overflow, in particular a dangerous overwrite of a return address of a subroutine (function, method or procedure), an observation point is used to monitor the corresponding storage location, i.e. the storage location of the stack's storage return address. In the following, an observation point refers to a write observation point, i.e. an observation point that is triggered when writing to a storage location (but not necessarily when reading), since an overwrite should be determined. However, the following observation point can be used, which is triggered when writing and reading and when it is triggered is checked whether the write is actually the cause. The storage location stores words with a word length that depends on the corresponding architecture (e.g., 32 bits) and is identified by a corresponding address.
[0073] It is assumed below that the test system 100 (possibly based on user input) selects one or more subroutines from which all subsequent methods are protected. The test system 100 performs the following operations for each selected subroutine:
[0074] 1. Set breakpoints (i.e., stop points) to all subroutine call instructions (i.e., "call" instructions) (or selected parts) in the selected subroutine.
[0075] 2. Start the selected subprogram.
[0076] 3. If an interrupt occurs (due to one of the set breakpoints), execute step by step forward until the current stack frame (i.e., the calling stack frame whose breakpoint anticipated the interrupt) is stored on the stack (this can be done by the calling subroutine or the called subroutine, depending on architectural conventions).
[0077] 4. Set the write watchpoint to the stored return address (ie, the return address closest to the current stack boundary).
[0078] 5. Set breakpoints at each return instruction (i.e., "return" command) of the called subroutine.
[0079] 6. If a write watchpoint is triggered before the return instruction of the called subroutine is reached, it may happen that the return address is accidentally overwritten. In this case, the test system 100 therefore indicates that an error has occurred, which in turn can trigger the execution of safety measures.
[0080] Alternatively, if no watchpoints are available (e.g. because only a limited number are available and they are already used for other return addresses), the stored return address may also be checked before the return instruction is reached. Since the number of breakpoints and watchpoints on an embedded system may be limited, not all called subroutines may be able to be tested in the above manner. If this is the case, a subset of subroutine calls that are tested is, for example, randomly selected, or these subroutine calls are tested successively in multiple runs of the target program.
[0081] In addition, not only the return address can be protected in this way, but also, for example, the stack base pointer of the called subroutine can be protected. The stack base pointer is also stored on the stack. Table 1 shows a typical structure of a stack frame for a called subroutine. Each row represents a storage location.
[0082]
[0083] Table 1
[0084] In general, according to various embodiments, Figure 2 The method shown.
[0085] Figure 2 A flow chart 200 is shown which represents a method for testing a computer program according to one embodiment.
[0086] In 201 , a computer program (to be tested) is executed until a subroutine is called.
[0087] At 202, a storage location of a call stack (eg, a corresponding address in a memory of a system executing a computer program) is determined where a return address or a stack base pointer of a called subroutine is stored.
[0088] In 203, the watch point is set to the determined storage location.
[0089] In 204, a breakpoint is set to the return command of the called subroutine.
[0090] In 205, the computer program continues to execute and indicates that the computer program has an error if the set watchpoint has been triggered before one of the set breakpoints due to writing to the memory location. This can be done, for example, by performing a corresponding check when the watchpoint is triggered, or simply by deleting the watchpoint (possibly automatically) when one of the breakpoints is triggered. Thus, the triggering of the watchpoint can only occur before the triggering of one of the breakpoints.
[0091] According to various embodiments, the method can be automatically performed by a test tool (i.e., a test program) running on a test system, in particular a test tool used by or included in a fuzz testing program. Therefore, the above method (and its various embodiments described herein) can be automatically (and repeatedly) performed within the scope of fuzz testing (performed by the fuzz testing program).
[0092] Figure 2 The method can be performed by one or more computers having one or more data processing units. The term "data processing unit" can be understood as any type of entity capable of implementing data or signal processing. For example, data or signals can be processed according to at least one (i.e., one or more) specific functions performed by the data processing unit. The data processing unit can be an analog circuit, a digital circuit, a logic circuit, a microprocessor, a microcontroller, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), a programmable gate array integrated circuit (FPGA), or any combination thereof or formed thereby. Any other means for implementing the corresponding functions described in more detail herein can also be understood as a data processing unit or a logic circuit device. One or more of the method steps performed by the data processing unit described in detail herein can be performed (e.g., implemented) by one or more specific functions performed by the data processing unit.
[0093] Figure 2The processing method is used for testing programs, for example control software for robotic devices. The term "robotic device" can be understood to refer to any technical system, such as a computer-controlled machine, a vehicle, a household appliance, a power tool, a manufacturing machine, a personal assistant or an access control system. The control software can also be used for data processing systems, such as navigation devices.
[0094] Figure 2 The method is for example performed by a test device (e.g., Figure 1 The computer 100 and the target device 106 are executed.
[0095] Although specific embodiments have been illustrated and described herein, it will be appreciated by those skilled in the art that the specific embodiments shown and described may be replaced by various alternative and / or equivalent implementations without departing from the scope of the invention. This application is intended to cover any adaptation or variation of the specific embodiments discussed herein. Therefore, the present invention is intended to be limited only by the claims and their equivalents.
Claims
1. A method for testing a computer program, comprising: Execute a computer program until a subroutine is called; Determining a storage location in a call stack where a return address or a stack base pointer of a called subroutine is stored; Setting the observation point to the determined storage location; Set the breakpoint to the return command of the called subroutine; continuing to execute the computer program; and If the set watchpoint is triggered before one of the set breakpoints due to writing to the memory location, this indicates that the computer program has an error.
2. The method according to claim 1, comprising: The storage location is determined by stopping execution of the computer program at a command for calling the subroutine and stepping through machine instructions implementing the command for calling the subroutine until a machine instruction storing the return address or stack base pointer is reached, and determining the storage location based on the machine instruction.
3. The method according to claim 1 or 2, comprising: The computer program is executed on an embedded system and the watchpoints and the breakpoints are set by a test system connected to the embedded system.
4. The method according to any one of claims 1 to 3, comprising: Select a set of subroutines, and for each subroutine in the selected set: executing the computer program until the subroutine is called, Determine the storage location in the call stack where the return address of the called subroutine or the stack base pointer is stored, Set the observation point to the determined storage location, Set the breakpoint at the return command of the called subroutine. Execution of the computer program is continued and an error in the computer program is indicated if the set watchpoint has been triggered prior to one of the set breakpoints due to writing to the memory location.
5. The method according to claim 4, comprising: Set a breakpoint on a subroutine in the selected subroutine set.
6. The method according to any one of claims 1 to 5, comprising: Testing the computer program by fuzz testing with a plurality of test cases, wherein each test case specifies a corresponding set of subroutines, and for each subroutine in the set specified for the test case, comprising: executing the computer program until the subroutine is called; Determining a storage location in a call stack where a return address or a stack base pointer of a called subroutine is stored; Setting the observation point to the determined storage location; Set the breakpoint to the return command of the called subroutine; continuing to execute the computer program, and In the event that the set watchpoint has been triggered prior to one of the set breakpoints due to writing to the memory location, an error is indicated in the computer program.
7. The method according to any one of claims 1 to 6, comprising: The watchpoint is deleted when one of the set breakpoints is triggered.
8. The method according to any one of claims 1 to 7, wherein the computer program is a control program for a robotic device and the robotic device is controlled using the computer program depending on the result of testing the computer program.
9. A testing device, the testing device being configured to perform the method according to any one of claims 1 to 8.
10. A computer program having instructions which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 8.
11. A computer readable medium storing instructions which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 8.
