DE102010014720A1 - Method for verifying code of target program used for software for automotive electronics for engine, involves comparing output test variables corresponding to each program section of target program and program code - Google Patents

Method for verifying code of target program used for software for automotive electronics for engine, involves comparing output test variables corresponding to each program section of target program and program code Download PDF

Info

Publication number
DE102010014720A1
DE102010014720A1 DE201010014720 DE102010014720A DE102010014720A1 DE 102010014720 A1 DE102010014720 A1 DE 102010014720A1 DE 201010014720 DE201010014720 DE 201010014720 DE 102010014720 A DE102010014720 A DE 102010014720A DE 102010014720 A1 DE102010014720 A1 DE 102010014720A1
Authority
DE
Germany
Prior art keywords
program
test
target
output
target program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
DE201010014720
Other languages
German (de)
Inventor
Carsten-Stephen Kulkwitz
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
IAV GmbH Ingenieurgesellschaft Auto und Verkehr
Original Assignee
IAV GmbH Ingenieurgesellschaft Auto und Verkehr
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by IAV GmbH Ingenieurgesellschaft Auto und Verkehr filed Critical IAV GmbH Ingenieurgesellschaft Auto und Verkehr
Priority to DE201010014720 priority Critical patent/DE102010014720A1/en
Publication of DE102010014720A1 publication Critical patent/DE102010014720A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A test plan is created for functional modules of source model (Q) for analyzing functional and worth-dependent association between output and input variables (AM,EM). The input/output test variables (ET-T,AT-T) from test plan (T) are assigned for each functional module. Each program section of target program (Z) is executed and input test variables are processed. The output test variables (AT-P-Z,AT-T) corresponding to each program section of target program and program code (P) are compared. The error in program section of target program is determined if comparison result is not affirmative.

Description

Technisches GebietTechnical area

Die Erfindung betrifft ein Verfahren zum Verifizieren eines aus einem Quellmodell generierten Zielprogramms.The invention relates to a method for verifying a target program generated from a source model.

Stand der TechnikState of the art

Die Anforderungen in der Automobilelektronik, Software für Motor- oder auch anderweitige Triebstrangsteuergeräte bzw. Komfortsteuergeräte zu erstellen, wachsen mit fortschreitender Komplexität. Es wird daher im Bereich der Automobilelektronik die Strategie verfolgt, die Software modellbasiert unter Verwendung der automatischen Codegenerierung zu erzeugen.The requirements in the automotive electronics, software for engine or other powertrain control devices or comfort control devices to create grow with increasing complexity. It is therefore pursued in the field of automotive electronics strategy to generate the software model-based using automatic code generation.

Dieser Ansatz der Softwareerzeugung erfordert aufgrund der stetig wachsenden funktionalen Komplexität im Hinblick auf die Absicherungsmaßnahmen ebenfalls neue innovative Maßnahmen, um der erzeugten Steuergeräte-Software mit geeignet rationellen Instrumenten unter dem Gesichtspunkt der Serieninbetriebnahme und des Dokumentationsaufwandes kostenbewusst zu begegnen.Due to the steadily growing functional complexity with regard to the safeguarding measures, this approach to software production also requires new innovative measures to cost-effectively address the generated ECU software with suitable rational instruments from the point of view of series commissioning and documentation effort.

Eine modellbasierte Steuergeräte-Software besteht in der Regel aus mindestens zwei Teilen. Ein Teil wird von der Modellsoftware ausgefüllt und enthält traditionell die physikalischen Lösungen für das Anwendungsgebiet und wird von den Funktionsentwicklern entwickelt und aus physikalischer Sicht getestet. Der andere Teil wird Basis-Software genannt und enthält in der Regel das Betriebssystem, Diagnosedienstfunktionen und die Treiberanteile, die aus der Sicht der Softwareerzeugung nicht oder nur mit erheblichen und umständlichen Modellierungen in der Modellwelt realisiert werden könnten. Der Aufwand kann als unverhältnismäßig gegenüber manuell erzeugten Lösungen angesehen werden.Model-based ECU software usually consists of at least two parts. One part is filled in by the model software and traditionally contains the physical solutions for the application area and is developed by the functional developers and physically tested. The other part is called basic software and usually contains the operating system, diagnostics service functions and the driver parts, which could not be realized from the point of view of software generation or only with considerable and cumbersome modeling in the model world. The effort can be considered disproportionate to manually generated solutions.

Gleichgültig, ob die Software-Bestandteile manuell oder automatisch erstellt worden sind, müssen sie in geeigneter Weise getestet werden. Hier unterscheidet man in der Automobilelektronik die modellbasierte Funktionsentwicklung unter Verwendung der Codegenerierung und die Softwareerstellung und -integration.Regardless of whether the software components have been created manually or automatically, they must be tested appropriately. In automotive electronics, a distinction is made here between model-based functional development using code generation and software creation and integration.

Der Softwaretest soll im Zusammenhang mit der automatisch modellbasierten Codegenerierung die Beanstandungsfreiheit der Berechnungen zwischen dem Modell und der auf dem Steuergerät übertragenen Software überprüfen und feststellen. Dabei sollen Fehler in der Toolkette oder in der Hardware des Mikrocontrollers, die sich häufig selbst noch im Entwicklungsprozess befinden, aufgespürt werden.The software test, in connection with the automatic model-based code generation, should check and determine the freedom of the calculations between the model and the software transmitted on the control unit. In the process, errors in the tool chain or in the hardware of the microcontroller, which are often themselves still in the development process, can be detected.

Bisher hat man im Automobilelektronikumfeld das elektronische Steuergerät mit einer Mess- und Verstellsystemanbindung, beispielsweise via XCP in vielfältigen Ausführungen, ausgerüstet, über das kommerzielle Mess- und Verstellsysteme, beispielsweise INCH, CANAPE, CalDesk, bestimmte Erfassungs- und Manipulationsmöglichkeiten hergestellt. Der Softwaretester bedient sich dieser Infrastruktur, um die einwandfreie Softwarefunktion zu verifizieren. Der Zugang zur Modellsoftware und die daraus resultierende Testbarkeit hängen im erheblichen Umfang von der seitens des Modells zur Verfügung gestellten Mess- und Verstellwerte-Definition ab. Der Funktionsentwickler, der üblicherweise die Physik unter Simulink abbildet, muss für eine umfassende und vollständige Absicherung der Software eine umfangreiche Unterstützung vorsehen, die in der Regel einen Mehraufwand, der erheblich über das funktional Notwendige hinausgeht, erforderlich macht. Unter der Diskrepanz zwischen zusätzlich erforderlicher Test-Modellierung und physikalischer funktioneller Notwendigkeit steht der Software-Tester in unbeeinflussbarer Abhängigkeit vom Funktionsentwickler. Der Funktionsentwickler muss Aufgaben zur Herstellung dieser Testinfrastruktur ausführen, die sich erst im nachfolgenden Testprozess rechnen werden.So far, in the automotive electronics environment, the electronic control unit with a measurement and Verstellsystemanbindung, for example, via XCP in various versions equipped, made on the commercial measurement and adjustment systems, such as INCH, CANAPE, CalDesk, certain detection and manipulation options. The software tester uses this infrastructure to verify the flawless software function. The access to the model software and the resulting testability depend to a considerable extent on the measurement and calibration values provided by the model. The feature developer, who typically replicates Simulink physics, must provide extensive support for comprehensive and complete software protection, typically requiring additional overhead that goes far beyond what is functionally essential. Under the discrepancy between additionally required test modeling and physical functional necessity, the software tester is uninfluenceably dependent on the functional developer. The functional developer must perform tasks to build this test infrastructure, which will only pay off in the subsequent test process.

Dies erfordert von der Steuergerätesoftware bestimmte Programmteile, die stets durchgeführt bzw. gerechnet werden müssen, damit die informationsverarbeitenden Programme mit Informationen versorgt werden.This requires the programmer software certain program parts that must always be performed or expected, so that the information-processing programs are supplied with information.

Diese beansprucht einerseits die Systemrechenlast mit Arbeiten, die zur Funktion der Steuergerätesoftware nicht zwingend erforderlich wären.This claimed on the one hand, the system computational burden with work that would not be mandatory for the function of the ECU software.

Andererseits muss innerhalb der Modellsoftware (den Modellen) zusätzlicher Aufwand getrieben werden, damit diese Informationszugriffsart durch das Testsystem unterstützt wird. Es wird einerseits eine zwingend erforderliche Modularisierung notwendig und andererseits ist eine Bypassmodellierung an der Ausgangsseite der Module erforderlich, damit die nicht in Echtzeit durchgeführte Einspeisung von Stimulationstestvektoren von vorhergehenden Modulen ermöglicht wird.On the other hand, additional effort must be expended within the model software (models) for this information access type to be supported by the test system. On the one hand, a mandatory modularization is necessary and on the other hand, a bypass modeling at the The output side of the modules is required to allow non-real-time injection of stimulus test vectors from previous modules.

Dieser zusätzliche modelltechnische Aufwand kostet zusätzliche Prozessorsrechenzeit und Prozessorressourcen. Die Arbeitszeit des Funktionsentwicklers zur Erzeugung der Testinfrastruktur erfordert ebenfalls erhöhten Aufwand, der lediglich in der nachfolgenden Testphase erforderlich ist.This additional model-technical effort costs additional processor computation time and processor resources. The working time of the functional developer to generate the test infrastructure also requires increased effort, which is required only in the subsequent test phase.

Aus der DE 10 2004 014 290 A1 ist ein Verfahren zur Erstellung von Abläufen zum Testen von Software, die aus Datenflussmodellen erstellt wurde und die mittels eines Datenverarbeitungsgeräts und einer ausführbaren Testfallgenerator-Software automatischen Testbedingungen unterzogen wird, bekannt.From the DE 10 2004 014 290 A1 is a method for creating procedures for testing software that has been created from data flow models and that is subjected to automatic test conditions by means of a data processing device and an executable test case generator software.

Durch die Tesffallgenerator-Software wird für die zu überprüfende Software ein Testplan, bestehend aus einzelnen Testfällen, erzeugt.The Tesffallgenerator software generates a test plan consisting of individual test cases for the software to be tested.

Für jeden Modellblock werden testrelevante Algorithmen in Form eines Testfallalgorithmus und eines Rückverfolgungsalgorithmus implementiert.For each model block, test-relevant algorithms are implemented in the form of a test case algorithm and a traceback algorithm.

Bei jedem Testfall wird einem Modellblock durch den Testfallalgorithmus ein Wertebereich für jedes seiner Eingangssignale zugeordnet.In each test case, a range of values for each of its input signals is assigned to a model block by the test case algorithm.

Ein jeder solcher Wertebereich wird mittels des Rückverfolgungsalgorithmus im zu testenden System durch die einzelnen Blöcke bis zu den Eingängen des zu testenden Systems verfolgt. Die Ergebnisse werden überprüft und gespeichert.Each such range of values is tracked by the traceback algorithm in the system under test through the individual blocks to the inputs of the system under test. The results are checked and saved.

Aufgabe der ErfindungObject of the invention

Der Erfindung liegt die Aufgabe zugrunde, ein Verfahren zum Verifizieren eines aus einem Quellmodell generierten Zielprogramms bereitzustellen, welches einen vollständigen softwareseitigen Funktionstest aufgrund von modellbasiert erstellten Spezifikationen gewährleistet.The object of the invention is to provide a method for verifying a target program generated from a source model, which ensures a complete software-side functional test on the basis of model-based specifications.

Lösung der AufgabeSolution of the task

Die Aufgabe wird durch ein Verfahren gemäß Anspruch 1 gelöst.The object is achieved by a method according to claim 1.

Vorteile der ErfindungAdvantages of the invention

Das erfindungsgemäße Verfahren berücksichtigt zum Verifizieren der Software die Modularisierung von Quellmodell und Zielprogramm. Die Modularisierung des Quellmodells ist in sequentieller Anordnung auch im Zielprogramm vorhanden, so dass einzelne Funktionsmodule (Modelle) des Quellmodells als Funktionen des Zielprogramms im Arbeitsspeicher lokalisierbar sind und während der Abarbeitung der Software unter Testbedingungen auswählbar sind. Es ist damit möglich, die modulweise aus dem physikalisch basierten Quellmodell gewonnenen Testinformationen (Testvektoren und zugehörige Ausgangswerte) für die Module des Zielprogramms anzuwenden. Eine möglichst vollständige Testabdeckung kann so erreicht werden, wobei der Code des Zielprogramms in binärer Form auf der Zielhardware getestet wird. Eine Anbindung an eine Hardware in the Loop-Simulationsumgebung ist dabei nicht notwendig.The inventive method takes into account the modularization of source model and target program for verifying the software. The modularization of the source model is also present in the target program in a sequential arrangement, so that individual function modules (models) of the source model can be localized as functions of the target program in the working memory and can be selected during the execution of the software under test conditions. It is thus possible to apply the test information (test vectors and associated output values) obtained module-by-module from the physically based source model for the modules of the target program. As complete a test coverage as possible can be achieved, whereby the code of the target program is tested in binary form on the target hardware. A connection to a hardware in the loop simulation environment is not necessary.

Ein Quellmodell kann wie beschrieben aus mehreren Funktionsmodulen bestehen. Alternativ entspricht ohne unterteilende Modularisierung der gesamte Inhalt eines Quellmodells einem Funktionsmodul, was jedoch die Organisation einer Softwareentwicklung und Testung erschwert. Das erfindungsgemäße Verfahren ist jedoch auch ohne unterteilende Modularisierung anwendbar.A source model can consist of several function modules as described. Alternatively, without subdivision modularization, the entire content of a source model corresponds to a functional module, but this complicates the organization of software development and testing. However, the method according to the invention can also be used without subdivision modularization.

In zwei Schritten wird aus einer vorzugsweise graphisch unterstützten Entwicklungsumgebung aus dem physikalisch basierten Quellmodell ein Programmcode, beispielsweise ein C-Code generiert, aus dem wiederum für die Zielhardware der Binärcode des Zielprogramms erzeugt wird. Der Test der physikalischen Funktion der Modelle kann mit einer geeigneten Simulation auf der Ebene der graphisch unterstützten Entwicklungsumgebung erfolgen. Testvektoren für die Modelle können gleichfalls aus den in der Entwicklungsumgebung vorliegenden Modellen, beispielsweise nach DE 10 2004 014 290 A1 , erzeugt werden, wobei diese Testvektoren im Zielprogramm auf der Zielhardware an der entsprechenden Abarbeitungsposition geladen werden, so dass ein modulweiser an den Funktionen des Quellprogramms orientierter Softwaretest erfolgt.In two steps, a program code, for example a C code, is generated from a preferably graphically supported development environment from the physically based source model, from which in turn the target program's binary code is generated. The physical function test of the models can be done with a suitable simulation at the level of the graphically supported development environment. Test vectors for the models can also be obtained from the models present in the development environment, for example DE 10 2004 014 290 A1 , are generated, wherein these test vectors are loaded in the target program on the target hardware at the corresponding processing position, so that a module-oriented based on the functions of the source program software test takes place.

Durch das zweimalige Generieren können „Übersetzungsfehler” auftreten, die zu einer Verfälschung des jeweiligen Programmcodes führen können. Weiterhin kann die Handware, beispielsweise ein Mikrocontroller eines Steuergeräts, fehlerhaft sein, die zu einem fehlerhaften Ausführen des Programmcodes führen kann. The two-time generation can cause "translation errors" that can lead to a falsification of the respective program code. Furthermore, the handware, for example, a microcontroller of a controller, be faulty, which can lead to incorrect execution of the program code.

Aus diesen Fehlerquellen, die software- und/oder hardwareseitig vorliegen können, resultieren fehlerhafte Berechnungswerte der Ausgangsvariablen des Zielprogramms oder ggf. ein Nichtausführen eines Zielprogrammteils. Um das Zielprogramm auf diese Fehlerquellen hin zu verifizieren, werden für die Eingangsvariablen eines modularisierten Programmteils des Zielprogramms Eingangstestwerte zur Stimulation eingeschrieben. Die Eingangstestwerte werden bei der Ausführung des Programmteils gemäß dem Programmcode verarbeitet. Am Ende der Ausführung des Programmcodes werden die Ausgangstestwerte (d. h. ausgangsseitige Berechnungsergebnisse) der Ausgangsvariablen ausgelesen. Die Eingangstestwerte entsprechen dabei den aus dem Quellmodell generierten Testvektoren.From these error sources, which may be present on the software and / or hardware side, result in erroneous calculation values of the output variables of the target program or possibly a non-execution of a target program part. To verify the target program for these sources of error, input test values for stimulation are written to the input variables of a modularized program part of the target program. The input test values are processed according to the program code during execution of the program part. At the end of execution of the program code, the output test values (i.e., output-side calculation results) of the output variables are read out. The input test values correspond to the test vectors generated from the source model.

Jeder ausgelesene Ausgangstestwert (Istwert) wird mit einem Ausgangstestwert (Sollwert) des Testplans verglichen. Eine erfolgreiche Verifizierung, d. h. eine fehlerlose Generierung des Zielprogramms aus dem Quellmodell, liegt bei einer Übereinstimmung innerhalb eines vorher festzulegenden Toleranzbandes beider Werte vor. Bei erforderlicher exakter Übereinstimmung muss die Bandbreite auf 0 gesetzt werden.Each readout output value (actual value) is compared with an output test value (setpoint) of the test plan. A successful verification, d. H. A flawless generation of the target program from the source model, is in a match within a previously set tolerance band of both values. If exact match is required, the bandwidth must be set to 0.

Die Eingangstestwerte (Stimulation) und Ausgangstestwerte (Ergebnisse, Sollwerte) werden anhand eines Testplans erstellt. Der Testplan umfasst eine Analyse einer funktionalen und wertabhängigen Zuordnung zwischen den Eingangsvariablen und den Ausgangsvariablen eines modellbasiert erstellten Funktionsmoduls. Ein derartiges Verfahren ist beispielsweise in der DE 10 2004 014 290 A1 offenbart. Eine alternative Testplangenerierung kann aus der Berechnung (Simulation) der Modelle innerhalb der Modellierungsplattform erfolgen. Die Testplangenerierung führt jeweils zu Stimulationen und Sollwerten der Ergebnisse, welche die funktionale Validierung des Funktionsmoduls gegen die Vorgaben, beispielsweise aus einer Lastenheftanforderung des Auftraggebers, ermöglichen.The input test values (stimulation) and output test values (results, setpoints) are generated using a test plan. The test plan includes an analysis of a functional and value-dependent mapping between the input variables and the output variables of a model-based function module. Such a method is for example in the DE 10 2004 014 290 A1 disclosed. An alternative test plan generation can be done from the calculation (simulation) of the models within the modeling platform. The test plan generation leads in each case to stimulations and setpoint values of the results, which enable the functional validation of the function module against the specifications, for example from a requirement specification request of the client.

Durch den erfindungsgemäßen Wegfall der aus dem Stand der Technik bekannten Testinfrastruktur können kleinere und damit kostengünstigere Prozessoren eingesetzt werden. Ferner werden erheblicher Arbeitsaufwand und somit Kosten zur Erzeugung einer Testinfrastruktur gemäß dem Stand der Technik unter Inanspruchnahme einer Verstellsystemschnittstelle eingespart.The omission of the test infrastructure known from the prior art according to the invention makes it possible to use smaller and therefore more cost-effective processors. Furthermore, considerable labor and thus costs for generating a test infrastructure according to the prior art are saved by using a Verstellsystemschnittstelle.

In vorteilhafter Weise wird bei der Generierung des Zielprogramms eine Information, vorzugsweise in Form einer Datei, erstellt, welche die (lokale) Position der Eingangsvariablen und Ausgangsvariablen im Arbeitsspeicher (RAM) eines Mikrocontrollers dokumentiert.In the generation of the target program, information, preferably in the form of a file, is advantageously produced, which documents the (local) position of the input variables and output variables in the working memory (RAM) of a microcontroller.

Bei der Generierung des Zielprogramms wird eine Information in Form einer Datei erstellt, welche die Relation, d. h. der Zusammenhang oder die Zuordnung, zwischen dem Code des autocodegenerierten Quellmodells und des Programmcodes des Zielprogramms im Mikrocontroller dokumentiert.During the generation of the target program, information is created in the form of a file showing the relation, i. H. the relationship or mapping between the code of the autocode-generated source model and the program code of the target program is documented in the microcontroller.

Der Testplan definiert die jeweils zu testenden Funktionsmodule, wobei aus den Informationen über die (lokale) Position der Eingangsvariablen und Ausgangsvariablen und der Information über die Relation, d. h. den Zusammenhang bzw. die Zuordnung zwischen dem Programmcode des Quellmodells und dem Code des Zielprogramms, die Abarbeitungsposition des entsprechend zu testenden Programmteils des Zielprogramms, d. h. dessen Anfangs- und/oder Endmarkierung (Start und Zieladressen des Programmteils), ermittelt wird.The test plan defines the respective function modules to be tested, whereby from the information about the (local) position of the input variables and output variables and the information about the relation, i. H. the relationship or the association between the program code of the source model and the code of the target program, the processing position of the corresponding program part of the target program to be tested, d. H. whose start and / or end mark (start and destination addresses of the program part) is determined.

Die Anfangsmarkierung repräsentiert den Anfang einer Ausführung eines Programmteils, also den Aufruf der jeweiligen Subroutine des Zielprogramms. Durch Ermittlung des Starts der Abarbeitung des jeweiligen Programmteils ist es möglich, vor Aufruf dieses Programmteils die entsprechenden Variablen (Werte des Anregungs- oder Stimuationstestvektors) vor Abarbeitung oder Aufruf der Funktion auf die entsprechend ebenfalls lokalisierten Speicherzellen zu schreiben, so dass der Programmteil des Zielprogramms, welcher dem zu testenden Funktionsmodul, für das der Testvektor ermittelt wurde, entspricht, mit den entsprechenden Werten des Testvektors geladen werden kann. Hierfür wird die Abarbeitung des Prozessors des Mikrocontrollers gestoppt, so dass die entsprechenden Werte vor Weiterverarbeitung geschrieben werden können. Die Werte stehen damit aktuell für die Verarbeitung zur Verfügung und können nicht durch andere Programmteile überschrieben werden.The initial marking represents the beginning of an execution of a program part, ie the call of the respective subroutine of the destination program. By determining the start of the execution of the respective program part, it is possible, before calling this program part, to write the corresponding variables (values of the excitation or stimulation test vector) to the respectively likewise localized memory cells before processing or calling the function, so that the program part of the target program, which corresponds to the functional module to be tested for which the test vector was determined, can be loaded with the corresponding values of the test vector. For this purpose, the processing of the processor of the microcontroller is stopped, so that the corresponding values can be written before further processing. The values are thus currently available for processing and can not be overwritten by other program parts.

Anfangsmarkierung und/oder Endmarkierung eines Programmteils des Zielprogramms werden hierfür in einem oder ggf. mehreren Register mit Programmablaufunterbrechungsfunktion des Mikrocontrollers eingelesen. Der Mikrocontroller muss hierfür über eine technische Voraussetzung zur Unterbrechung des Programmflusses verfügen, die unter Zuhilfenahme eines (Unterbrechungs-)Registers sowohl die Bearbeitungskontrolle von außen als auch den Zugriff auf einen Schreib-Lese-Speicher (engl. random access memory, RAM) ermöglicht, um Variablen auslesen bzw. schreiben zu können. Dies ist beispielsweise mittels eines sog. OCDS (engl. an chip debug system) möglich.Initial marking and / or end marking of a program part of the target program are read for this purpose in one or possibly several registers with program interruption function of the microcontroller. The microcontroller must have a technical prerequisite for interrupting the Program flow, which with the help of a (interrupt) register both the external processing control and the access to a random access memory (RAM) allows to read out or write variables. This is possible, for example, by means of a so-called OCDS (English chip debug system).

Die Endmarkierung repräsentiert das Ende der Ausführung des Programmteils, d. h. den Zeitpunkt, nachdem der Ausgangsvariablen ein Wert zugeordnet wurde. Dieser Wert wird ausgelesen und mit dem entsprechenden Vergleichswert aus dem Testplan verglichen. Das erfindungsgemäße Verfahren kann zudem für die Durchführung von Integrationstests eingesetzt werden. Hierbei wird die fehlerfreie Integration von unabhängig erstellten Teilprogrammen entsprechend der Architektur der Gesamtsoftware überprüft. Die Anordnung und somit Aufrufreihenfolge der Module wird hierbei überprüft.The end mark represents the end of execution of the program part, i. H. The time after which a value has been assigned to the output variable. This value is read out and compared with the corresponding comparison value from the test plan. The inventive method can also be used for performing integration tests. Here, the error-free integration of independently created subroutines is checked according to the architecture of the entire software. The arrangement and thus call order of the modules is checked here.

In einer alternativen Ausgestaltung des erfindungsgemäßen Verfahrens kann die Zielhardware, auf welcher das Zielprogramm ausgeführt werden soll, durch eine Simulationsumgebung ersetzt werden. Das Zielprogramm wird hierbei in einer den Controller simulierenden Zielumgebung ausgeführt, wobei die logischen Abläufe, die auf einem in Hardware ausgebildeten Controller bei Ausführung des Zielprogramms ablaufen, nachbildet werden. Die beschriebene erfindungsgemäße Testausführung erfolgt dabei gleichermaßen, wobei die Kontrolleinheit als programmtechnische Instanz ausgebildet wird, welche die Prozesskontrolle ausführt. Diese verwendet die gleichen Informationen für den Test. Die Zielumgebung ist in dieser Ausgestaltung jedoch keine Hardware, sondern eine simulative Software auf einer nicht eingebetteten Rechenmaschine. Die für eine oben beschriebene Anwendung des Testverfahrens auf einer Zielhardware notwendige elektronische Einheit zur Programmsteuerung/Unterbrechung, welche beispielsweise über die OCDS – Schnittstelle eines Controllers eine Prozesskontrolle ausübt, wird durch eine programmtechnische Instanz ersetzt, die jedoch die gleichen qualitativen Daten verwaltet und verarbeitet.In an alternative embodiment of the method according to the invention, the target hardware on which the target program is to be executed can be replaced by a simulation environment. In this case, the target program is executed in a target environment simulating the controller, with the logical sequences that run on a controller designed in hardware when the target program is executed being simulated. The described test execution according to the invention takes place in the same way, wherein the control unit is designed as a program-technical entity, which carries out the process control. This uses the same information for the test. However, the target environment in this embodiment is not hardware, but simulative software on a non-embedded computing machine. The electronic program control / interruption unit required for an above-described application of the test method on a target hardware, which performs process control via the OCDS interface of a controller, for example, is replaced by a program instance, which, however, manages and processes the same qualitative data.

Zeichnungendrawings

Es zeigen:Show it:

1: eine schematische Übersicht der am Verfahren beteiligten Komponenten; 1 : a schematic overview of the components involved in the process;

2: eine weitere schematische Übersicht der am Verfahren beteiligten Komponenten, 2 : a further schematic overview of the components involved in the method,

3: die Abbildung von funktional erstellten Modulen im Arbeitsspeicherbereich. 3 : The mapping of functionally created modules in the memory area.

Die 1 zeigt eine schematische Übersicht der am Verfahren beteiligten Komponenten. Ein Quellmodell Q umfasst beispielsweise ausgewählt drei modellbasiert erstellte Funktionsmodule F1, F2 und F3. Diese Funktionsmodule F1, F2 und F3 des Quellmodells Q sind in einer vorzugsweise grafisch unterstützten Entwicklungsumgebung (beispielsweise Simulink) erstellte Modelle.The 1 shows a schematic overview of the components involved in the process. A source model Q comprises, for example, three model-based function modules F1, F2 and F3. These function modules F1, F2 and F3 of the source model Q are models created in a preferably graphically supported development environment (for example Simulink).

Aus dem Quellmodell Q wird im Schritt G ein Programmcode P generiert. Der Programmcode P kann beispielsweise C– oder C++-Programmcode sein.From the source model Q, a program code P is generated in step G. The program code P can be, for example, C or C ++ program code.

Ein Programmcode P umfasst in diesem Beispiel ebenfalls drei Programmteile P1_P, P2_P, P3_P. Der Programmteil P1_P entspricht funktional dem Funktionsmodul F1. Ebenso entsprechen die Programmteile P2_P und P3_P den Funktionsmodulen F2 und F3.A program code P also comprises three program parts P1_P, P2_P, P3_P in this example. The program part P1_P corresponds functionally to the function module F1. Similarly, the program parts P2_P and P3_P correspond to the function modules F2 and F3.

In einem weiteren Schritt wird unter Zuhilfenahme eine Cross-Compilers binärer Code eines Zielprogramms Z aus dem Programmcode P für eine ausgewählte Zielhardware generiert. Das Zielprogramm Z umfasst dabei drei Programmteile P1_Z, P2_Z, P3_Z, die sequentiell vorliegen, was in 3 näher dargestellt wird. Der Programmteil P1_Z entspricht funktional dem Programmteil P1_P.In a further step, binary code of a target program Z is generated from the program code P for a selected target hardware with the aid of a cross-compiler. The target program Z comprises three program parts P1_Z, P2_Z, P3_Z, which are present sequentially, which is in 3 is shown in more detail. The program part P1_Z corresponds functionally to the program part P1_P.

Ebenso entsprechen die übrigen Programmteile P2_Z, P3_Z des Zielprogramms Z den Programmteilen P2_P, P3_P des Programmcodes P funktional.Likewise, the remaining program parts P2_Z, P3_Z of the target program Z correspond to the program parts P2_P, P3_P of the program code P functionally.

Das Funktionsmodul F1 umfasst eine Eingangsvariable E1_F1 und zwei Ausgangsvariablen A1_F1, A2_F1.The function module F1 comprises an input variable E1_F1 and two output variables A1_F1, A2_F1.

Das Funktionsmodul F2 umfasst drei Eingangsvariablen E1_F2, E2_F2, E3_F2 und eine Ausgangsvariable A1_F2.The function module F2 comprises three input variables E1_F2, E2_F2, E3_F2 and an output variable A1_F2.

Das Funktionsmodul F3 umfasst zwei Eingangsvariablen E1_F3, E2_F3 und zwei Ausgangsvariablen A1_F3, A2_F3. The function module F3 comprises two input variables E1_F3, E2_F3 and two output variables A1_F3, A2_F3.

Aufgrund der jeweiligen Generierung G umfassen die Programmteile P1_P, P2_P, P3_P des Programmcodes P und die Programmteile P1_Z, P2_Z, P3_Z des Zielprogramms Z entsprechende Eingangs- und Ausgangsvariablen Funktionsmodul 1 Funktionsmodul 2 Funktionsmodul 3 Programmcode Zielcode Programmcode Zielcode Programmcode Zielcode Eingänge E1_P1_P E1_P1_Z E1_P2_P E1_P2_P E1_P2_P E1_P2_Z E2_P2_Z E3_P2_Z E1_P3_P E2_P3_P E1_P3_Z E2_P3_Z Ausgänge A1_P1_P A2_P1_P A1_P1_Z A1_P1_Z A1_P2_P A1_P2_Z A1_P3_P A2_P3_P A1_P3_Z A2_P3_Z Due to the respective generation G, the program parts P1_P, P2_P, P3_P of the program code P and the program parts P1_Z, P2_Z, P3_Z of the target program Z include corresponding input and output variables Function module 1 Function module 2 Function module 3 program code target code program code target code program code target code inputs E1_P1_P E1_P1_Z E1_P2_P E1_P2_P E1_P2_P E1_P2_Z E2_P2_Z E3_P2_Z E1_P3_P E2_P3_P E1_P3_Z E2_P3_Z outputs A1_P1_P A2_P1_P A1_P1_Z A1_P1_Z A1_P2_P A1_P2_Z A1_P3_P A2_P3_P A1_P3_Z A2_P3_Z

Für das Funktionsmodul F1 wurde auf Basis der Modelle des Quellmodells ein Testplan T1 erstellt. Der Testplan T1 umfasst eine Analyse einer funktionalen und wertabhängigen Zuordnung zwischen der Eingangsvariablen E1_F1 und den Ausgangsvariablen A1_F1, A2_F1 des Funktionsmoduls F1. Der Testplan kann dabei automatisch, programmbasiert erstellt werden. Weiterhin ist die Erstellung durch empirisch ermittelte Stimulationen im Zusammenhang mit den Berechnungsmethoden der modellbasierten Entwicklungsumgebung möglich.For the function module F1, a test plan T1 was created based on the models of the source model. The test plan T1 comprises an analysis of a functional and value-dependent assignment between the input variables E1_F1 and the output variables A1_F1, A2_F1 of the function module F1. The test plan can be created automatically, program-based. Furthermore, it can be generated by empirically determined stimulation in connection with the calculation methods of the model-based development environment.

Weiterhin beinhaltet der Testplan T1 eine Bestimmung von zulässigen Wertebereichen der Eingangsvariablen E1_F1 und der Ausgangsvariablen A1_F1, A2_F1. Zudem umfasst der Testplan T1 für die Eingangsvariable E1_F1 einen Eingangstestwert ET1_T1 sowie für die Ausgangsvariable A1_F1 einen Ausgangstestwert AT1_T1 und für die Ausgangsvariable A2_F1 einen Ausgangstestwert AT2_T1.Furthermore, the test plan T1 contains a determination of permissible value ranges of the input variables E1_F1 and the output variables A1_F1, A2_F1. In addition, the test plan T1 comprises an input test value ET1_T1 for the input variable E1_F1 and an output test value AT1_T1 for the output variable A1_F1 and an output test value AT2_T1 for the output variable A2_F1.

Ebenso wurde für die Funktionsmodule F2, F3 jeweils ein Testplan T2, T3 erstellt.Likewise, a test plan T2, T3 was created for each of the function modules F2, F3.

Das erfindungsgemäße Verfahren führt eine Verifizierung des Zielprogramms Z durch.The method according to the invention carries out a verification of the target program Z.

Hierzu werden am Anfang der Ausführung des Programmcodes eines Programmteils P1_Z, P2_Z, P3_Z, beispielsweise der Programmteil P2_Z, der Eingangsvariablen E1_P2_Z der Eingangstestwert ET1_T2, der Eingangsvariablen E2_P2_Z der Eingangstestwert ET2_T2 und der Eingangsvariablen E3_P2_Z der Eingangstestwert ET3_T3 zugeordnet. Danach wird der Programmcode des Programmteils P2_Z ausgeführt und hierbei die Eingangstestwerte ET1_T2, ET2_T2, ET3_T2 verarbeitet.For this purpose, at the beginning of the execution of the program code of a program part P1_Z, P2_Z, P3_Z, for example the program part P2_Z, the input variable E1_P2_Z the input test value ET1_T2, the input variable E2_P2_Z the input test value ET2_T2 and the input variable E3_P2_Z the input test value ET3_T3 assigned. Thereafter, the program code of the program part P2_Z is executed and in this case the input test values ET1_T2, ET2_T2, ET3_T2 are processed.

Am Ende der Ausführung des Programmcodes des Programmteils P2_Z wird ein Ausgangstestwert AT1_P2_Z der Ausgangsvariablen A1_P2_Z ausgelesen.At the end of execution of the program code of the program part P2_Z, an output test value AT1_P2_Z of the output variable A1_P2_Z is read out.

Der Ausgangstestwert AT1_P2_Z wird in einer Vergleichseinheit V mit dem Ausgangstestwert AT1_T2 verglichen. Sofern die beiden Werte übereinstimmen, liegt keine fehlerhafte Generierung G des Programmcodes des Programmteils P2_Z des Zielprogramms Z aus dem Programmteil P2_Q des Programmcodes P des Quellmodells Q vor. Andernfalls liegt eine fehlerhafte Generierung G oder software- und/oder hardwareseitig ein Maskenproblem auf dem sich gegebenenfalls noch in der Entwicklung befindlichen Mikrocontrollerchip vor.The output test value AT1_P2_Z is compared in a comparison unit V with the output test value AT1_T2. If the two values match, there is no erroneous generation G of the program code of the program part P2_Z of the target program Z from the program part P2_Q of the program code P of the source model Q. Otherwise, there is a faulty generation G or software and / or hardware a mask problem on the possibly still in development microcontroller chip.

Hierbei sei darauf hingewiesen, dass es durchaus legitim ist, die Ausgangsvariablen im Signalpfad der vorher angeordneten Funktionsmodule als Eingangsvariablen des zu testenden Moduls zu benutzen.It should be noted that it is quite legitimate to use the output variables in the signal path of the previously arranged function modules as input variables of the module to be tested.

Entscheidend ist hierbei, dass mit den aus den Informationen des Quellmodells gewonnenen Testvektoren für die einzelnen Funktionsmodule ein Test der entsprechenden Programmteile des Zielprogramms, welche sequentiell im Programmspeicher abgelegt und durch den Prozessor des Mikrocontrollers verarbeitet werden, erfolgen kann. Das Schreiben der entsprechenden Werte des Testvektors erfolgt dabei auf globale Variablen des entsprechend lokalisierten Speicherplatzes vor Abarbeitung des jeweiligen Programmteils, wobei die Abarbeitung des Prozessors über die notwendigerweise vorhandene technische Möglichkeit einer OnChipDebugg-Einheit kurzzeitig unterbrochen wird. Nach Abarbeitung wird der entsprechende Wert der Ausgangsvariablen aus dem Speicher gelesen, wobei auch hierfür die Abarbeitung des Programms unterbrochen wird, um ein Auslesen der Werte zu ermöglichen und ein zwischenzeitliches Überschreiben anderer Programmteile, die z. B. durch eine schnelle getaktete OSEK-Task normalerweise unterbrochen werden würde, zu verhindern.Decisive here is that with the obtained from the information of the source model test vectors for the individual function modules, a test of the corresponding program parts of the target program, which are stored sequentially in the program memory and processed by the processor of the microcontroller, can take place. The writing of the corresponding values of the test vector takes place on global variables of the correspondingly localized memory space before the execution of the respective program part, wherein the execution of the processor is temporarily interrupted by the necessarily existing technical possibility of an OnChipDebugg unit. After execution, the corresponding value of the output variable is read from the memory, whereby the processing of the program is also interrupted for this to allow readout of the values and an interim overwriting of other program parts, the z. B. normally would be interrupted by a fast clocked OSEK task to prevent.

Die 2 zeigt eine weitere schematische Übersicht der einzelnen Komponenten. Aus dem Programmcode P wird ein Zielprogramm Z generiert. Die Generierung G erfolgt beispielsweise mittels einer sog. Toolkette, welche ein Kompilieren (engt. compiling), ein Lokstieren (engt. locating) und ein Zusammenbinden (engl. linking) beinhaltet.The 2 shows a further schematic overview of the individual components. From the program code P, a target program Z is generated. The generation G takes place, for example, by means of a so-called tool chain, which includes compiling, locating and linking.

Bei der Generierung entsteht neben dem Code, beispielsweise der Binärcode zum Einbringen auf den Mikrocontroller, auch eine Datei, aus der die Position Pos der Eingangsvariablen E_P_Z und Ausgangsvariablen A_P_Z in einem Speicher Sp eines Mikrocontrollers μC ermittelt werden können.During generation, in addition to the code, for example the binary code for introduction to the microcontroller, a file is also produced from which the position Pos of the input variables E_P_Z and output variables A_P_Z can be determined in a memory Sp of a microcontroller .mu.C.

Weiterhin entsteht bei der Generierung G eine Datei, welche die Relation Rel, d. h. die Zuordnung, zwischen dem Programmcode P des Quellmodells Q und dem Programmcode des Zielprogramms Z dokumentiert. Diese Zuordnung ist für das erfindungsgemäße Verfahren wichtig, weil dadurch das auf der Ebene der modellbasierten Entwicklungsumgebung zweidimensional grafisch angeordnete Funktionsmodul anhand seines Funktionsnamens und weiterer Attribute im linear eindimensionalen Zielprogrammspeicher über die Symboltabelle lokalisiert werden kann, um so der Unterbrechungseinheit mitzuteilen, an welcher Adresse das Stoppen des Mikrocontrollers durchzuführen ist.Furthermore, in the generation G, a file is created which has the relation Rel, d. H. the assignment, between the program code P of the source model Q and the program code of the target program Z documented. This assignment is important for the method according to the invention because it allows the function module based on its function name and further attributes in the linear one-dimensional target program memory to be located on the symbol-based development environment via the symbol table so as to inform the interrupt unit of the stop at which address of the microcontroller.

Diese beiden Dateien über die Position Pos und die Relation Rel werden ebenfalls an eine Testkontrolleinheit TK übermittelt. Die Testkontrolleinheit TK umfasst mindestens einen Testplan T und die Vergleichseinheit V.These two files about the position Pos and Relation Rel are also transmitted to a test control unit TK. The test control unit TK comprises at least one test plan T and the comparison unit V.

Mittels des Testplans T werden funktionale und werteabhängige Zuordnungen zwischen den Ein- und Ausgangsvariablen E_F, A_F des Funktionsmoduls F ermittelt.By means of the test plan T, functional and value-dependent assignments between the input and output variables E_F, A_F of the function module F are determined.

Das Funktionsmodul wird beispielsweise in einer grafischen Modellumgebung erstellt. Basierend auf diesen Zuordnungen wird für jede Eingangsvariable E_F des Funktionsmoduls ein Eingangstestwert ET_T und für jede Ausgangsvariable A_F des Funktionsmoduls ein Ausgangstestwert AT_T generiert. Dieses Verfahren ist beispielsweise in der DE 10 2004 014 290 A1 näher ausgeführt.For example, the function module is created in a graphical model environment. Based on these assignments, an input test value ET_T is generated for each input variable E_F of the function module and an output test value AT_T is generated for each output variable A_F of the function module. This method is for example in the DE 10 2004 014 290 A1 detailed.

Der Programmcode des Zielprogramms Z ist auf dem Mikrocontroller μC eines Steuergeräts implementiert.The program code of the target program Z is implemented on the microcontroller .mu.C of a control device.

Der Mikrocontroller μC umfasst eine Schnittstelle S, welche ein Protokoll zur Kommunikation mit einem Kontroller K beinhaltet.The microcontroller μC comprises an interface S, which includes a protocol for communication with a controller K.

Der Kontroller K führt eine hardwareseitige Kontrolle des Mikrocontrollers μC durch. Weiterhin steht der Kontroller K mit einem Register R in Verbindung.The controller K performs a hardware-side control of the microcontroller μC. Furthermore, the controller K is in communication with a register R.

Zudem verfügt der Kontroller K über einen Schreib- und Lesezugriff auf den Speicher Sp.In addition, the controller K has a read and write access to the memory Sp.

Für das erfindungsgemäße Verfahren ermittelt die Testkontrolleinheit TK anhand der beiden Dateien über die Position Pos und die Relation Rel und anhand des Testplans T für einen Programmteil P1_Z, P2_Z, P3_Z des Zielprogramms Z eine Anfangsmarkierung AM und eine Endmarkierung EM. Die Anfangsmarkierung AM bezieht sich auf den Anfang des Programmcodes des Programmteils P1_Z, P2_Z, P3_Z. Die Endmarkierung EM bezieht sich auf das Ende des Programmcodes des Programmteils P1_Z, P2_Z, P3_Z.For the method according to the invention, the test control unit TK determines an initial mark AM and an end mark EM on the basis of the two files about the position Pos and the relation Rel and on the basis of the test plan T for a program part P1_Z, P2_Z, P3_Z of the target program Z. The start marker AM refers to the beginning of the program code of the program part P1_Z, P2_Z, P3_Z. The end mark EM refers to the end of the program code of the program part P1_Z, P2_Z, P3_Z.

Für jeden Programmteil P1_Z, P2_Z, P3_Z übermittelt die Testkontrolleinheit TK die Anfangsmarkierung AM und die Endmarkierung EM an die Schnittstelle S des Mikrocontrollers μC. Die Anfangsmarkierung AM und die Endmarkierung EM werden in das Register R eingelesen.For each program part P1_Z, P2_Z, P3_Z, the test control unit TK transmits the start marker AM and the end marker EM to the interface S of the microcontroller μC. The start marker AM and the end marker EM are read into the register R.

Sofern hierfür nur ein Register R zur Verfügung steht, müssen diese Werte (Anfangsmarkierung AM, Endmarkierung EM) sequentiell eingetragen werden und es ist eine Ablaufsteuerung erforderlich. Andernfalls müssen mindestens zwei Register R vorhanden sein.If only one register R is available for this purpose, these values (initial marking AM, end marking EM) must be entered sequentially and a sequence control is required. Otherwise, at least two registers R must be present.

Bei der Ausführung des Programmcodes der einzelnen Programmteile P1_Z, P2_Z, P3_Z berücksichtigt der Mikrocontroller μC die jeweiligen Anfangsmarkierungen AM und Endmarkierungen EM.When executing the program code of the individual program parts P1_Z, P2_Z, P3_Z, the microcontroller μC takes into account the respective start marks AM and end marks EM.

Bei Erreichen einer Anfangsmarkierung AM eines Programmteils P1_Z, P2_Z, P3_Z sendet der Mikrocontroller μC eine entsprechende Rückmeldung an die Testkontrolleinheit TK und unterbricht die Ausführung des Programmteils P1_Z, P2_Z, P3_Z. When an initial marking AM of a program part P1_Z, P2_Z, P3_Z is reached, the microcontroller .mu.C sends a corresponding feedback to the test control unit TK and interrupts the execution of the program part P1_Z, P2_Z, P3_Z.

Aufgrund dieser Rückmeldung lädt die Testkontrolleinheit TK den oder die Eingangstestwert(e) ET_T gemäß dem Testplan T und übermittelt diesen/diese an den Mikrocontroller μC.On the basis of this feedback, the test control unit TK loads the input test value (s) ET_T according to the test plan T and transmits it to the microcontroller .mu.C.

Sofern nur ein Register R vorhanden ist, wird nach dem Setzen der Eingangstestwerte ET_T, d. h. während der Unterbrechung der Ausführung des Programmteils P1_Z, P2_Z, P3_Z, die Endmarkierung EM in das Register R eingetragen.If only one register R is present, after setting the input test values ET_T, d. H. during the interruption of the execution of the program part P1_Z, P2_Z, P3_Z, the end mark EM is entered in the register R.

Sofern zwei Register R vorhanden sind, ist das zweite Register R bereits auf die Endmarkierung EM eingestellt.If two registers R are present, the second register R is already set to the end mark EM.

Anschließend setzt der Mikrocontroller μC die Ausführung fort und verarbeitet den/die Eingangstestwert(e) ET_T.The microcontroller μC then continues execution and processes the input test value (s) ET_T.

Beim Erreichen der Endmarkierung EM des Programmteils P1_Z, P2_Z, P3_Z sendet der Mikrocontroller μC eine entsprechende Rückmeldung an die Testkontrolleinheit TK und unterbricht die Ausführung des Programmteils P1_Z, P2_Z, P3_Z.Upon reaching the end marking EM of the program part P1_Z, P2_Z, P3_Z, the microcontroller .mu.C sends a corresponding feedback to the test control unit TK and interrupts the execution of the program part P1_Z, P2_Z, P3_Z.

Die Testkontrolleinheit TK lädt aufgrund dieser Rückmeldung den/die Ausgangstestwert(e) AT_P_Z vom Mikrocontroller μC, d. h. es erfolgt ein Auslesen der Ergebnisvariablen.Due to this feedback, the test control unit TK loads the output test value (s) AT_P_Z from the microcontroller μC, d. H. there is a reading of the result variables.

Die Testkontrolleinheit TK führt in der Vergleichseinheit V einen Vergleich zwischen dem Ausgangstestwert AT_T des Testplans T und dem Ausgangstestwert AT_P_Z des Programmteils P1_Z, P2_Z, P3_Z des Zielprogramms Z durch.The test control unit TK performs a comparison between the output test value AT_T of the test plan T and the output test value AT_P_Z of the program part P1_Z, P2_Z, P3_Z of the target program Z in the comparison unit V.

Das erfindungsgemäße Verfahren stellt über die besondere Synchronisation von Modell-, Programmcode- und Toolattributen über die verschiedenen Softwareerzeugungsinstanzen eine Korrelation her. Modellbasiert erstellte Funktionen können mit ihrem zugehörigen Testplan bei Abarbeitung auf der Zielhardware überprüft werden.The method according to the invention establishes a correlation via the special synchronization of model, program code and tool attributes via the various software generation instances. Model-based functions can be checked with their associated test plan when processing on the target hardware.

Für das erfindungsgemäße Verfahren werden bereits zur Verfügung stehende Komponenten des Mikrocontrollers μC (Schnittstelle S und Kontroller K) sowie infolge der Generierung G des Zielprogramms Z entstandene Dateien (Position Pos und Relation Rel) verwendet. Somit sind für die Durchführung des erfindungsgemäßen Verfahrens keine speziellen Modifikationen an dem Mikrocontroller μC, beispielsweise Ersatzwertschalter, erforderlich.For the inventive method already available components of the microcontroller μC (interface S and controller K) and as a result of the generation G of the target program Z resulting files (position Pos and Rel Rel) are used. Thus, no special modifications to the microcontroller .mu.C, for example replacement value switches, are required for carrying out the method according to the invention.

Das erfindungsgemäße Verfahren kann an sämtlichen Mikrocontrollem μC durchgeführt werden, die über eine Schnittstelle S zur Unterbrechung der Ausführung des Programms des Controllers K verfügen.The inventive method can be performed on all microcontroller μC, which have an interface S for interrupting the execution of the program of the controller K.

Da in komplexen Steuergeräten Echtzeit-Betriebssysteme eingesetzt wenden (RTOS-RealTime Operating System), kann es vorkommen, dass während der Programmausführung zwischen Anfangs-(AM) und Endmarke (EM) Unterbrechungen von schneller ablaufenden Zeitscheiben (zeitdiskreten Tasks) stattfinden, die je nach Vernetzung des Modells eine Verfälschung der Teststimulation bewirken können. Das tritt insbesondere dann auf, wenn die Funktion 2 bspw. von der schnell getakteten Funktion 1 mit Berechnungsergebnissen versorgt wird. Für den Fall führt die Testkontrolleinheit TK einen Einzelschrittmodus des Mikrocontrollers durch. Dieser Modus bleibt von der Anfangsmarke bis zur Endmarke beibehalten. Sollte während dieser Zeit das Funktionsmodul unterbrochen werden, dann überprüft die TK nach dem Rücksprung aus der häufiger aufgerufenen Task, die ggf. mehrere Funktionen enthalten kann, ob die ursprünglich gesetzten Inhalte der Eingangsvariablen (Stimulationen des zu testenden Zielprogrammabschnitts) immer noch mit den im Testplan vorgegebenen Werten übereinstimmen. Sollte das nicht der Fall sein, weil die schnellere Task zu einer Veränderung geführt haben sollte, dann stellt die TK den ursprünglichen Wert wieder her, damit das System unter Test (das Funktionsmodul) die Möglichkeit hat, aufgrund der bestimmten Vorgabe zum richtigen erwarteten Ergebnis zu kommen.Because real-time operating systems (RTOS Real Time Operating System) are used in complex ECUs, there may be interrupts between the beginning (AM) and end (EM) markers of faster-running (discrete-time) time slices, depending on the application Networking the model can cause a distortion of the test stimulation. This occurs, in particular, when the function 2 is supplied, for example, with the calculation results by the fast-clocked function 1. In this case, the test control unit TK performs a single-step mode of the microcontroller. This mode is retained from the start mark to the end mark. If the function module is interrupted during this time, then the TK, after returning from the more frequently called task, which may possibly contain several functions, checks whether the originally set contents of the input variables (stimulations of the target program section to be tested) still correspond to those in the test plan match given values. If this is not the case, because the faster task should have resulted in a change, then the TK restores the original value so that the system under Test (the function module) has the opportunity to get to the correct expected result, based on the given constraint come.

3 zeigt, wie sich die in der Entwicklungsumgebung erzeugten funktional getrennten Modelle für die Funktionen F1–F5 durch die Codegenerierung als sequentiell im Arbeitsspeicher abgelegte Programmteile P1_Z–P5_Z des Zielprogramms darstellen. In der Entwicklungsumgebung werden einzelne Modelle, deren Inhalt meist mathematische Berechnungsvorschriften enthalten, erzeugt, welche in den Funktionen F1–F5 abgebildet werden. Ausgehend von den Eingangsvariablen E1_F1 ... bis E2_F3 werden in den Funktionen Ausgangswerte berechnet, wobei beispielhaft hier ein Ausgangswert A1_F5 gebildet wird. Die Codegenerierung, welche zum binären Zielprogramm Z führt, erzeugt aus der teilparallelen Modell-Funktionsstruktur ein sequentielles Zielprogramm Z, in welchem sich die Einzelfunktionen in sequentiellen Programmteilen P1_Z–P5_Z wiederfinden. 3 shows how the functionally generated models for the functions F1-F5 generated in the development environment by the code generation as sequentially stored in memory program parts P1_Z-P5_Z the target program. In the development environment, individual models are their content usually contain mathematical calculation rules generated, which are mapped in the functions F1-F5. Starting from the input variables E1_F1 ... to E2_F3, output values are calculated in the functions, with an output value A1_F5 being formed here by way of example. The code generation which leads to the binary target program Z generates from the partially parallel model function structure a sequential target program Z in which the individual functions are found in sequential program parts P1_Z-P5_Z.

BezugszeichenlisteLIST OF REFERENCE NUMBERS

A1_F1A1_F1
Ausgangsvariableoutput variable
A2_F1A2_F1
Ausgangsvariableoutput variable
A1_F2A1_F2
Ausgangsvariableoutput variable
A1_F3A1_F3
Ausgangsvariableoutput variable
A2_F3A2_F3
Ausgangsvariableoutput variable
A1_F5A1_F5
Ausgangsvariableoutput variable
A1_P1_PA1_P1_P
Ausgangsvariableoutput variable
A2_P1_PA2_P1_P
Ausgangsvariableoutput variable
A1_P2_PA1_P2_P
Ausgangsvariableoutput variable
A1_P3_PA1_P3_P
Ausgangsvariableoutput variable
A2_P3_PA2_P3_P
Ausgangsvariableoutput variable
A1_P1_ZA1_P1_Z
Ausgangsvariableoutput variable
A2_P1_ZA2_P1_Z
Ausgangsvariableoutput variable
A1_P2_ZA1_P2_Z
Ausgangsvariableoutput variable
A1_P3_ZA1_P3_Z
Ausgangsvariableoutput variable
A2_P3_ZA2_P3_Z
Ausgangsvariableoutput variable
AMAT THE
Anfangsmarkierungbeginning mark
AT_P_ZAT_P_Z
AusgangstestwertOutput test value
AT1_P2_ZAT1_P2_Z
AusgangstestwertOutput test value
AT_TAT_T
AusgangstestwertOutput test value
AT1_T1AT1_T1
AusgangstestwertOutput test value
AT2_T1AT2_T1
AusgangstestwertOutput test value
AT1_T2AT1_T2
AusgangstestwertOutput test value
AT1_T3AT1_T3
AusgangstestwertOutput test value
AT2_T3AT2_T3
AusgangstestwertOutput test value
E1_F1E1_F1
Eingangsvariableinput variable
E1_F2E1_F2
Eingangsvariableinput variable
E2_F2E2_F2
Eingangsvariableinput variable
E3_F2E3_F2
Eingangsvariableinput variable
E1_F3E1_F3
Eingangsvariableinput variable
E2_F3E2_F3
Eingangsvariableinput variable
E1_P1_PE1_P1_P
Eingangsvariableinput variable
E1_P2_PE1_P2_P
Eingangsvariableinput variable
E2_P2_PE2_P2_P
Eingangsvariableinput variable
E3_P2_PE3_P2_P
Eingangsvariableinput variable
E1_P3_PE1_P3_P
Eingangsvariableinput variable
E2_P3_PE2_P3_P
Eingangsvariableinput variable
E1_P1_ZE1_P1_Z
Eingangsvariableinput variable
E1_P2_ZE1_P2_Z
Eingangsvariableinput variable
E2_P2_ZE2_P2_Z
Eingangsvariableinput variable
E3_P2_ZE3_P2_Z
Eingangsvariableinput variable
E1_P3_ZE1_P3_Z
Eingangsvariableinput variable
E2_P3_ZE2_P3_Z
Eingangsvariableinput variable
EMEM
Endmarkierungend mark
ET_TET_T
EingangstestwertEntrance test score
ET1_T1ET1_T1
EingangstestwertEntrance test score
ET1_T2ET1_T2
EingangstestwertEntrance test score
ET2_T2ET2_T2
EingangstestwertEntrance test score
ET3_T2ET3_T2
EingangstestwertEntrance test score
ET1_T3ET1_T3
EingangstestwertEntrance test score
ET2_T3ET2_T3
EingangstestwertEntrance test score
F1F1
Funktionsmodulfunction module
F2 F2
Funktionsmodulfunction module
F3F3
Funktionsmodulfunction module
GG
Generierunggeneration
KK
Kontrollercontroller
PP
Programmcodeprogram code
P1_PP1_P
Programmteilprogram part
P2_PP2_P
Programmteilprogram part
P3_PP3_P
Programmteilprogram part
P1_ZP1_Z
Programmteilprogram part
P2_ZP2_Z
Programmteilprogram part
P3_ZP3_Z
Programmteilprogram part
PosPos
Positionposition
QQ
Quellmodellsource model
RR
Registerregister
Relrel
Relationrelation
SS
Schnittstelleinterface
Spsp
SpeicherStorage
TT
Testplantest plan
T1T1
Testplantest plan
T2T2
Testplantest plan
T3T3
Testplantest plan
TKTK
TestkontrolleinheitTest control unit
VV
Vergleichseinheitcomparing unit
ZZ
Zielprogrammtarget program
μC.mu.C
Mikrocontrollermicrocontroller

ZITATE ENTHALTEN IN DER BESCHREIBUNG QUOTES INCLUDE IN THE DESCRIPTION

Diese Liste der vom Anmelder aufgeführten Dokumente wurde automatisiert erzeugt und ist ausschließlich zur besseren Information des Lesers aufgenommen. Die Liste ist nicht Bestandteil der deutschen Patent- bzw. Gebrauchsmusteranmeldung. Das DPMA übernimmt keinerlei Haftung für etwaige Fehler oder Auslassungen.This list of the documents listed by the applicant has been generated automatically and is included solely for the better information of the reader. The list is not part of the German patent or utility model application. The DPMA assumes no liability for any errors or omissions.

Zitierte PatentliteraturCited patent literature

  • DE 102004014290 A1 [0012, 0021, 0025, 0061] DE 102004014290 A1 [0012, 0021, 0025, 0061]

Claims (7)

Verfahren zum Verifizieren eines Codes eines Zielprogramms (Z), welcher aus einem Programmcode (P) eines Quellmodells (Q) generiert wurde, wobei der Programmcode (P) des Quellmodells (Q) anhand mindestens eines Funktionsmoduls (F, F1, F2, F3) generiert wurde, und dieser Programmcode (P) einen Programmteil (P1_P, P2_P, P3_P) aufweist, welcher einem Funktionsmodul (F1, F2, F3) des Quellmodells (Q) funktional entspricht, und der Programmcode des Zielprogramms (Z) einen Programmteil (P1_Z, P2_Z, P3_Z) aufweist, welcher funktional einem Programmteil (P1_P, P2_P, P3_P) des Programmcodes (P) entspricht, und jedes Funktionsmodul (F1, F2, F3) mindestens eine Eingangsvariable (E1_F1, E1_F2, E2_F2, E3_F2, E1_F3, E2_F3) und mindestens eine Ausgangsvariable (A1_F1, A2_F1, A1_F2, A1_F3, A2_F3) umfasst, und für mindestens ein Funktionsmodul (F, F1, F2, F3) ein Testplan (T, T1, T2, T3) erstellt wird, welcher eine Analyse einer funktionalen und wertabhängigen Zuordnung zwischen der Eingangsvariablen (E1_F1, E1_F2, E2_F2, E3_F2, E1_F3, E2_F3) und der Ausgangsvariablen (A1_F1, A2_F1, A1_F2, A1_F3, A2_F3) des Funktionsmoduls (F, F1, F2, F3) umfasst, und der Eingangsvariablen (E1_P1_Z, E1_P2_Z, E2_P2_Z, E3_P2_Z, E1_P3_Z, E2_P3_Z) eines Programmteils (P1_Z, P2_Z, P3_Z) des Zielprogramms (Z) ein Eingangstestwert (ET_T, ET1_T2, ET2_T2, ET3_T2) zugeordnet wird, wobei der Eingangstestwert (ET_T, ET1_T2, ET2_T2, ET3_T2) aus dem Testplan (T, T1, T2, T3) des jeweiligen Funktionsmoduls (F) erstellt wurde, und der so vorgegebene Eingangstestwert (ET_T, ET1_T1, ET1_T2, ET2_T2, ET3_T2, ET1_T3, ET2_T3) in dem Programmteil (P1_Z, P2_Z, P3_Z) des Zielprogramms (Z) verarbeitet wird, und der Ausgangstestwert (AT_P_Z, AT1_P2_Z) der Ausgangsvariablen (A1_P1_Z, A2_P1_Z, A1_P2_Z, A1_P3_Z, A2_P3_Z) ausgelesen wird, und dieser Ausgangstestwert (AT P_Z, AT1_P2_Z) mit dem Ausgangstestwert (AT_T, AT1_T2) des Testplans (T, T1, T2, T3) verglichen wird.Method for verifying a code of a target program (Z) which was generated from a program code (P) of a source model (Q), the program code (P) of the source model (Q) being based on at least one function module (F, F1, F2, F3) was generated, and this program code (P) has a program part (P1_P, P2_P, P3_P) which functionally corresponds to a function module (F1, F2, F3) of the source model (Q), and the program code of the target program (Z) has a program part (P1_Z, P2_Z, P3_Z ), which functionally corresponds to a program part (P1_P, P2_P, P3_P) of the program code (P), and each functional module (F1, F2, F3) comprises at least one input variable (E1_F1, E1_F2, E2_F2, E3_F2, E1_F3, E2_F3) and at least one output variable (A1_F1, A2_F1, A1_F2, A1_F3, A2_F3), and for at least one functional module (F, F1, F2, F3) a test plan (T, T1, T2, T3) is created, which is an analysis of a functional and value-dependent assignment between the input variables (E1_F1, E1_F2, E2_F2, E3_F2, E1_F3, E2_F3 ) and the output variables (A1_F1, A2_F1, A1_F2, A1_F3, A2_F3) of the function module (F, F1, F2, F3), and the input variables (E1_P1_Z, E1_P2_Z, E2_P2_Z, E3_P2_Z, E1_P3_Z, E2_P3_Z) of a program part (P1_Z, P2_Z, P3_Z) of the target program (Z) is assigned an input test value (ET_T, ET1_T2, ET2_T2, ET3_T2), the input test value (ET_T, ET1_T2 , ET2_T2, ET3_T2) was created from the test plan (T, T1, T2, T3) of the respective function module (F), and the thus specified input test value (ET_T, ET1_T1, ET1_T2, ET2_T2, ET3_T2, ET1_T3, ET2_T3) in the program part ( P1_Z, P2_Z, P3_Z) of the target program (Z), and the output test value (AT_P_Z, AT1_P2_Z) of the output variables (A1_P1_Z, A2_P1_Z, A1_P2_Z, A1_P3_Z, A2_P3_Z) is read, and this output test value (AT P_Z, AT1_P2_Z) is compared with the output test value (AT_T, AT1_T2) of the test plan (T, T1, T2, T3). Verfahren nach Anspruch 1, dadurch gekennzeichnet, dass bei der Generierung (G) des Zielprogramms (Z) Informationen generiert werden, welche die Position (Pos) der Eingangsvariablen (E_P_Z) und Ausgangsvariablen (A_P_Z) der jeweiligen Programmteile (P1_Z, P2_Z, P3_Z), die dem Funktionsmodul (F1, F2, F3) des Quellmodells (Q) entsprechen, in einem Speicher (Sp) eines Mikrocontrollers (μC) kennzeichnen.A method according to claim 1, characterized in that in the generation (G) of the target program (Z) information is generated which the position (Pos) of the input variables (E_P_Z) and output variables (A_P_Z) of the respective program parts (P1_Z, P2_Z, P3_Z) , which correspond to the functional module (F1, F2, F3) of the source model (Q), in a memory (Sp) of a microcontroller (μC). Verfahren nach Anspruch 1 oder 2, dadurch gekennzeichnet, dass bei der Generierung (G) des Zielprogramms (Z) eine Information, die die Relation (Rel) zwischen dem Programmcode (P) des Quellmodells (Q) und des Programmcodes des Zielprogramms (Z) dokumentiert, generiert wird.A method according to claim 1 or 2, characterized in that in the generation (G) of the target program (Z) information that the Relation (Rel) between the program code (P) of the source model (Q) and the program code of the target program (Z) documented, is generated. Verfahren nach mindestens einem der vorhergehenden Ansprüche, dadurch gekennzeichnet, dass mittels der Information über die Position (Pos) und die Relation (Rel) sowie mittels des Testplans (T) für mindestens einen Programmteil (P_Z) des Zielprogramms (Z) eine Anfangsmarkierung (AM) über den Anfang des Programmteils (P_Z) und eine Endmarkierung (EM) über das Ende des Programmteils (P_Z) ermittelt werden, wobei die Abarbeitung des Zielprogramms an der Anfangsmarkierung (AM) gestoppt wird und die durch den Testplan (T) vorgegebenen Eingangstestwerte (ET_T) auf die ermittelten Positionen der jeweiligen Eingangsvariablen (E_P_Z) geschrieben werden, nachfolgend das Zielprogramm unter Verarbeitung dieser Eingangstestwerte (ET_T) abgearbeitet wird und wiederum bei Erreichen der Endmarkierung (EM) gestoppt wird oder bis dahin kontrolliert im Ablauf unter Integritätsüberwachung der Stimulationsvariablen des Funktionsprüflings gesteuert wird (Einzelschrittmodus), wobei die Ausgangstestwerte (AT_T_Z) ausgelesen und mit den Ausgangstestwerten (AT_T) des Testplans (T) verglichen werden.Method according to at least one of the preceding claims, characterized in that by means of the information about the position (Pos) and the relation (Rel) and by means of the test plan (T) for at least one program part (P_Z) of the target program (Z) an initial marking (AM ) over the beginning of the program part (P_Z) and an end marking (EM) over the end of the program part (P_Z), wherein the execution of the target program at the start marker (AM) is stopped and the input test values given by the test plan (T) ( ET_T) are written to the determined positions of the respective input variables (E_P_Z), the target program is subsequently processed while processing these input test values (ET_T) and stopped again when the end marker (EM) is reached, or until then checked in the sequence under integrity monitoring of the stimulation variables of the functional test object is controlled (single step mode), wherein the initial test (AT_T_Z) and compared with the output test values (AT_T) of the test plan (T). Verfahren nach mindestens einem der vorhergehenden Ansprüche, dadurch gekennzeichnet, dass die Ergebnisse der Vergleiche gespeichert werden.Method according to at least one of the preceding claims, characterized in that the results of the comparisons are stored. Verfahren nach mindestens einem der vorherigen Ansprüche, dadurch gekennzeichnet, dass das Zielprogramm (Z) in einer den Kontroller simulierenden Zielumgebung ausgeführt wird, wobei die logischen Abläufe auf einem in Hardware ausgebildeten Kontroller nachbildet werden, während das Zielprogramm Z innerhalb der Zielumgebung ausgeführt wird.Method according to at least one of the preceding claims, characterized in that the target program (Z) is executed in a target environment simulating the controller, the logical operations being replicated on a hardware-formed controller while the target program Z is executed within the target environment. Verfahren nach Anspruch 6, dadurch gekennzeichnet, dass die Kontrolleinheit (TK) als programmtechnische Instanz ausgebildet wird, welche die Prozesskontrolle ausführt.A method according to claim 6, characterized in that the control unit (TK) is designed as a program-technical entity, which carries out the process control.
DE201010014720 2010-04-12 2010-04-12 Method for verifying code of target program used for software for automotive electronics for engine, involves comparing output test variables corresponding to each program section of target program and program code Pending DE102010014720A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
DE201010014720 DE102010014720A1 (en) 2010-04-12 2010-04-12 Method for verifying code of target program used for software for automotive electronics for engine, involves comparing output test variables corresponding to each program section of target program and program code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
DE201010014720 DE102010014720A1 (en) 2010-04-12 2010-04-12 Method for verifying code of target program used for software for automotive electronics for engine, involves comparing output test variables corresponding to each program section of target program and program code

Publications (1)

Publication Number Publication Date
DE102010014720A1 true DE102010014720A1 (en) 2011-12-15

Family

ID=45019751

Family Applications (1)

Application Number Title Priority Date Filing Date
DE201010014720 Pending DE102010014720A1 (en) 2010-04-12 2010-04-12 Method for verifying code of target program used for software for automotive electronics for engine, involves comparing output test variables corresponding to each program section of target program and program code

Country Status (1)

Country Link
DE (1) DE102010014720A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102017200161A1 (en) * 2017-01-09 2018-07-12 Robert Bosch Gmbh Method for detecting signals
CN117033198A (en) * 2023-08-09 2023-11-10 云海链控股股份有限公司 Software testing method, device, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102004014290A1 (en) 2004-03-24 2005-10-06 Iav Gmbh Ingenieurgesellschaft Auto Und Verkehr Method for creating procedures for testing software

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102004014290A1 (en) 2004-03-24 2005-10-06 Iav Gmbh Ingenieurgesellschaft Auto Und Verkehr Method for creating procedures for testing software

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102017200161A1 (en) * 2017-01-09 2018-07-12 Robert Bosch Gmbh Method for detecting signals
CN108287695A (en) * 2017-01-09 2018-07-17 罗伯特·博世有限公司 Method for detecting signal
CN117033198A (en) * 2023-08-09 2023-11-10 云海链控股股份有限公司 Software testing method, device, equipment and storage medium
CN117033198B (en) * 2023-08-09 2024-05-31 云海链控股股份有限公司 Software testing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
DE3787431T2 (en) Methods for generating a candidate list of faulty circuit elements and method for isolating faults in a logic circuit using this candidate list.
DE102005026040B4 (en) Parameterization of a simulation working model
DE102020205539A1 (en) Method and device for testing a technical system
DE102017211433B4 (en) Procedure for performing a function test of a control unit in a hardware-in-the-loop test, HIL test, and HIL test bench and control unit
EP3709166B1 (en) Method and system for secure signal manipulation for testing integrated security functionalities
EP3001313A1 (en) Methods for simulating an application program of an electronic control device on a computer
DE102016119320A1 (en) Method for configuring a real or virtual electronic control unit
DE10144050A1 (en) Verification of the software functions of a control unit, e.g. for use in automotive or machine tool applications, by use of a computer simulation model that is used for a experimental control unit and a serial control unit
EP3379351B1 (en) Method for operating an automation device and automation device
EP2706421A1 (en) Method for the computer-controlled generation of at least a portion of an executable control program
EP3285165A1 (en) Modification and simulation of the operating software of a technical system
EP3306295B1 (en) Method and device for testing electronic controls, in particular for testing of automobile control systems
DE112021003677T5 (en) AUTOMATED ASSISTED CIRCUIT VALIDATION
DE102010014720A1 (en) Method for verifying code of target program used for software for automotive electronics for engine, involves comparing output test variables corresponding to each program section of target program and program code
DE112013006981T5 (en) Control system test equipment
EP3617912A1 (en) Method and device for the computer-assisted generation of a component of a technical system
DE102020213809A1 (en) Method for operating a control device when testing software in the control device and method for operating a test computer when testing software in a control device
DE102016115314A1 (en) Modifying and simulating the operating software of a technical system
DE102020102996A1 (en) Process for an integrated design for the modeling, simulation and testing of a real-time architecture within a model-based system and software development
DE102017214610B4 (en) Method for checking at least one vehicle function and testing device
DE102020205540A1 (en) Method and device for testing a technical system
DE102020206327A1 (en) Method and device for testing a technical system
DE10325513B4 (en) Method and apparatus for creating a behavioral aspect of a formal verification circuit
DE102022112141A1 (en) Method for creating a simplified virtual control device
DE102017110065A1 (en) Method and computer program product for modeling a NOx storage behavior of a NOx storage catalyst

Legal Events

Date Code Title Description
R012 Request for examination validly filed