IT201800004297A1 - METHOD FOR AUTOMATIC TESTING OF THE ERROR CONDITIONS OF SOFTWARE PROGRAMS - Google Patents

METHOD FOR AUTOMATIC TESTING OF THE ERROR CONDITIONS OF SOFTWARE PROGRAMS Download PDF

Info

Publication number
IT201800004297A1
IT201800004297A1 IT102018000004297A IT201800004297A IT201800004297A1 IT 201800004297 A1 IT201800004297 A1 IT 201800004297A1 IT 102018000004297 A IT102018000004297 A IT 102018000004297A IT 201800004297 A IT201800004297 A IT 201800004297A IT 201800004297 A1 IT201800004297 A1 IT 201800004297A1
Authority
IT
Italy
Prior art keywords
code
error
lines
point
software
Prior art date
Application number
IT102018000004297A
Other languages
Italian (it)
Inventor
Roberto Montelatici
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 filed Critical
Priority to IT102018000004297A priority Critical patent/IT201800004297A1/en
Publication of IT201800004297A1 publication Critical patent/IT201800004297A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • 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

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)

Description

DESCRIZIONE DESCRIPTION

METODO PER IL TEST AUTOMATICO DELLE CONDIZIONI DI ERRORE DI METHOD FOR THE AUTOMATIC TEST OF THE ERROR CONDITIONS OF

PROGRAMMI SOFTWARE SOFTWARE PROGRAMS

SETTORE TECNICO TECHNICAL FIELD

Il metodo proposto dalla seguente invenzione permette di testare in modo automatico le condizioni di errore di una applicazione software che utilizzi la tecnologia delle cosiddette "trappole di errore" The method proposed by the following invention allows to automatically test the error conditions of a software application that uses the technology of the so-called "error traps"

STATO DELL'ARTE STATE OF THE ART

Ipotizzando il programma software suddiviso in sottoprogrammi, chiamati routine o metodi, come è universalmente adottato nei linguaggi dalla IV generazione in poi, metodi che si contraddistinguono per un nome o firma che viene richiamato da altre parti del programma con tutta una serie di parametri variabili. Assuming the software program is divided into subprograms, called routines or methods, as it is universally adopted in languages from generation IV onwards, methods that are characterized by a name or signature that is called up from other parts of the program with a whole series of variable parameters.

Le applicazione o programmi software possono, in ogni riga del codice che viene elaborato, affrontare una condizione di errore in cui il programma non è in grado di andare avanti, per esempio la divisione di u numero in cui il divisore abbia valore zero. Software applications or programs may, in each line of code being processed, face an error condition in which the program is unable to move forward, for example the division of u number where the divisor has a value of zero.

Nei linguaggi dalla IV generazione questo salto nel buio viene inquadrato verso un salto su particolari righe di codice dove viene inserito un messaggio codificato di errore o altro codice gestito dal programmatore. Per i linguaggi eredi del C si ha, all'interno di ogni routine o metodo, il costrutto TRY (metti sotto osservazione questo gruppo di righe di codice) e CATCH, seguito da un gruppo di righe di codice. Quando una riga di codice appartenente al gruppo sotto osservazione TRY va in un qualsiasi errore, l'elaborazione del programma salta nel gruppo di righe di codice del costrutto CATCH elaborandole sequenzialmente. In Generation IV languages this leap in the dark is framed towards a jump on particular lines of code where a coded error message or other code managed by the programmer is inserted. For languages inheriting C we have, within each routine or method, the construct TRY (observe this group of lines of code) and CATCH, followed by a group of lines of code. When a line of code belonging to the group under observation TRY goes into any error, the processing of the program jumps into the group of lines of code of the CATCH construct, processing them sequentially.

SINTESI DELL'INVENZIONE SUMMARY OF THE INVENTION

Il codice sorgente viene rielaborato aggiungendovi righe di codice utili solo per il test delle condizioni di errore: Non importa quale errore sia generato, in quanto le righe di codice del costrutto CATCH sono universali per tutte le condizioni di errore. Si riscrive quindi il codice sorgente inserendo manualmente il costrutto TRY CATCH su tutte le routine o metodi del programma. Questa operazione preliminare del programmatore permette di attivare la metodologia descritta dalla seguente invenzione in modo automatico con un apposito software che legge il codice sorgente e lo restituisce modificato. The source code is reworked by adding lines of code that are useful only for testing error conditions: It doesn't matter which error is generated, as the CATCH lines of code are universal for all error conditions. The source code is then rewritten by manually inserting the TRY CATCH construct on all the routines or methods of the program. This preliminary operation of the programmer allows to activate the methodology described by the following invention automatically with a special software that reads the source code and returns it modified.

Viene quindi inserito in automatico, all'inizio di ogni routine o metodo, dopo il costrutto TRY, una riga con un errore noto, ad esempio la già citata divisione per zero, e quindi, alla fine del gruppo di righe di codice del costrutto CATCH del codice che annulla la condizione di errore, per esempio rivalorizzare la variabile che era zero con un valore diverso da zero, e quindi richiamare lo stesso metodo o routine in modalità ricorsiva. It is then inserted automatically, at the beginning of each routine or method, after the TRY construct, a line with a known error, for example the aforementioned division by zero, and then, at the end of the group of lines of code of the CATCH construct some code that clears the error condition, for example re-evaluating the variable that was zero with a non-zero value, and then calling the same method or procedure in recursive mode.

Ovviamente la divisione per zero è solo un esempio, la metodologia della presente invenzione prevede semplicemente che nel costrutto TRY venga inserito un errore noto e che nel costrutto CATCH, prima di richiamare la routine in modalità ricorsiva questo errore venga risolto in modo da far funzionare il programma nella modalità senza errori. Vantaggiosamente questo test viene effettuato quando gli errori veri del programma sono già stati corretti. La metodologia è applicabile a tutti i software sviluppati con linguaggi che utilizzino la tecnologia della "trappola dell'errore" che solo in alcuni linguaggi si chiama "CATCH", Obviously the division by zero is just an example, the methodology of the present invention simply provides that a known error is inserted in the TRY construct and that in the CATCH construct, before calling the routine in recursive mode this error is resolved in order to make the program in error-free mode. Advantageously, this test is carried out when the true errors of the program have already been corrected. The methodology is applicable to all software developed with languages that use the technology of the "error trap" which only in some languages is called "CATCH",

BREVE DESCRIZIONE DEI DISEGNI BRIEF DESCRIPTION OF THE DRAWINGS

Nella figura 1 possiamo distinguere: In figure 1 we can distinguish:

INIZIO ROUTINE START ROUTINE

COSTRUTTO TRY BUILT TRY

RIGHE DI CODICE INSRITE CON ERRORE NOTO (1) LINES OF CODE INSERTED WITH KNOWN ERROR (1)

COSTRUTTO CATCH BUILT CATCH

RIGHE DI CODICE INSERITE CON RIPRISTINO ERRORE NOTO (2) CODE LINES INSERTED WITH KNOWN ERROR RESET (2)

RICHAMO RICORSIVO INIZIO ROUTINE (3) RECURRING REQUEST START ROUTINE (3)

Nella elaborazione quando il programma trova (2) salta ne costrutto CATCH, elabora tutte le righe del costrutto CATCH e quindi trova (2) che annulla la condizione di errore (1), quindi con le istruzioni (3) ritorna a inizio routine elaborando il codice sorgente senza errori aggiunti. In the processing, when the program finds (2) it jumps into the CATCH construct, processes all the lines of the CATCH construct and then finds (2) which cancels the error condition (1), then with the instructions (3) it returns to the start of the routine processing the source code with no added errors.

Claims (1)

RIVENDICAZIONI 1] Metodo per il test delle condizioni di errore scritte nei software nelle cosiddette "trappole dell'errore" caratterizzato dai seguenti passi: a) Verifica che il software sia scritto in un linguaggio strutturato in sottoprogrammi, altrimenti detti routine o metodi b) Verifica che tutti i sottoprogrammi abbiano la trappola dell'errore e un gruppo di righe di codice sotto osservazione in cui un errore fa saltare nella trappola dell'errore e) Inserimento di ulteriori righe di codice, ai soli fini del test, righe di codice comportanti un errore noto e sicuro in una posizione qualsiasi nel gruppo di righe di codice sotto osservazione d) Inserimento di ulteriori righe di codice, ai soli fini del test, dopo le righe di codice originali della trappola dell'errore,i righe di codice che ripristinano l'errore noto di cui al punto e) e) Inserimento, dopo le righe di codice del punto d) del richiamo ricorsivo del sottoprogramma in cui stiamo operando, la cui esecuzione a questo punto non andrà più in errore perché il codice del punto e) non darà più errore grazie al codice del punto d) 2) Realizzazione in automatico dei punti e) d) e) della rivendicazione 1) con un software che legge il codice sorgente e lo riscrive modificato 3] Estensione del metodo della rivendicazione 1 anche al caso che in un sottoprogramma vi siano più gruppi di linee di codice sotto osservazione e quindi più trappole dell'errore ripetendo più volte i punto e) d) ed e) della rivendicazione 1 41 Realizzazione in automatico con un software che legge il codice sorgente e lo riscrive modificato anche del costrutto semantico descritto nella rivendicazione 3) CLAIMS 1] Method for testing error conditions written in software in the so-called "error traps" characterized by the following steps: a) Verify that the software is written in a language structured in subroutines, otherwise called routines or methods b) Verify that all subprograms have the error trap and a group of lines of code under observation where an error causes you to jump into the error trap e) Insertion of additional lines of code, for the sole purpose of the test, lines of code involving a known and certain error in any position in the group of lines of code under observation d) Insertion of additional lines of code, for the sole purpose of the test, after the original lines of code of the error trap, the lines of code that reset the known error referred to in point e) e) Insertion, after the lines of code of point d), of the recursive call of the subroutine in which we are operating, whose execution at this point will no longer go into error because the code of point e) will no longer give an error thanks to the code of point d) 2) Automatic realization of points e) d) e) of claim 1) with software that reads the source code and rewrites it modified 3] Extension of the method of claim 1 also to the case that in a subroutine there are several groups of code lines under observation and therefore more error traps by repeating points e) d) and e) of claim 1 several times 41 Automatic realization with a software that reads the source code and rewrites it, also modified, of the semantic construct described in claim 3)
IT102018000004297A 2018-04-09 2018-04-09 METHOD FOR AUTOMATIC TESTING OF THE ERROR CONDITIONS OF SOFTWARE PROGRAMS IT201800004297A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
IT102018000004297A IT201800004297A1 (en) 2018-04-09 2018-04-09 METHOD FOR AUTOMATIC TESTING OF THE ERROR CONDITIONS OF SOFTWARE PROGRAMS

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
IT102018000004297A IT201800004297A1 (en) 2018-04-09 2018-04-09 METHOD FOR AUTOMATIC TESTING OF THE ERROR CONDITIONS OF SOFTWARE PROGRAMS

Publications (1)

Publication Number Publication Date
IT201800004297A1 true IT201800004297A1 (en) 2019-10-09

Family

ID=62952206

Family Applications (1)

Application Number Title Priority Date Filing Date
IT102018000004297A IT201800004297A1 (en) 2018-04-09 2018-04-09 METHOD FOR AUTOMATIC TESTING OF THE ERROR CONDITIONS OF SOFTWARE PROGRAMS

Country Status (1)

Country Link
IT (1) IT201800004297A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6820251B1 (en) * 2000-11-06 2004-11-16 Hewlett-Packard Development Company, L.P. System and method for a software recovery mechanism
US20070162246A1 (en) * 2006-01-06 2007-07-12 Roland Barcia Exception thrower

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6820251B1 (en) * 2000-11-06 2004-11-16 Hewlett-Packard Development Company, L.P. System and method for a software recovery mechanism
US20070162246A1 (en) * 2006-01-06 2007-07-12 Roland Barcia Exception thrower

Similar Documents

Publication Publication Date Title
Xu et al. Regression test selection for AspectJ software
CN106469049B (en) File scanning method and device
Fedyukovich et al. eVolCheck: Incremental upgrade checker for C
CN103440337A (en) API (application program interface) compatibility scanning method and API compatibility scanning device
CN112685315A (en) C-source code-oriented automatic formal verification tool and method
Santelices et al. DUA-Forensics: a fine-grained dependence analysis and instrumentation framework based on Soot
US20090249285A1 (en) Automatic Generation of Run-Time Instrumenter
JP2022052734A (en) Automated generation of software patch
IT201800004297A1 (en) METHOD FOR AUTOMATIC TESTING OF THE ERROR CONDITIONS OF SOFTWARE PROGRAMS
Kreutzer et al. Language-agnostic generation of compilable test programs
Campinhos et al. Type-safe evolution of web services
Chittimalli et al. GEMS: a generic model based source code instrumentation framework
DE102019105418B3 (en) Method for generating a representation of program logic, decompiling device, recompiling system and computer program products
CN106649118B (en) A kind of generation method of the Java code SSA single path based on AST
US11119740B2 (en) Parsability of code snippets
CN103488519A (en) Implement method of interactive scripting language interpreter
Kim et al. Code transformation issues in move-instance-method refactorings
Amyot et al. Structural Coverage for Lotos: A Probe Insertion Technique
CN111459808A (en) Type inference-based guided test case variation method
Olderog A characterization of Hoare's logic for programs with Pascal-like procedures
CN117520191B (en) Test completeness checking method, device and storage medium based on program path
Bernardi et al. An interprocedural aspect control flow graph to support the maintenance of aspect oriented systems
Gül et al. Mutative Fuzzing for an Assembler Compiler.
CN111026401A (en) Mobile terminal thermal restoration method
IT201800008072A1 (en) Optimized method of debugging and testing software programs