Testen Flashcards
What is testing and why is it important
Testing makes sure that the Software does what it should do .
It meets the requirement
find errors or security issues
Regression
What is testing?
It is the selective execution of codes under specific condition to observe its behavior
-> under special Condition-input perequirement
Result->output postrequirement
what is Debugging
localising of errors
What should testfall contain?
Precondition
postcondition
Input
expected output
Reading prove
Test Orakel= expected output?
what are the requirement
it should not be a software unit test
automatically from specification generated
manual
Test types
automated and manual
Test technik
Example test
Character test
Test object
black box and white box
Test reference
Funktionoriented/specificationbased
structure oriented
What are the type of tests
Nach getestetem Teil der Software
◦ Komponententests – Testen einzelne Einheiten (z.B. Klassen, Methoden) isoliert
◦ Integrationstests – Testen mehrere Einheiten und ihre Interaktion
◦ Systemtests – Testen das gesamte System, u.U. sogar im Betrieb
◦ User-Interface-Tests – Testen grafische Benutzeroberflächen
Interest of tests?
Akzeptanztests – Verifiziert, dass Software Anforderungen erfüllt
◦ Smoketests – Einfache Tests, um gravierende Probleme zu erkennen
◦ Usabilitytests – Testen die Benutzbarkeit für Nuzter_innen
◦ Accessibilitytests – dito, für Nutzer_innen mit Einschränkungen
◦ Sicherheitstests – Testen auf bestimmte Sicherheitslücken
◦ Performanztests – Testen Reaktionsverhalten und Ressourcennutzung
Komponentest what it is what is its Objective who is the test objekt what is the environment?
what it is - smallest independent software unit klass module
what is its Objective -makes sure that the component specification meets -> robustheitei
who is the test objekt each comopnen
what is the environment?
Testdriver->program which call the componen and takes the reaction
stubs-> replacement of components that are needed for the tested components
testrahmen- collection of all program that
System test what it is what is its Objective who is the test objekt what is the environment?
what it is? test of whole system
what is its Objective? Systemspecification are fullfilled-> functional /non functional requirement
who is the test objekt? system
what is the environment? produktive not kunden
Integrationstest what it is what is its Objective who is the test objekt what is the environment?
what it is ? it connects the component to part of bigger system
what is its Objective? it looks for mistakes in the formation of the component
who is the test objekt? together partsystem what is the environment?
testtreiber->reusability of components
monitore-> diagnoseinstrument for daten bewegungen
integrationsstrategie-
top down-> starts with high schicht
bottom up
Beispielbasiertes Testen adv and disadv
Adv
Creation of test input and expected results is easy
Test/verification of programoutput is easy
disac
test quality dependent on choice of input
parameter can be forgetten
Eigenschaftsbasiertes Testen
it verifies the adherence characteristc of the code
test framework-> random
complex->generator
Häufig getestete Eigenschaft
Unäre Funktionen (z.B. List.sort, List.reverse)
◦ Totalität: sort(x) ist für alle x definiert, produziert keine Fehler
◦ Injektivität: wenn reverse(x) == reverse(y), dann x == y
◦ Surjektivität: für alle y existiert ein x so dass sort(x) == y
◦ Idempotenz: sort(sort(x)) == sort(x)
* Inverse Funktionen (z.B. serialize and deserialize)
◦ Isomorphismen: deserialize(serialize(x)) == x und
serialize(deserialize(y)) == y
* Binäre Funktionen (z.B. String.concat, Set.union, Integer.add)
◦ Identität: x ++ “” == x
◦ Kommutativität: x ++ y == y ++ x
◦ Assoziativität: x ++ (y ++ z) == (x ++ y) ++ z
* Binäre Relationen (z.B. Object.equals, Ordering.lessThan)
◦ Reflexivität: x == x
◦ Symmetrie: if x == y then y == x
◦ Transitivität: if x == y and y == z then x == z
Advantage and disadvantage of characterictis testing
vorteile-> Advantages:
Thoroughness: More exhaustive than example-based testing due to many generated input values.
Edge Case Detection: Random inputs are more likely to uncover edge cases.
Automated Simplification: Automatically generates minimal counterexamples.
Disadvantages:
Limited Applicability: Only suitable for mathematically definable relationships.
Identifying Properties: Finding the right properties to verify can be challenging.
Verification Complexity: Determining whether program outputs are correct can be difficult without an external test oracle.