Search Images Maps Play YouTube News Gmail Drive More »
Sign in
Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.

Patents

  1. Advanced Patent Search
Publication numberUS20060248538 A1
Publication typeApplication
Application numberUS 10/529,638
PCT numberPCT/EP2003/010442
Publication dateNov 2, 2006
Filing dateSep 18, 2003
Priority dateOct 1, 2002
Also published asEP1406166A1, EP1406166B1, US7584457, US20040123273, WO2004031946A1
Publication number10529638, 529638, PCT/2003/10442, PCT/EP/2003/010442, PCT/EP/2003/10442, PCT/EP/3/010442, PCT/EP/3/10442, PCT/EP2003/010442, PCT/EP2003/10442, PCT/EP2003010442, PCT/EP200310442, PCT/EP3/010442, PCT/EP3/10442, PCT/EP3010442, PCT/EP310442, US 2006/0248538 A1, US 2006/248538 A1, US 20060248538 A1, US 20060248538A1, US 2006248538 A1, US 2006248538A1, US-A1-20060248538, US-A1-2006248538, US2006/0248538A1, US2006/248538A1, US20060248538 A1, US20060248538A1, US2006248538 A1, US2006248538A1
InventorsJosef Dietl, Reiner Hammerich
Original AssigneeJosef Dietl, Reiner Hammerich
Export CitationBiBTeX, EndNote, RefMan
External Links: USPTO, USPTO Assignment, Espacenet
Xml interfaces in unified rendering
US 20060248538 A1
Abstract
Computer implemented methods are provided for validating computer code in order to reduce errors at runtime. In one implementation, the method comprises providing a computer program by defining at least one set of definition instructions, at least one set of implementation instructions, and a script code section. The definition instructions and the implementation instructions may be described in XML. Further, the method may comprise validating the set of definition instructions and the set of implementation instructions using a validation tool, and validating the script code section using the set of implementation instructions.
Images(2)
Previous page
Next page
Claims(21)
1. A computer-implemented method for validating computer code, comprising:
providing a computer program by defining at least one set of definition instructions, at least one set of implementation instructions and at least a script code section;
validating the set of definition instructions and the set of implementation instructions using a validation tool; and
validating the script code section using the set of implementation instructions.
2. The method according to claim 1, wherein the set of definition instructions are classes and the set of implementation instructions are interfaces.
3. The method according to claim 1, wherein the set of definition instructions are converted into classes and the set of implementation instructions are converted into interfaces.
4. The method according to claim 3, wherein the set of definition instructions and the set of implementation instructions are described in XML.
5. The method according to claim 4, wherein the classes and the interfaces are defined in Java language.
6. The method according to claim 1, wherein the set of definition instructions is defined in a tree structure.
7. The method according to claim 1, wherein the script code section is JavaScript.
8. The method according to claim 1, wherein validating the script code section comprises generating a symbol table by executing the code section in an interpreter, and comparing the symbol table with the implementation instructions.
9. (canceled)
10. The method according to claim 1, wherein the set of implementation instructions is defined in a tree structure.
11. The method according to claim 1, wherein the set of definition instructions is defined in a first tree structure and the set of implementation instructions is defined in a second tree structure.
12. A computer readable medium that is readable by a processor, the computer readable medium comprising a set of instructions executable by the processor to perform a method for validating computer code, the method comprising:
defining a set of definition instructions;
defining a set of implementation instructions;
defining a script code section;
validating the set of definition instructions and the set of implementation instructions using a validation tool; and
validating the script code section using the set of implementation instructions.
13. The computer readable medium according to claim 12, wherein the set of definition instructions are classes and the set of implementation instructions are interfaces.
14. The computer readable medium according to claim 12, wherein the set of definition instructions are converted into classes and the set of implementation instructions are converted into interfaces.
15. The computer readable medium according to claim 14, wherein the set of definition instructions and the set of implementation instructions are described in XML.
16. The computer readable medium according to claim 15, wherein the classes and the interfaces are defined in Java language.
17. The computer readable medium according to claim 12, wherein the set of definition instructions is defined in a tree structure.
18. The computer readable medium according to claim 12, wherein the script code section is JavaScript.
19. The computer readable medium according to claim 12, wherein validating the script code section comprises generating a symbol table by executing the code section in an interpreter, and comparing the symbol table with the implementation instructions.
20. The computer readable medium according to claim 12, wherein the set of implementation instructions is defined in a tree structure.
21. The computer readable medium according to claim 12, wherein the set of definition instructions is defined in a first tree structure and the set of implementation instructions is defined in a second tree structure.
Description
  • [0001]
    The invention relates in general to programmable electronic multipurpose computers.
  • [0002]
    Scripting languages, such as JavaScript and Perl, can be used to program applications to be run on computer systems. Correctness of the programmed scripting code is desirable, as with any computer programming in general. A program can be checked or validated prior to use to reduce errors occurring during runtime of the code. It is an object of the invention to reduce the number of errors in computer code. Therefore, the invention provides for a computer implemented method for validation of computer code according to claim 1. By validating both sets of instructions with the script code used, the number of errors will be reduced.
  • [0003]
    Objects, aspects and advantages of the invention will be better understood from the following detailed description of a preferred embodiment of the invention.
  • [0004]
    A computer program can be defined in design documentation and specifications. From this starting point an actual implementation can be coded using a suitable programming language.
  • [0005]
    According to the invention the coding is done using a two-component interface-classes model, and a script coded section. Non-limiting examples of such programming languages are compiler languages and object oriented programming languages. In compiler languages, such as for example Modula-2, these components are implemented as definition modules and implementation modules. In object oriented programming languages, such as for example Java, C++, C#, and Modula-3, the components are implemented as interfaces and classes, wherein interfaces are equivalent to definition modules and classes are equivalent to implementation modules. The script-coded section can be programmed using any suitable script language, such as for example JavaScript and Perl.
  • [0006]
    Interfaces in object-oriented programming are used for several purposes. To function for example as a record of promises (with respect to functionality) given by one (“provider”) class. This fact is used to verify automatically during compilation whether a second “customer” object is relying on features of a class that have not been promised. Also the interface is used to verify whether the actual implementation of the provider class keeps all its promises.
  • [0007]
    This allows inspection of the code during compilation and to test or validate whether errors with respect to these fundamentals would occur during runtime. For example methods that are offered by the object can be checked, as well as compliance of object classes with the respective interfaces. If errors are found these can be reported during compilation, so that the errors in the source code can be corrected. Thus runtime errors are reduced in the compiled code.
  • [0008]
    For example, if an interface promises the availability of a certain method but the method is not present in the implementation, a “customer” of that method would fail at latest at run time. Interfaces enable modern compiler languages to verify the availability of the method during compilation, eliminating this failure mode with the associated debugging effort.
  • [0009]
    Another example is that can be checked whether a method of an object is called in the code that is not present in the interface. This would lead in the compiled code during runtime to errors. By checking the interface, this can be caught at the outset, eliminating this failure mode during runtime.
  • [0010]
    In one embodiment of the invention, a program is programmed in object oriented style using two separate tree structures, written in XML, wherein the first tree structure represents the classes to be implemented and the second tree structure represents the associated interfaces. Note that the invention is not limited to the implementation shown in this example, and that any programming implementation yielding a set of classes/definitions and interfaces/implementations can be employed. Based on this tree structures in XML executable programs can be generated, for example using Extensible Stylesheet Language (XSL) or Apache Velocity. XSL defines the code using two parts; a language for transforming XML documents, and an XML vocabulary for specifying formatting semantics. An XSL style sheet specifies the presentation of a class of XML documents by describing how an instance of the class is transformed into an XML document that uses the formatting vocabulary. On the XML level a syntax check is performed between the interface description and the implementation class description.
  • [0011]
    Using this method executable programs can be generated for different platforms, for example ABAP, Net and JavaScript. In case the executable code generated does implement classes and interfaces, such as is the case with ABAP and .Net, the validity of that code can be verified with a compiler program that performs the usage and implementation checks at the semantics level. Then executable program code is generated from the interface description and from the implementation class description. The thus generated code can then use or call the script coded section when needed.
  • [0012]
    In this example, the generation of executable programs in script languages, such as for example JavaScript is done by first generating an intermediate code, using a language that supports classes and interfaces. In this example, the intermediate code used can be Java, with implementation for interfaces and classes. The validity of these interfaces and classes is then proved using methods as described above, i.e. using a compiler that performs the usage and implementation checks at the semantics level. This can be done for example by comparing the resulting interfaces with the classes obtained. A successful validation of the Java code means that the original XML code is correct for at least the interface and classes definition. Further the script code section is checked by running it trough an interpreter. This can be for example a JavaScript interpreter if the script code is written in JavaScript. Such interpreters or parsers are known per se in the art. The interpreter yields at least a symbol table including various elements, such as for example variables, used by the script code. The information included in the symbol table is compared to the original XML implementation description. From this comparison can be derived whether the script code is compatible with the implementation description. If the script code is validated accordingly, executable code generated from the sets of definition and implementation instructions, is validated for use with the script code. Thus validated, the number of runtime errors is reduced.
  • [0013]
    In a further embodiment of the invention, two separate tree structures are provided for, together with a script code section. The first tree structure describes interfaces, while the second tree structure describes content in the form of classes for a HTML document. The script code section provides functionality for the HTML document, such as for example scrolling of text. The tree structures can be programmed for example in XML, and the script code section can be programmed in JavaScript.
  • [0014]
    The invention further relates to a program storage device readable by a computer system, embodying a program of instructions executable by the computer system to perform any method according to the invention. As this invention may be embodied in several forms without departing from the spirit of essential characteristics thereof, the present embodiment is therefore illustrative and not restrictive, since the scope of the invention is defined by the appended claims rather than by the description preceding them, and all changes that fall within the metes and bounds of the claims, or equivalence of such metes and bounds thereof are therefore intended to be embraced by the claims.
Patent Citations
Cited PatentFiling datePublication dateApplicantTitle
US6594823 *Sep 13, 2000Jul 15, 2003Microsoft CorporationMethod and system for representing a high-level programming language data structure in a mark-up language
US6754884 *Jul 2, 2001Jun 22, 2004Bea Systems, Inc.Programming language extensions for processing XML objects and related applications
US6823504 *Nov 15, 2000Nov 23, 2004Sun Microsystems, Inc.Method and apparatus for interfacing a javascript interpreter with library of host objects implemented in java
US6990654 *Sep 14, 2001Jan 24, 2006Bea Systems, Inc.XML-based graphical user interface application development toolkit
US7584457 *Sep 30, 2003Sep 1, 2009Sap AgValidating programs
US7962925 *Nov 26, 2002Jun 14, 2011Oracle International CorporationSystem and method for XML data binding
US20040123273 *Sep 30, 2003Jun 24, 2004Reiner HammerichValidating programs
Non-Patent Citations
Reference
1 *Gosling, James, Bill Joy, Buy Steele, and Gilad Bracha. "The Java (TM) Language Specification, Second Edition." 2000, Addison-Wesley. Second edition. Additionally cite Chapter 13, pages 251-273.
2 *Gosling, James, Bill Joy, Buy Steele, and Gilad Bracha. "The Java (TM) Language Specification, Second Edition." 2000, Addison-Wesley. Second edition. Pages 1, 72-77, 119-133, 135-153, 199-202, 219-227, and 229-249.
3 *Gosling, James, Bill Joy, Guy Steele, and Gilad Bracha. "The Java (TM) Language Specification, Second Edition." 2000, Addison-Wesley. Second edition. Additionally cite Chapter 18, pages 449-456
Referenced by
Citing PatentFiling datePublication dateApplicantTitle
US7529792Oct 29, 2003May 5, 2009Sap AktiengesellschaftMethod and apparatus for selecting a renderer
US7783885Sep 29, 2003Aug 24, 2010Sap AktiengesellschaftHybrid digital signature workflow
US20040128612 *Sep 29, 2003Jul 1, 2004Josef DietlHybrid digital signature workflow
US20040143627 *Oct 29, 2003Jul 22, 2004Josef DietlSelecting a renderer
Classifications
U.S. Classification719/318, 714/E11.173, 714/E11.218
International ClassificationG06F9/44, G06F13/00, G06F11/36, G06F11/273, G06F9/46, G06F9/45
Cooperative ClassificationG06F11/2294, G06F8/436, G06F11/3608
European ClassificationG06F11/36A2, G06F11/22R, G06F8/436
Legal Events
DateCodeEventDescription
Nov 4, 2005ASAssignment
Owner name: SAP AG, GERMANY
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:DIETL, JOSEF;HAMMERICH, REINER;REEL/FRAME:017188/0687
Effective date: 20051101
Dec 21, 2005ASAssignment
Owner name: SAP AG, GERMANY
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:SAP AKTIENGESELLSCHAFT;REEL/FRAME:017347/0220
Effective date: 20050609
Owner name: SAP AG,GERMANY
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:SAP AKTIENGESELLSCHAFT;REEL/FRAME:017347/0220
Effective date: 20050609
Aug 26, 2014ASAssignment
Owner name: SAP SE, GERMANY
Free format text: CHANGE OF NAME;ASSIGNOR:SAP AG;REEL/FRAME:033625/0223
Effective date: 20140707