Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
a 2010/11
Outcomes:
1. verification criteria are defined for all software units against their
requirements;
2. software units defined by the design are produced;
3. consistency and traceability are established between software
requirements and design and software units;
4. verification of the software units against the requirements and the
design is accomplished.
Outcomes:
Software Testing
.. standard IEEE 610.12-1990 :
TESTING
(1) The process of operating a system or component under specified conditions,
observing or recording the results, and making an evaluation of some aspect
of the system or component.
(2) (IEEE Std.729-1983) The process of analyzing a software item to detect the
differences between existing and required conditions (that is, bugs) and to
evaluate the features of the software item.
See also:
a so: accepta
acceptance
ce testing;
test g; benchmark;
be c a ; checkout;
c ec out; component
co po e t testing;
test g;
development testing; dynamic analysis; formal testing; functional testing;
informal testing; integration testing; interface testing; loopback testing;
mutation testing; operational testing; performance testing; qualification
testing; regression testing; stress testing; structural testing; system testing;
unit testing.
Software Testing
Testing: il processo in cui un sistema software o un suo componente,
es. un programma, è eseguito con lo specifico intento di individuare
malfunzionamenti, prima che esso sia rilasciato all’utente finale
component
to be
tested
results
tester
test cases
valori di input con cui
esercitare il componente
Software Testing
Scopi:
• Identificare la presenza di malfunzionamenti di un software
=> presenza di difetti
• Valutare la rispondenza di un sistema ai requisiti, funzionali e non
… una delle
d ll principali
i i li attività
tti ità di verifica
ifi e validazione
lid i del
d l software
ft
… una delle principali attività per l’assicurazione della qualità del software
Attenzione:
il testing non può dimostrare l’assenza di difetti, ma può solo dimostrare la
presenza di difetti (Dijkstra)
… se eseguendo il testing non riesco ad individuare malfunzionamenti, non è
detto che non vi siano difetti …
… non vi è garanzia che se alla n-esima prova un modulo od un sistema abbia
risposto correttamente (ovvero non sono stati più riscontrati difetti), altrettanto
possa fare alla (n+1)-esima
… impossibilità di produrre tutte le possibili configurazioni di valori di input (test
case) in corrispondenza di tutti i possibili stati interni di un sistema software
Gestione dei Sistemi Software
Prof. G. A. Di Lucca - Univ. del Sannio
7
…...
repeat
B0
… l’impossibiltà del testing esaustivo … if R1 then
if R2 then
per il semplice programma if R3 then
schematizzato a fianco,
fianco se il ciclo viene B1
eseguito solamente al max 20 volte si else
possono avere oltre 100.000 miliardi di B2
endif
possibili esecuzioni diverse !!
if R4 then
Nell’ipotesi che ciascun test case sia B3
elaborato in 1 ms sarebbero necessari else
3170 anni !! B4
endif
else
B5
endif
endif
until R6
……….
Ingegneria del Software
Ing. G. A. Di Lucca - Univ. del Sannio
8
Software Testing
Software Testing
Failure (Fallimento/malfunzionamento):
evento osservabile di violazione delle specifiche (ovvero del
comportamento atteso);
Fault (difetto/anomalia):
Insieme di informazioni (dati di ingresso, valori di variabili,
istruzioni, etc.) che quando processate possono produrre un
fallimento;
Error (errore):
causa che genera un difetto.
NB - non tutti gli errori (mistake) producono un fallimento;
NB.
- un fault può generare molti fallimenti.
Esempio
Testing Strategy
• Starting by ‘testing-in-the-small’ and move toward ‘testing-in-the-
large’
• For conventional ((i.e. not OO)) software
– The module (component) is our initial focus
– Integration of modules follows
• For OO software
– focus when “testing in the small” changes from an individual
module (the conventional view) to an OO class that
encompasses attributes and operations and implies
communication and collaboration
Testing Strategy
integration
test
unit test
S ft
Software System
S t
validation system
test test
Gestione dei Sistemi Software
Prof. G. A. Di Lucca - Univ. del Sannio
14
Il processo di testing
Unit
testing
Module
testing
Sub-system
testing
System
testing
Acceptance
testing
Testing di unità
(detto anche di modulo)
Testing di integrazione
il testing è applicato ad un aggregato di due o più unità di un sistema
software;
ll'obiettivo
obiettivo è quello di rilevare errori nelle interazioni fra le unità e
nelle funzioni che l'aggregato deve assolvere;
tipicamente non è compito dei programmatori che hanno prodotto le
unità componenti.
Testing di sistema
il testing è applicato sul sistema software completo ed integrato;
l'obiettivo è quello di valutare l'adesione del sistema ai requisiti
specificati;
effettuato dal team addetto al testing;
Vanno testati tutti i tipi di requisiti, non sono solo i requisiti
funzionali;
Ad esempio:
Prestazioni;
Sicurezza;
Manutenibilità;
Usabilità;
.......etc.
alpha testing
beta testing
installazione ed uso del sistema in ambiente reale prima della
immissione sul mercato.
Testing di accettazione
testing effettuato sull'intero sistema sulla base di un piano e di
procedure approvate dal cliente (o utente);
l'obiettivo é quello di mettere il cliente, l'utente o altri a ciò preposti
(collaudatori o enti ad hoc) in condizione di decidere se accettare il
prodotto;
• Validation testing
– Focus is on software requirements
• Performance Testing
– test the run-time
run time performance of software within the context of an
integrated system
• Stress testing
– executes a system in a manner that demands resources in abnormal
quantity, frequency, or volume
• Security testing
– verifies that protection mechanisms built into a system will, in fact, protect
p p penetration
it from improper p
• Recovery testing
– forces the software to fail in a variety of ways and verifies that recovery is
properly performed