Junit
Cos'è il Testing?
metodo empirico per verificare la correttezza di un software ed è un processo automatizzato volto a mostrare il comportamento di un software su un dato input
Quante categorie di testing esistono?
- Black Box
- White Box
Cosa si testa nel Black Box Testing?
si verifica se il software produce il risultato previsto dato un determinato input, senza preoccuparsi di come il software funzioni internamente.
Cosa si testa nel White Box Testing?
si testano porzioni specifiche del codice sorgente.
Cos'è l'Unit Testing?
una metodologia di White Box Testing che testa l'unità di un codice sorgente.
Cos'è un'unità di codice in Unit Testing?
è la porzione più piccola di codice che può essere testata, come un programma, una funzione, una classe, un'interfaccia o un metodo.
Approccio Dividi et impera
divide et impera: il sistema viene suddiviso in unità, ciascuna delle quali viene testata separatamente per ridurre la probabilità di bug e impedire che gli errori si propaghino.
Approccio di test regression
Verifica che l'applicazione continui a funzionare correttamente anche dopo modifiche, aggiunte o modifiche al software, senza introdurre nuovi bug.
Cos'è JUnit?
è un framework di unit testing per Java che fornisce un'API per creare e gestire facilmente test. Offre strumenti di confronto, test runner per eseguire e aggregare test e facilità il processo di validazione del comportamento del software
Cos'è un Test Case in JUnit?
è un metodo che verifica una funzionalità specifica di un'unità di codice.
Cos'è una Test Suite in JUnit?
è una raccolta di unit test che possono essere eseguiti insieme.
Come dovrebbe essere il nome di un metodo di test case in JUnit?
il nome del metodo di test dovrebbe indicare il comportamento previsto.
Come dovrebbero essere chiamate le classi di test in JUnit?
le classi di test dovrebbero terminare con "Test", ad esempio MathTest.
Che annotazione usa JUnit?
Annotation driven (chiocciola sopra la funzione). Non si deve estendere nessuna classe speciale e i test annotati con @Test sono nulli (return void) e non accettano parametri.
Cosa fa l'annotazione @Test(timeout = 10)?
indica che il test deve terminare entro 10 secondi per essere considerato superato.
Cosa fa l'annotazione @Test(expected = IllegalArgumentException.class)?
indica che il test sarà considerato passato se viene lanciata un'eccezione di tipo IllegalArgumentException.
Cosa fa l'annotazione @Ignore("reason")?
viene usata per ignorare un test, fornendo una motivazione.
Cosa fa l'annotazione @Before (o @BeforeEach in JUnit 5) in JUnit?
indica che il metodo annotato verrà eseguito prima di ogni test case.
Cosa fa l'annotazione @After (o @AfterEach in JUnit 5) in JUnit?
indica che il metodo annotato verrà eseguito dopo ogni test case.
Cosa fa l'annotazione @BeforeClass(o @BeforeAll in JUnit 5) in JUnit?
segna un metodo che verrà eseguito una sola volta all'inizio della classe di test.
Cosa fa l'annotazione @AfterClass (o @AfterAll in JUnit 5) in JUnit?
segna un metodo che verrà eseguito una sola volta alla fine della classe di test.
Come si eseguono i test parametrizzati in JUnit?
utilizzando l'annotazione @RunWith(Parameterized.class) e un parametro contrassegnato con @Parameters.
Cosa fa una Test Suite in JUnit?
raggruppa vari test in una gerarchia e permette di eseguire più test insieme.
Esempio:
@RunWith(Suite.class)
@SuiteClasses({MyProgramTest.class, AnotherTest.class})
public class AllTests {
// test cases
}
Qual è la sintassi per confrontare due valori in JUnit?
assertEquals(expected, actual)
Come si confrontano valori float o double in JUnit?
assertEquals(expected, actual, epsilon) tenendo conto di una tolleranza (epsilon).
Come si verificano valori booleani in JUnit?
assertTrue(bool) e assertFalse(bool)
Come si verificano oggetti null o non null in JUnit?
assertNull(object) e assertNotNull(object)
Come si verificano due oggetti identici in JUnit?
assertSame(object1, object2)
Come si confrontano array in JUnit?
assertArrayEquals(expectedArray, actualArray)
Approcci per la verifica della correttezza di un codice sorgente
Approccio Divide et impera e Approccio di supporto testing regression
Cos'è un Parametrized Tests?
permettono di eseguire lo stesso caso di test con una serie di valori predefiniti
Quiz |
---|
Pattern Creazionali |
Design Patterns |
Architettura |
Contratti Operazioni |
Modello di dominio |
Diagrammi di sistema |
Casi d'uso |
だいひょうてきなしょくちゅうどくきんとそのしょうじょう |
Prácticas de histología - copia |
ingles vocabulario |
2535 week 7- pharma |
macbeth act 1 8/15 |
microbiology |
Parcial 2 |
Sistema Reprodutor |
plantes |
5. Por la ciudad |
yasmin |
Etapa 2 |
PARTO (NACIMIENTO) |
biologia1 |
woordjes 379-393 |
barocco |
4. Comida de negocios |
Terminologie (Suffixes)Termino |
Trajet 2 voc |
Exchange sunstances with their environment |
Bio systeme cardiovascualaire |
vocab 3 |
vocab 2 |
funções sintáticas |
GS belangrijke personen |
regras do femenino da língua francesa |
i pesci |
MEMBRANAS FETALES EN LOS GEMELOS |
as aventuras de polianavenha ver se voces realmente conhece as aventuras de poliana... |
sociologiesdefinitions |
zodziai |
função sintática |
OGGETTI DEI NEGOZI. |
orações subordinadas |
negozi. |
det stora engelska testet - kopia |
l |
responder preguntas de deja en paz a los muertos |
oliviaengels deel 2 |
plani |
vocabulario unit 1palabras |
ITALIAN |
partes del teatro |
Italian |
verbos irregulares |
Probabilidad. |
storia del arte |
scienze |
Onderdelen van het geraamte.Nederlands - Latijn. |
Frutta |
opsd |
HUMAN PHYSIOLOGY AND BIOCHEMISTRY |
Prácticas de histología |
2535 week 7- Patho |
LÍQUIDO AMNIÓTICO |
drama termanology |
VELLOCIDADES CORIÓNICAS |
CAMBIOS DE LA PLACENTA AL FINAL DEL EMBARAZO |
fonti normative |
caratteri fondamentali del fenomeno giuridico |
Examen Ordinario |
Religion prov 2 |
biologia celular |
geografiaa |
sistema solarsistema solar |
Les formes de l'Etat |
l'Etat et le droit constit |
números del 1 al 31 |
Forensic3 |
tech |
espressioni da utilizzare al ristornateristorante |
Magnetism |
tedescocibi |
higes |
Vocabulary |
Material de laboratorio |
Object Oriented Programming |
Ingles |
Java |
viruses |
photosynthesis |
Matspjälkning boken |
Lesson 4: Database Analysis and Design |
todo |
General Principles |
Lesson 3: Database Development Process |
Portuguêsportuguês verbos |
historychapter 1,2,3 |
Joana |
ESTRUCTURA DE LA PLACENTA |
Kickboxing |
Traumatologia |
accidentes de transito |
3. Familia y compañía |
VIOLACION |
Parcial 2 |
FRACTURE |
éducation physique - copieriennnn |
Etapa 1 |
PSIpsi |
unidades 9-10 |
esame di paciologia dei processi cognitivi ed emotivi |
Mapeh (Music) 2nd testStudy |
Grundpropleme der Sozialen Arbeit |
2. Metas profesionales |
skeletal system part 1 |
Lesson 2: Database Environment |
verbos regulares del alemán |
colores |
Paises y capitales - copia |
Paises y capitales |
Lesson 1: Introduction to Information Management |
Rhetoric cards |
direito economico |
HK åk 8 prov |
esp l pro 2h o2 |
glosor |
The Teacher and School Curriculum50 items test |
Verbos |
Histologia |
Sprecheafufgaben swei |
Amnios y cordón umbilical |
History test ww2 grade 10 |
português sermão teste |
BIOLOGÍA |
MEMBRANAS FETALES Y PLACENTA |
svt - copie |
svtflashcards svt |
vocabulary: social issuesejercicio donde he de rellenar huecos en blanco de frases de vocabulario sobre "social issues": corruption, curfew, demonstration, funding, gang, gather, go on strike, healthcare, homlessness, inequal... |
diritto costituzionale |
Guía Parcial 2 |
Peskeletal system |
les tissus musculaire osseux etc |
expressões algébrica de números racionaispara início de 7° ano |
GrammaticaGrammatica |
Vocabulary of school |
spanishspanish |
bio 30 digestion test |
physics heat test |
kap 9 |
Het karakter |
spanish vocab - claro 2 - 1.2 |
svt 2 |
anglais1 |
français |
englisch |
glosor v.45 |
filosofía |
Sonam300-400 |
BIO Topic 11 |
anaisnotre environnement |
contrôle de svt6eme |
contrôle svtles espèces et notre environnement |
Latein L.24 |
Filosofia |
Anglais |
physic chimicphysic chimie bien relire les question bonne chance :) |
Graphing quadratic equations (gr 10 math) |
Lägesadjektiv |
religion |
Specialiteter |
Sjukdoms- och behandlingstermer |
human body |
Complications des décubitus |
les complications du décubitus |
frölunda damlag |
types of demand |
floods |
floods |
verbs |
Chimie Physique |
Chimie organique |
Duits schritt 48 (3vwo) |
maths |
oppervlaktespanning (water) |
Biodiversitébah biodiversité |
Connecteurs logique |
itpstate of consciousness, learning, perception, memory |
egypttest |
english |
Literatura |
Hippocrates and galen |
Englisch Vokabeln |
normes et societe ! |
Účt-čtvrtletka |
Chaper 12 Psychology |
budhist worshipbuddhist |
Week 9 - Chapter 16 Somatic Sensation |
Kvalitativ metod |
christian worshiprs revision |
Week 9 - Chapter 17 Special Senses |
psycho cog |
statistica |
AdjetivosGrado comparativo:
- [mas + adj + que/de]
- [menos + adj + que/de]
- [tanto/tan + adj + como] o [igual + de + adj]
Superlativo:
- relativo: [el/la/los/las + más + adj]
- absoluto: [muy + adj] o [adj ... |
English: poetry |
Biologia celular e histológia |
Decisiones economicas coletivasPreguntas sobre un tena de economia de 1 Bachillerato. |
psicologia generale |
chem 30 term two test |
English NRI quiz 3 |
Another one? |
ARTO SUPERIORE muscoli spalla, braccio, avambraccio e mano |
voc anglais |
Surds |
English language topics |
Moles and molular mass |
TLE (Livelihood) 2nd testStudy |
les couleurs |
math |
Spiritual Self |
Französich Vokabeln Unité 1+2 Décuvertescool hier |
A christmas carol |
Lengua |
Arte |
definitions |
Material Self |
power and gender |
ak begrippen |
geografi |
Santi |
voc: Meteo, natuur, voyage |
francese geografia |
Sexual Self |
tedesco |
Perfectionnement |
adjectives and dependent prepositions |
Physical Self |
quimica |
oliviaengels deel 1 |
chemie kaartjes |
Science (2nd test)Study |
English (2nd test)study |
diritto |
JURIDICTIONS ET INSTITUTIONS ADMINISTRATIVES |
Law of Contract |
Physics |
etranger |
Irish Legal System |
Galileo Galilei |
storia del diritto italiano |
French |
Duits schritt 50 (3vwo) |
Duits schritt 51 D-N (3vwo) |
Duits schritt 48 (3vwo) |
All Station codes |
Biologi evolution |
Flashcards |
Saksa perhesanat |
COMMENT EST STRUCTURÉES LA SOCIÉTÉ FRANÇAISE ? |
BIOCHEM FINALS |
penal 3 |
penal 2 |
penal |
Cantigas de escarnio e maldizerCantigas de escarnio e maldizer. |
historia de España |