a
This commit is contained in:
1360
.obsidian/plugins/obsidian-completr/scanned_words.txt
vendored
1360
.obsidian/plugins/obsidian-completr/scanned_words.txt
vendored
File diff suppressed because it is too large
Load Diff
61
.obsidian/workspace.json
vendored
61
.obsidian/workspace.json
vendored
@@ -6,15 +6,37 @@
|
|||||||
{
|
{
|
||||||
"id": "a600c6aabfc0c1e6",
|
"id": "a600c6aabfc0c1e6",
|
||||||
"type": "tabs",
|
"type": "tabs",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "fe0b3a4c5bea6157",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "pdf",
|
||||||
|
"state": {
|
||||||
|
"file": "WS2425/SWT D/Vorlesung/swtd_merged.pdf"
|
||||||
|
},
|
||||||
|
"icon": "lucide-file-text",
|
||||||
|
"title": "swtd_merged"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b132bb5dcec4264f",
|
||||||
|
"type": "tabs",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": "910b9380583bd4b9",
|
"id": "910b9380583bd4b9",
|
||||||
"type": "leaf",
|
"type": "leaf",
|
||||||
"state": {
|
"state": {
|
||||||
"type": "empty",
|
"type": "markdown",
|
||||||
"state": {},
|
"state": {
|
||||||
|
"file": "WS2425/SWT D/Notes.md",
|
||||||
|
"mode": "source",
|
||||||
|
"source": false
|
||||||
|
},
|
||||||
"icon": "lucide-file",
|
"icon": "lucide-file",
|
||||||
"title": "New tab"
|
"title": "Notes"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -100,7 +122,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "backlink",
|
"type": "backlink",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "WS2425/Data Science/Ue_P/exercise_9/excercise_9.pdf",
|
"file": "WS2425/SWT D/Praktikum/swtd-p-07.pdf",
|
||||||
"collapseAll": false,
|
"collapseAll": false,
|
||||||
"extraContext": false,
|
"extraContext": false,
|
||||||
"sortOrder": "alphabetical",
|
"sortOrder": "alphabetical",
|
||||||
@@ -110,7 +132,7 @@
|
|||||||
"unlinkedCollapsed": true
|
"unlinkedCollapsed": true
|
||||||
},
|
},
|
||||||
"icon": "links-coming-in",
|
"icon": "links-coming-in",
|
||||||
"title": "Backlinks for excercise_9"
|
"title": "Backlinks for swtd-p-07"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -230,19 +252,20 @@
|
|||||||
"obsidian-livesync:Show log": false
|
"obsidian-livesync:Show log": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "b8336cb3c3d06be9",
|
"active": "910b9380583bd4b9",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"WS2425/Data Science/VL/lecture_13.pdf",
|
"WS2425/SWT D/Vorlesung/swtd_merged.pdf",
|
||||||
"WS2425/Data Science/VL/lecture_12.pdf",
|
"WS2425/SWT D/Praktikum/swtd-p-08.pdf",
|
||||||
"WS2425/Data Science/VL/lecture_11.pdf",
|
"WS2425/SWT D/Notes.md",
|
||||||
"WS2425/Data Science/VL/lecture_10.pdf",
|
"WS2425/SWT D/Praktikum/swtd-p-07.pdf",
|
||||||
"WS2425/Data Science/Trial exam/trial_exam.pdf",
|
"WS2425/SWT D/Praktikum/swtd-p-06.pdf",
|
||||||
"WS2425/Data Science/Trial exam/trial_exam_ml.pdf",
|
"WS2425/SWT D/Praktikum/swtd-p-05.pdf",
|
||||||
"WS2425/Data Science/Trial exam",
|
"WS2425/SWT D/Praktikum/swtd-p-04.pdf",
|
||||||
"WS2425/Data Science/Ue_P/exercise_10/excercise_10_solution.pdf",
|
"WS2425/SWT D/Praktikum/swtd-p-3.pdf",
|
||||||
"WS2425/Data Science/Ue_P/exercise_10/excercise_10.pdf",
|
"WS2425/SWT D/Praktikum/swtd-p-02.pdf",
|
||||||
"WS2425/Data Science/Ue_P/exercise_10",
|
"WS2425/SWT D/Praktikum/swtd-p-01.pdf",
|
||||||
"WS2425/Data Science/Ue_P/exercise_09/excercise_9_solution.pdf",
|
"WS2425/SWT D/Uebung/swtd-ue-01.pdf",
|
||||||
|
"WS2425/Data Science/Cheat Sheet Mockup.md",
|
||||||
"WS2425/Data Science/Ue_P/exercise_4/4.md",
|
"WS2425/Data Science/Ue_P/exercise_4/4.md",
|
||||||
"WS2425/Theoretische Informatik/000-Notes/Notes.md",
|
"WS2425/Theoretische Informatik/000-Notes/Notes.md",
|
||||||
"WS2425/Web Tech/Übung/4/Ü4.md",
|
"WS2425/Web Tech/Übung/4/Ü4.md",
|
||||||
@@ -277,8 +300,6 @@
|
|||||||
"SS24/SWT2/KW17/KW17.md",
|
"SS24/SWT2/KW17/KW17.md",
|
||||||
"SS24/SWT2/KW16/KW16.md",
|
"SS24/SWT2/KW16/KW16.md",
|
||||||
"SS24/SWT2/KW24/KW24.md",
|
"SS24/SWT2/KW24/KW24.md",
|
||||||
"SS24/SWT2/KW23/KW23.md",
|
"SS24/SWT2/KW23/KW23.md"
|
||||||
"SS24/SWT2/KW20/KW20.md",
|
|
||||||
"CCN/Ex02/Exercise 2.md"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
400
WS2425/Data Science/Cheat Sheet Mockup.md
Normal file
400
WS2425/Data Science/Cheat Sheet Mockup.md
Normal file
@@ -0,0 +1,400 @@
|
|||||||
|
![[lecture_02.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1. **Definition of Data:**
|
||||||
|
- Data is information collected, stored, or processed. It is ubiquitous and can be measured or categorized.
|
||||||
|
|
||||||
|
2. **Data Basics:**
|
||||||
|
- **Basic Population:** Entire group of interest (e.g., all students).
|
||||||
|
- **Sample:** Subset of the population (e.g., students in a lecture).
|
||||||
|
- **Statistical Unit:** Individual data point (e.g., one student).
|
||||||
|
- **Variable:** Characteristics of units (e.g., name, population size).
|
||||||
|
- **Value:** Specific value of a variable (e.g., "123456" for "MatrNr").
|
||||||
|
|
||||||
|
3. **Data Categories:**
|
||||||
|
- **Structured vs. Unstructured:**
|
||||||
|
- **Structured:** Organized data with a predefined format (e.g., tables).
|
||||||
|
- **Unstructured:** No traditional format (e.g., text, images).
|
||||||
|
- **Discrete vs. Continuous:**
|
||||||
|
- **Discrete:** Countable values (e.g., grades).
|
||||||
|
- **Continuous:** Any value within a range (e.g., temperature).
|
||||||
|
- **Levels of Measurement:**
|
||||||
|
- **Nominal:** Labels without order (e.g., colors).
|
||||||
|
- **Ordinal:** Ordered labels (e.g., school grades).
|
||||||
|
- **Interval:** Ordered with equal intervals (e.g., Celsius).
|
||||||
|
- **Ratio:** Interval with a true zero (e.g., weight).
|
||||||
|
- **Qualitative vs. Quantitative:**
|
||||||
|
- **Qualitative:** Categorical (e.g., gender).
|
||||||
|
- **Quantitative:** Numerical (e.g., height).
|
||||||
|
|
||||||
|
![[lecture_03.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
1. **Primary vs. Secondary Data:**
|
||||||
|
- **Primary Data:** Collected directly for a specific purpose (e.g., surveys, experiments).
|
||||||
|
- **Secondary Data:** Existing data from other sources (e.g., books, journals).
|
||||||
|
|
||||||
|
2. **Ways to Obtain Data:**
|
||||||
|
- **Capturing Data:** Collecting through sensors, observations, or experiments.
|
||||||
|
- **Retrieving Data:** Accessing from databases, APIs, or open data sources.
|
||||||
|
- **Collecting Data:** Scraping from websites or logs when direct access isn't available.
|
||||||
|
|
||||||
|
3. **Databases:**
|
||||||
|
- **Relational Databases:** Use SQL for structured data but have limitations with big data.
|
||||||
|
- **NoSQL Databases:** Handle unstructured or semi-structured data, offering flexibility and scalability.
|
||||||
|
- **Document-Oriented Databases:** Store data in formats like JSON, ideal for e-commerce and IoT.
|
||||||
|
|
||||||
|
4. **APIs:**
|
||||||
|
- REST-APIs enable communication between systems, using HTTP methods (GET, POST, PUT, DELETE).
|
||||||
|
- Often require authentication (e.g., API keys) and provide data in JSON/XML formats.
|
||||||
|
|
||||||
|
5. **Data Scraping:**
|
||||||
|
- Extracting data from websites or logs when APIs aren't available.
|
||||||
|
- Legal and ethical considerations must be addressed.
|
||||||
|
|
||||||
|
|
||||||
|
![[lecture_04.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
1. **Data Protection and Anonymization:**
|
||||||
|
- **GDPR Compliance:** Personal data must be protected, and usage requires consent.
|
||||||
|
- **Anonymization:** Removing personal identifiers to prevent individual identification.
|
||||||
|
- **Pseudonymization:** Using non-unique identifiers, requiring additional info for identification.
|
||||||
|
- **Hashing:** Converting data to fixed-size values (e.g., SHA-256) for privacy.
|
||||||
|
|
||||||
|
2. **Statistical Basics:**
|
||||||
|
- **Descriptive Statistics:** Summarizes data (e.g., mean, median).
|
||||||
|
- **Exploratory Data Analysis:** Identifies patterns and outliers.
|
||||||
|
- **Inferential Statistics:** Draws conclusions about populations from samples.
|
||||||
|
|
||||||
|
3. **Frequencies and Histograms:**
|
||||||
|
- **Frequencies:** Count of occurrences of each value.
|
||||||
|
- **Absolute vs. Relative Frequencies:** Raw counts vs. proportions.
|
||||||
|
- **Histograms:** Visual representation of data distribution across classes.
|
||||||
|
|
||||||
|
4. **Empirical Distribution Function (EDF):**
|
||||||
|
- Plots cumulative frequencies to show data distribution over a range.
|
||||||
|
|
||||||
|
5. **Data Visualization:**
|
||||||
|
- **Pie Charts:** Effective for showing proportions of categorical data.
|
||||||
|
- **Bar Charts:** Compare frequencies across categories.
|
||||||
|
- **Histograms:** Display distribution of continuous data.
|
||||||
|
|
||||||
|
![[lecture_05.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
1. **Central Tendencies:**
|
||||||
|
- **Mode:** The most frequently occurring value in a dataset.
|
||||||
|
- **Median:** The middle value when data is ordered, dividing the dataset into two equal halves.
|
||||||
|
- **Mean:** The average value, calculated by summing all observations and dividing by the number of observations.
|
||||||
|
|
||||||
|
2. **Statistical Dispersion:**
|
||||||
|
- **Range:** The difference between the maximum and minimum values.
|
||||||
|
- **Interquartile Range (IQR):** The difference between the third quartile (Q3) and first quartile (Q1), representing the middle 50% of the data.
|
||||||
|
- **Variance and Standard Deviation:** Measures of spread, with variance being the average squared deviation from the mean and standard deviation the square root of variance.
|
||||||
|
|
||||||
|
3. **Data Visualization:**
|
||||||
|
- **Histograms:** Display the distribution of continuous data across classes.
|
||||||
|
- **Box Plots:** Show the five-number summary (minimum, Q1, median, Q3, maximum) and identify outliers.
|
||||||
|
|
||||||
|
4. **Outliers:**
|
||||||
|
- Defined as data points falling outside the range of [Q1 - 1.5*IQR, Q3 + 1.5*IQR].
|
||||||
|
- Can indicate errors, unusual observations, or novel data points.
|
||||||
|
|
||||||
|
![[lecture_06.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
1. **Empirical Variance Calculation**:
|
||||||
|
- **Data**: Daily temperatures (°C): 11.2, 13.3, 14.1, 13.7, 12.2, 11.3, 9.9
|
||||||
|
- **Mean (x̄)**: 12.24
|
||||||
|
- **Sum of squared deviations**: 14.16
|
||||||
|
- **Empirical Variance (s̃²)**: \( $\frac{14.16}{7}$ = 2.02 \)
|
||||||
|
- **Empirical Standard Deviation (s̃)**: \( $\sqrt{2.02} \approx 1.42$ \)
|
||||||
|
|
||||||
|
2. **Contingency Table Analysis**:
|
||||||
|
- **Variables**: Growth (shrinking, growing, growing strongly) and Location (North, South)
|
||||||
|
- **Absolute Frequencies**:
|
||||||
|
- North: 29 (growing), 13 (growing strongly), 7 (shrinking)
|
||||||
|
- South: 13 (growing), 19 (growing strongly), 2 (shrinking)
|
||||||
|
- **Chi-squared (χ²) Test**:
|
||||||
|
- Calculated χ²: 7.53
|
||||||
|
- **Corrected Pearson Contingency Coefficient (K*P)**:
|
||||||
|
- \( K*P = $\sqrt{\frac{7.53}{7.53 + 83}} \times \sqrt{\frac{2}{2}} = 0.41$ \)
|
||||||
|
- Interpretation: Weak to medium correlation between location and growth.
|
||||||
|
|
||||||
|
3. **Correlation Coefficient**:
|
||||||
|
- **Pearson Correlation Coefficient (rXY)** for population and area:
|
||||||
|
- Calculated rXY: 0.70
|
||||||
|
- Interpretation: Strong positive correlation.
|
||||||
|
|
||||||
|
4. **Key Concepts**:
|
||||||
|
- **Empirical Variance**: Measures data spread around the mean.
|
||||||
|
- **Contingency Tables**: Used for nominal/ordinal data to assess associations.
|
||||||
|
- **Pearson Correlation**: Measures linear correlation between metric variables, ranging from -1 to 1.
|
||||||
|
|
||||||
|
![[lecture_07.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1. **Probability Theory Basics**:
|
||||||
|
- **Sample Space (Ω)**: Set of all possible outcomes.
|
||||||
|
- **Event**: Subset of the sample space.
|
||||||
|
- **Probability Axioms** (Kolmogorov):
|
||||||
|
1. \( P(A) $\geq 0$ \)
|
||||||
|
2. \( P(Ω) = 1 \)
|
||||||
|
3. Additivity for disjoint events.
|
||||||
|
|
||||||
|
2. **Conditional Probability**:
|
||||||
|
- **Definition**: \( P(A|B) = $\frac{P(A \cap B)}{P(B)}$ \)
|
||||||
|
- **Independence**: Events A and B are independent if \( P(A \cap B) = P(A)P(B) \).
|
||||||
|
|
||||||
|
3. **Bayes' Theorem**:
|
||||||
|
- **Formula**: \( P(B|A) = $\frac{P(A|B)P(B)}{P(A)}$ \)
|
||||||
|
- **Example**:
|
||||||
|
- \( P(B|A) = $\frac{0.9 \times 0.01}{0.9 \times 0.01 + 0.02 \times 0.99}$ = 0.31 \)
|
||||||
|
|
||||||
|
4. **Combinatorics**:
|
||||||
|
- **Permutations**: \( n! \) for unique items.
|
||||||
|
- **Combinations**: \( $\binom{n}{k} = \frac{n!}{k!(n-k)!}$ \)
|
||||||
|
- **Multiplication Rule**: \( n_1 $\times n_2 \times \dots \times n_r$ \)
|
||||||
|
|
||||||
|
5. **Key Calculations**:
|
||||||
|
- **Password Example**: \( 7^2 $\times$ P(10,4) = 49 $\times$ 5040 = 246960 \)
|
||||||
|
- **Dice Probability**: \( P($\text{at least one 6 in 4 throws}$) = 1 - (5/6)^4 = 0.518 \)
|
||||||
|
|
||||||
|
![[lecture_08_neu.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
1. **Random Variables**:
|
||||||
|
- **Definition**: A function that assigns numerical values to outcomes in a sample space.
|
||||||
|
- **Discrete vs. Continuous**:
|
||||||
|
- Discrete: Countable outcomes (e.g., dice roll).
|
||||||
|
- Continuous: Uncountable outcomes (e.g., measurement of height).
|
||||||
|
|
||||||
|
2. **Probability Distributions**:
|
||||||
|
- **Discrete**:
|
||||||
|
- **Bernoulli**: \( $f(x) = p^x(1-p)^{1-x}$\) for \( $x \in \{0,1\}$ \).
|
||||||
|
- **Binomial**: \( $f(x) = \binom{n}{x}p^x(1-p)^{n-x}$ \) for \( $x \in \{0,1,...,n\}$ \).
|
||||||
|
- **Uniform**: \( $f(x) = \frac{1}{m}$ \) for \($x \in \{1,2,...,m\}$ \).
|
||||||
|
- **Continuous**:
|
||||||
|
- **Uniform**: \( $f(x) = \frac{1}{b-a}$ \) for \( $x \in [a,b]$ \).
|
||||||
|
- **Normal (Gaussian)**: \( $f(x) = \frac{1}{\sqrt{2\pi\sigma^2}}e^{-(x-\mu)^2/(2\sigma^2)}$ \).
|
||||||
|
|
||||||
|
3. **Expected Value and Variance**:
|
||||||
|
- **Discrete**:
|
||||||
|
- **Expected Value**: \( $E(X) = \sum x \cdot f(x)$ \).
|
||||||
|
- **Variance**: \( $Var(X) = E((X-E(X))^2)$ \).
|
||||||
|
- **Continuous**:
|
||||||
|
- **Expected Value**: \( $E(X) = \int_{-\infty}^{\infty} x \cdot f(x)dx$ \).
|
||||||
|
- **Variance**: \( $Var(X) = E((X-E(X))^2)$ \).
|
||||||
|
|
||||||
|
4. **Key Calculations**:
|
||||||
|
- **Bernoulli Distribution**:
|
||||||
|
- \( $E(X) = p$ \), \( $Var(X) = p(1-p)$ \).
|
||||||
|
- **Binomial Distribution**:
|
||||||
|
- \( $E(X) = np$ \), \( $Var(X) = np(1-p)$ \).
|
||||||
|
- **Uniform Distribution (Discrete)**:
|
||||||
|
- \( $E(X) = \frac{m+1}{2}$ \), \( $Var(X) = \frac{m^2-1}{12}$ \).
|
||||||
|
- **Uniform Distribution (Continuous)**:
|
||||||
|
- \( $E(X) = \frac{a+b}{2}$ \), \( $Var(X) = \frac{(b-a)^2}{12}$ \).
|
||||||
|
- **Normal Distribution**:
|
||||||
|
- \( $E(X) = \mu$ \), \( $Var(X) = \sigma^2$ \).
|
||||||
|
|
||||||
|
5. **Normal Distribution**:
|
||||||
|
- **Standard Normal (Z-Score)**: \( $Z = \frac{X-\mu}{\sigma} \sim N(0,1)$ \).
|
||||||
|
- **68-95-99.7 Rule**: 68% data within \( $\mu \pm \sigma$ \), 95% within \( $\mu \pm 2\sigma$ \), 99.7% within \( $\mu \pm 3\sigma$ \).
|
||||||
|
|
||||||
|
![[lecture_09.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Here are the key points and calculations from the provided data:
|
||||||
|
|
||||||
|
1. **Simple Linear Regression**:
|
||||||
|
- **Model**: \( $Y = \beta_0 + \beta_1X + \epsilon$ \), where \( $\epsilon \sim N(0, \sigma^2$) \).
|
||||||
|
- **Estimation**: Parameters \( $\beta_0$ \) and \( $\beta_1$ \) are estimated using least squares method.
|
||||||
|
|
||||||
|
2. **Least Squares Estimators**:
|
||||||
|
- **Slope (β̂₁)**:
|
||||||
|
\[$$
|
||||||
|
\hat{\beta}_1 = \frac{\sum_{i=1}^{n}(Y_i - \bar{Y})(X_i - \bar{X})}{\sum_{i=1}^{n}(X_i - \bar{X})^2}
|
||||||
|
$$\]
|
||||||
|
- **Intercept (β̂₀)**:
|
||||||
|
\[$$
|
||||||
|
\hat{\beta}_0 = \bar{Y} - \hat{\beta}_1 \bar{X}
|
||||||
|
$$\]
|
||||||
|
|
||||||
|
3. **Residual Analysis**:
|
||||||
|
- **Residuals**: \( $e_i = Y_i - \hat{Y}_i$ \).
|
||||||
|
- **Residual Plot**: Used to check model assumptions (linearity, constant variance, normality).
|
||||||
|
|
||||||
|
4. **Coefficient of Determination (R²)**:
|
||||||
|
- **Formula**:
|
||||||
|
\[$$
|
||||||
|
R^2 = \frac{\text{RSS}}{\text{TSS}} = 1 - \frac{\text{ESS}}{\text{TSS}}
|
||||||
|
$$\]
|
||||||
|
- **Interpretation**: Measures goodness of fit (0 ≤ R² ≤ 1).
|
||||||
|
|
||||||
|
5. **Variance Estimation**:
|
||||||
|
- **Residual Sum of Squares (RSS)**:
|
||||||
|
\[$$
|
||||||
|
RSS = \sum_{i=1}^{n}(Y_i - \hat{Y}_i)^2
|
||||||
|
$$\]
|
||||||
|
- **Variance Estimator**:
|
||||||
|
\[$$
|
||||||
|
\hat{\sigma}^2 = \frac{RSS}{n-2}
|
||||||
|
$$\]
|
||||||
|
|
||||||
|
6. **Key Calculations**:
|
||||||
|
- **Example Calculations**:
|
||||||
|
- For given data, compute \( $\hat{\beta}_0$ \), \( $\hat{\beta}_1$ \), and \( $\hat{\sigma}^2$ \).
|
||||||
|
- Calculate R² to assess model fit.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
![[lecture_10.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
1. **Confidence Intervals**:
|
||||||
|
- **Point Estimator**: Provides a single estimate of a population parameter.
|
||||||
|
- **Interval Estimator**: Provides a range of values within which the parameter is expected to lie.
|
||||||
|
- **Formula for Mean (σ known)**:
|
||||||
|
\[$$
|
||||||
|
\left[ \bar{X} - z_{1-\alpha/2} \frac{\sigma}{\sqrt{n}}, \bar{X} + z_{1-\alpha/2} \frac{\sigma}{\sqrt{n}} \right]
|
||||||
|
$$\]
|
||||||
|
- **Formula for Mean (σ unknown)**:
|
||||||
|
\[$$
|
||||||
|
\left[ \bar{X} - t_{n-1,1-\alpha/2} \frac{S}{\sqrt{n}}, \bar{X} + t_{n-1,1-\alpha/2} \frac{S}{\sqrt{n}} \right]
|
||||||
|
$$\]
|
||||||
|
|
||||||
|
2. **Statistical Tests**:
|
||||||
|
- **Hypothesis Testing**: Involves setting up a null hypothesis (H₀) and an alternative hypothesis (H₁), then determining whether to reject H₀ based on sample data.
|
||||||
|
- **Z-Test**: Used when the population variance is known.
|
||||||
|
- **Test Statistic**: \( $Z = \frac{\bar{X} - \mu_0}{\sigma / \sqrt{n}}$ \)
|
||||||
|
- **T-Test**: Used when the population variance is unknown.
|
||||||
|
- **Test Statistic**: \( $T = \frac{\bar{X} - \mu_0}{S / \sqrt{n}}$ \)
|
||||||
|
- **Two-Sample T-Test**: Compares the means of two independent groups.
|
||||||
|
- **Test Statistic**: \( $T = \frac{\bar{X} - \bar{Y}}{\sqrt{\frac{S_X^2}{n} + \frac{S_Y^2}{m}}}$ \)
|
||||||
|
|
||||||
|
3. **Key Calculations**:
|
||||||
|
- **Example 1**: 95% confidence interval for bonbon package weights.
|
||||||
|
- **Result**: [63.84, 65.08]
|
||||||
|
- **Example 2**: Testing machine adjustment with t-test.
|
||||||
|
- **Result**: Null hypothesis not rejected, machine does not need adjustment.
|
||||||
|
- **Example 3**: Two-sample t-test for bonbon weights.
|
||||||
|
- **Result**: Reject H₀, second company’s bonbons are heavier.
|
||||||
|
|
||||||
|
![[lecture_11.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
1. **Point Estimation**:
|
||||||
|
- A point estimator (e.g., sample mean) estimates the parameter θ from a random sample.
|
||||||
|
- Example: For a normal distribution, the arithmetic mean estimates the expected value.
|
||||||
|
|
||||||
|
2. **Confidence Intervals**:
|
||||||
|
- A range [gl, gu] where θ is likely to lie with probability 1−α.
|
||||||
|
- Types: One-sided (e.g., [gl, ∞)) and two-sided (finite interval).
|
||||||
|
|
||||||
|
3. **Statistical Hypothesis Testing**:
|
||||||
|
- **Null Hypothesis (H0)**: Statement to be tested (e.g., μ = 15).
|
||||||
|
- **Alternative Hypothesis (H1)**: Opposing statement (e.g., μ ≠ 15).
|
||||||
|
- **Test Statistic**: A function of the sample data to assess H0 vs. H1.
|
||||||
|
- **Rejection Region**: Values of the test statistic leading to rejection of H0.
|
||||||
|
- **Errors**:
|
||||||
|
- **Type I Error**: Rejecting a true H0 (controlled by significance level α).
|
||||||
|
- **Type II Error**: Failing to reject a false H0 (related to test power).
|
||||||
|
|
||||||
|
4. **Z-Test and T-Test**:
|
||||||
|
- **Z-Test**: Used when population variance is known or sample size is large.
|
||||||
|
- **T-Test**: Used when population variance is unknown; relies on sample standard deviation and t-distribution.
|
||||||
|
|
||||||
|
5. **Two-Sample T-Test**:
|
||||||
|
- Compares means of two independent groups.
|
||||||
|
- **Assumptions**: Normality, independence, homogeneity (if variances are equal).
|
||||||
|
- **Test Statistic**: Accounts for sample means, standard deviations, and sizes.
|
||||||
|
- **Degrees of Freedom**: Calculated using Welch-Satterthwaite equation for unequal variances.
|
||||||
|
|
||||||
|
6. **Examples**:
|
||||||
|
- **One-Sample Test**: Chocolate box weights using z-test (known variance).
|
||||||
|
- **Two-Sample Test**: Comparing bonbon weights using t-test with Welch-Satterthwaite adjustment.
|
||||||
|
|
||||||
|
7. **Key Concepts**:
|
||||||
|
- **p-value**: Probability of observing test statistic under H0; compared to α.
|
||||||
|
- **Confidence Interval and Hypothesis Test Relationship**: Rejecting H0 if the parameter lies outside the confidence interval.
|
||||||
|
|
||||||
|
8. **Future Topics**: Data preparation and decision trees.
|
||||||
|
|
||||||
|
![[lecture_12.pdf]]
|
||||||
|
|
||||||
|
|
||||||
|
1. **Machine Learning Overview**:
|
||||||
|
- Involves data preparation, model building, and evaluation.
|
||||||
|
- Follows the CRISP-DM process: Business understanding, data understanding, modeling, evaluation, and deployment.
|
||||||
|
|
||||||
|
2. **Data Preparation**:
|
||||||
|
- **Handling Missing Data**: Strategies include filtering, marking, or imputing missing values (e.g., mean, median, or model-based imputation).
|
||||||
|
- **Handling False Data**: Identify and correct errors through analysis or expert consultation.
|
||||||
|
- **Feature Engineering**: Create new features from existing data (e.g., deriving age from birthdate) or combine attributes for better model performance.
|
||||||
|
|
||||||
|
3. **Decision Trees**:
|
||||||
|
- **Structure**: A tree with nodes representing tests on attributes, leading to leaf nodes with class predictions.
|
||||||
|
- **Construction**: Built by recursively splitting data to minimize entropy (disorder). Information gain determines the best split.
|
||||||
|
- **Example**: Medicine recommendation based on blood pressure and age.
|
||||||
|
- **Pros and Cons**: Easy to interpret but may overfit or require discretization for numerical attributes.
|
||||||
|
|
||||||
|
4. **Model Evaluation**:
|
||||||
|
- **Train-Test Split**: Evaluate models on independent test data to avoid overfitting.
|
||||||
|
- **Metrics for Regression**: Mean Squared Error (MSE), Mean Absolute Error (MAE).
|
||||||
|
- **Metrics for Classification**: Confusion matrix, accuracy, precision, recall, F1 score.
|
||||||
|
- **Accuracy**: Overall correctness.
|
||||||
|
- **Precision**: Correct predictions among positive predictions.
|
||||||
|
- **Recall**: Correct predictions among actual positive instances.
|
||||||
|
- **F1 Score**: Harmonic mean of precision and recall.
|
||||||
|
|
||||||
|
5. **Advanced Topics**:
|
||||||
|
- **Ensemble Methods**: Random Forests and Gradient Boosting improve decision trees by reducing variance and bias.
|
||||||
|
- **Model Comparison**: Use validation sets to compare models and avoid overfitting.
|
||||||
|
|
||||||
|
6. **Summary**:
|
||||||
|
- **Skills Acquired**: Data preparation, decision tree classification, and model evaluation.
|
||||||
|
- **Future Topics**: Dashboards and summaries for data visualization and reporting.
|
||||||
|
|
||||||
|
|
||||||
|
![[lecture_13.pdf]]
|
||||||
|
|
||||||
|
1. **Model Evaluation Basics**:
|
||||||
|
- **Overfitting**: When a model fits the training data too well, leading to poor performance on new data.
|
||||||
|
- **Underfitting**: When a model is too simple to capture the data's structure, resulting in poor performance on both training and test data.
|
||||||
|
|
||||||
|
2. **Data Splitting**:
|
||||||
|
- **Train-Test Split**: Commonly used to evaluate model performance. Typical splits are 80% for training and 20% for testing.
|
||||||
|
- **Train-Validation-Test Split**: Used to compare different models by having separate training, validation, and test sets.
|
||||||
|
|
||||||
|
3. **Evaluation Metrics**:
|
||||||
|
- **Regression Metrics**:
|
||||||
|
- **Mean Squared Error (MSE)**: Average of squared differences between predicted and actual values.
|
||||||
|
- **Mean Absolute Error (MAE)**: Average of absolute differences.
|
||||||
|
- **Mean Absolute Percentage Error (MAPE)**: Average of percentage differences.
|
||||||
|
- **Classification Metrics**:
|
||||||
|
- **Confusion Matrix**: Tabulates true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN).
|
||||||
|
- **Accuracy**: (TP + TN) / (TP + TN + FP + FN).
|
||||||
|
- **Precision**: TP / (TP + FP).
|
||||||
|
- **Recall**: TP / (TP + FN).
|
||||||
|
- **F1 Score**: Harmonic mean of precision and recall, given by \( $F1 = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}}$ \).
|
||||||
|
|
||||||
|
4. **Example Calculations**:
|
||||||
|
- **Confusion Matrix Example**:
|
||||||
|
- Accuracy: \( $\frac{4 + 1}{10} = 0.5$ \)
|
||||||
|
- Precision: \( $\frac{4}{6} \approx 0.66$ \)
|
||||||
|
- Recall: \( $\frac{4}{7} \approx 0.57$ \)
|
||||||
|
- F1 Score: \( $\frac{2 \times 0.66 \times 0.57}{0.66 + 0.57} \approx 0.31$ \)
|
||||||
|
|
||||||
|
5. **Interpreting Results**:
|
||||||
|
- **Baseline Comparison**: Always compare model performance against a naive reference (e.g., predicting the majority class).
|
||||||
|
- **Contextual Relevance**: Accuracy alone may not indicate practical usefulness; consider domain context and baseline performance.
|
||||||
|
|
||||||
|
6. **Summary**:
|
||||||
|
- **Skills Acquired**: Understanding of evaluation metrics and their application in assessing machine learning models.
|
||||||
|
- **Future Topics**: Advanced evaluation techniques and model optimization strategies.
|
||||||
|
|
||||||
264
WS2425/SWT D/Notes.md
Normal file
264
WS2425/SWT D/Notes.md
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
|
||||||
|
**Softwaretechnik D: Qualitätssicherung und Wartung – Zusammenfassung**
|
||||||
|
|
||||||
|
**1. Motivation und Grundlagen**
|
||||||
|
|
||||||
|
* **Warum Qualität?** Software durchdringt unser Leben, Systemkomplexität steigt, Einsatz in sicherheitskritischen Bereichen. In Deutschland: Hohe Arbeitskosten erfordern hohe Qualität zur Wettbewerbsfähigkeit.
|
||||||
|
* **Qualitätsmerkmale:** Spezifikationsvollständigkeit, Testbarkeit, Portierbarkeit, Korrektheit, Ressourcenschonung, Einfachheit, Ausfallsicherheit, Rechengenauigkeit, Bedienbarkeit, Dokumentation.
|
||||||
|
* **Wie entsteht Qualität?** Durch gezielte Maßnahmen: Was, Wie, Wann, Wer?
|
||||||
|
* **Mittel zur Qualitätssicherung:** Reviews, Tests (Unit, Integration, Blackbox, Whitebox), Richtlinien, Standards, Planung, Schulungen, Werkzeuge, Metriken, Prozessqualität.
|
||||||
|
|
||||||
|
**2. Ziele und Themen**
|
||||||
|
|
||||||
|
* **Ziel:** Kenntnisse zur Erzielung eines definierten Qualitätsniveaus und methodisches Vorgehen bei der Softwarewartung.
|
||||||
|
* **Weg:** Operationalisierung des Qualitätsbegriffs über Qualitätsmodelle, Differenzierung in organisatorische, analytische und konstruktive Maßnahmen.
|
||||||
|
* **Themen:** Qualitätsmodelle, Fehlerquellen, Prozessqualität, konstruktive Maßnahmen, manuelle und dynamische Prüfmethoden (Tests), Testautomatisierung, Testen objektorientierter Programme, statische Prüfmethoden/Metriken, Werkzeuge/Build-Automatisierung, Wartung.
|
||||||
|
|
||||||
|
**3. Voraussetzungen und Klausur**
|
||||||
|
|
||||||
|
* **Voraussetzungen:** Softwaretechnik 1 und 2 (Analyse, Entwurf), Java-Programmiererfahrung.
|
||||||
|
* **Klausur:** Inhalte aus Vorlesung (Folien, Tafel), Übungen, Praktikum. Aufgabentypen: Definitionen, Verständnisfragen, Anwendung (Testfälle, Qualitätsmängel).
|
||||||
|
|
||||||
|
**4. Was ist Software?**
|
||||||
|
|
||||||
|
* Programme, Abläufe, Dokumentation, Daten.
|
||||||
|
* **Besonderheiten:** Immateriell, benötigt Träger, leicht änderbar, schwache Kausalität zwischen Änderung und Wirkung, keine stetige Funktion, schwer zu vermessen, wird entwickelt (nicht gefertigt), verschleißt nicht, altert über die Umgebung.
|
||||||
|
|
||||||
|
**5. Qualitätsmodelle**
|
||||||
|
|
||||||
|
* **Qualität:** Gesamtheit von Eigenschaften und Merkmalen zur Erfüllung gegebener Erfordernisse (DIN 55350).
|
||||||
|
* **Qualitätsmodell:** Ableitung von Unterbegriffen (Qualitätsmerkmale) und Teilmerkmalen zur Messbarkeit/Überprüfbarkeit durch Qualitätsindikatoren (Metriken).
|
||||||
|
* **FCM-Qualitätsmodelle:** Factor-Criteria-Metrics-Models
|
||||||
|
* Schematischer Aufbau: Software-Qualität -> Q-Merkmal (factor) -> Q-Teilmerkmal (criterion) -> Qualitätsindikatoren (metrics)
|
||||||
|
* **Sichtweisen:** Produktqualität, Prozessqualität.
|
||||||
|
* **Historische Modelle:** Qualitätenbaum (Boehm), ISO/IEC 9126, ISO/IEC 250nn.
|
||||||
|
* **ISO/IEC 25010:** Nur Produktqualität. Modelle: Product quality, Quality in use.
|
||||||
|
* **Product quality:** Functional suitability, Reliability, Performance efficiency, Security, Compatibility, Maintainability, Portability, Usability.
|
||||||
|
* **Quality in use:** Effectiveness, Efficiency, Satisfaction, Freedom from risk, Context coverage.
|
||||||
|
* **Qualitätsbewertung:** Soll-Ist-Vergleich. Abweichung = Fehler.
|
||||||
|
* **Qualitätsindikatoren (Metriken):** Vorgabe eines Ziels (Soll-Wert), Soll-Ist-Vergleich (Qualitätsmessung).
|
||||||
|
|
||||||
|
**6. Typische Fehlerquellen**
|
||||||
|
|
||||||
|
* Komplexität, Software-Größe, Fluktuation, falsche Übertragung von Produktionsprozessen.
|
||||||
|
* **Fehlerquellen nach Hof13:**
|
||||||
|
1. Lexikalische und syntaktische Fehler
|
||||||
|
2. Numerische Fehler (Überläufe, Y2K-Bug)
|
||||||
|
3. Semantische Fehler
|
||||||
|
4. Parallelität (Race conditions, Deadlocks)
|
||||||
|
5. Spezifikationsfehler (Unvollständigkeit, Widersprüche)
|
||||||
|
6. Portabilitätsfehler
|
||||||
|
7. Hardwarefehler
|
||||||
|
|
||||||
|
**7. Qualitätssicherung und -management**
|
||||||
|
|
||||||
|
* **Maßnahmen:**
|
||||||
|
1. Organisatorische Maßnahmen (Systematische Entwicklung, Richtlinien, Standards)
|
||||||
|
2. Konstruktive Maßnahmen (Fehlervermeidung von Beginn an)
|
||||||
|
3. Analytische Maßnahmen (Software-Prüfung)
|
||||||
|
* **Qualitätsmanagement:** Festlegung von Qualitätsanforderungen, Überprüfung der Einhaltung, Schaffung geeigneter Rahmenbedingungen.
|
||||||
|
* **Aktivitäten:**
|
||||||
|
* Qualitätsplanung: Festlegung von Qualitätsanforderungen an Prozess und Produkt.
|
||||||
|
* Qualitätslenkung und -sicherung: Umsetzung, Steuerung, Überwachung und Korrektur des Entwicklungsprozesses.
|
||||||
|
* Qualitätsprüfung: Durchführung der festgelegten Maßnahmen (Erfassung der Ist-Werte der Qualitätsindikatoren, Überwachung der Umsetzung der konstruktiven Maßnahmen, Tests, Durchsicht, Reviews).
|
||||||
|
* Qualitätsverbesserung: Auswertung der Qualitätssicherungsergebnisse und der Prozessverbesserungen.
|
||||||
|
* **Dokumentation:** Qualitätssicherungsplan (Prozess-orientiert), Prüfplan (Produkt-orientiert).
|
||||||
|
* **Qualitätsplanung:** Festlegung der Aufgaben, Vorgaben und Hilfsmittel, Termine, Verantwortlichkeiten.
|
||||||
|
* **Qualitätslenkung:** Reguläre, besondere und finale Aktivitäten.
|
||||||
|
* **Frühe Fehlerentdeckung:** Vermeidung von Summationseffekten. Ziele: Keine Fehler machen, Fehler früh entdecken und beseitigen.
|
||||||
|
* **Qualität und Projekt:** Qualität, Funktionalität, Kosten und Zeit sind über die Produktivität gekoppelt.
|
||||||
|
|
||||||
|
**8. Prozessqualität**
|
||||||
|
|
||||||
|
* Guter Prozess begünstigt gute Software.
|
||||||
|
* **Themen:** Softwareprojektmanagement, Vorgehens- und Prozessmodelle, Risikomanagement, Konfigurationsmanagement, Anforderungs- und Änderungsmanagement.
|
||||||
|
|
||||||
|
**9. Konstruktive Maßnahmen**
|
||||||
|
|
||||||
|
* Fehlervermeidung von Anfang an.
|
||||||
|
* **Maßnahmen:**
|
||||||
|
1. Qualifikation und Schulungen
|
||||||
|
2. Attraktive Arbeitsumgebung
|
||||||
|
3. Geeignetes Prozessmodell
|
||||||
|
4. Werkzeuge (CASE: computer-aided software engineering)
|
||||||
|
* Operationen: Editieren, Transformieren, Verwalten/Versionieren, Suchen, Nachvollziehen, Messen, Testen, Verbinden, Dokumentieren, Verfolgen/Überwachen.
|
||||||
|
* Werkzeug-Grundausstattung: Editor, Compiler/Linker, Versionsverwaltung, Automatisierung (Build, Test), Überdeckungsprüfung, Statische Prüfung/Vermessung, Code Review, Kommunikation/Dokumentation, Aufwandserfassung, Projekt-/Ressourcenplanung, Verfolgen-/Überwachen.
|
||||||
|
5. Geeignete Programmiersprache (Passend zur Problemdomäne, Eigenschaften zur Qualitätssteigerung)
|
||||||
|
6. Einhalten von Richtlinien (Vereinheitlichung, Fehlerreduktion)
|
||||||
|
* Notationskonventionen (Schreibweise von Bezeichnern, Layout des Quelltextes, Aufbau von Kontrollstrukturen)
|
||||||
|
* Sprachkonventionen (Regeln für die Formulierung von Anforderungen im Rahmen der Spezifikation, Umgang mit den semantischen Besonderheiten einer Programmiersprache)
|
||||||
|
7. Angemessene Dokumentation (Einfluss auf Qualitätsmerkmale)
|
||||||
|
* Externe Dokumentation (Pflichtenheft, Vertrag, Handbücher, Online-Hilfe)
|
||||||
|
* Spezifikationsdokumentation (zutreffend, vollständig, konsistent, neutral, nachvollziehbar, überprüfbar)
|
||||||
|
* Implementierungsdokumentation (Code-Dokumentation, externe Dokumente)
|
||||||
|
* Dokumentationsextraktion (JavaDoc)
|
||||||
|
8. Angemessene Architektur (Modularisierung, Hierarchisierung, Starker Zusammenhalt und schwache Kopplung, Trennung von Zuständigkeiten, Information Hiding)
|
||||||
|
9. Automatisierung (Build-Prozess, Programmtest, Versionierung, Datensicherung, Installation der Umgebungen)
|
||||||
|
* **Richtlinien:**
|
||||||
|
* Notationsstile für Bezeichner (Pascal Case, Camel Case, Upper Case, Lower Case, Ungarische Notation)
|
||||||
|
* Coding Style (Schreibweise von Bezeichnern, Anweisungen, Einrückungstiefe, maximale Zeilenlänge, Umbrüche/Leerzeichen, Deklarationsschemata, Dateiorganisation und -namen, Programmierpraktiken)
|
||||||
|
* Sprachkonventionen (MISRA-C)
|
||||||
|
* Regeln für natürlichsprachliche Spezifikationen
|
||||||
|
|
||||||
|
**10. Manuelle Prüfmethoden**
|
||||||
|
|
||||||
|
* Diagnostische Verfahren zur Ermittlung des Qualitätsniveaus.
|
||||||
|
* **Ziele:** Feststellung von Mängeln, Fehlern, Inkonsistenzen, Unvollständigkeiten, Verstößen gegen Vorgaben, formale Abnahme.
|
||||||
|
* **Voraussetzungen:** Aufwand und Zeit müssen eingeplant sein, Schulung der Prüfer, keine Beurteilung von Mitarbeitern, Dokumentation der Prüfmethode.
|
||||||
|
* **Methoden:**
|
||||||
|
1. Durchsicht (Entwickler alleine)
|
||||||
|
2. Stellungnahme (Autor gibt Artefakt an Dritte weiter)
|
||||||
|
3. Review (Formalisierter Prozess)
|
||||||
|
* Rollen: Moderator, Autor, Gutachter, Notar, Review-Team.
|
||||||
|
* Ablauf: Antrag, Planung, Festlegung der Aspekte, Auswahl der Prüfer, Eingangsprüfung, Verteilung des Prüfobjekts, Vorbereitung, Review-Sitzung, Entscheidung über Nacharbeit, Durchführung der Nacharbeiten, erneutes Review.
|
||||||
|
* Review-Regeln: Sitzungsdauer, Fokus auf Resultat, Rollenverteilung, keine Stilfragen, keine Lösungsentwicklung, angemessene Präsentation der Befunde, Protokollierung.
|
||||||
|
* Gewichtung der Befunde: Kritischer Fehler, Hauptfehler, Nebenfehler, Gut.
|
||||||
|
* Empfehlungen: Akzeptieren ohne Änderung, Akzeptieren mit Änderung, Nicht akzeptieren.
|
||||||
|
4. Structured Walkthrough (Einfachere Variante des Review)
|
||||||
|
|
||||||
|
**11. Programmtest (Dynamische Prüfung)**
|
||||||
|
|
||||||
|
* Ziel: Finden möglichst vieler Fehler.
|
||||||
|
* **Vorgehen:** Ausführung des Programms mit konkreten Werten, Vergleich der Ausgaben (Ist-Werte) mit den Soll-Werten.
|
||||||
|
* **Systematischer Test:** Randbedingungen definiert, Eingaben systematisch ausgewählt, Soll-Werte festgelegt, Testverlauf dokumentiert, Test und Korrektur getrennt.
|
||||||
|
* **Teststufen:**
|
||||||
|
* Unit-Test (Modultest, Komponententest): Test von Programmteilen (Funktionen/Methoden, Klassen, Komponenten).
|
||||||
|
* Integrationstest: Test des Zusammenspiels der integrierten Module/Komponenten.
|
||||||
|
* Ablauf: Big-Bang-Integration, Inkrementelle Integration (Top-down, Bottom-up, Outside-In, Kontinuierliche Integration).
|
||||||
|
* Systemtest: Test des komplett integrierten Systems aus Anwendersicht.
|
||||||
|
* Abnahmetest: Letzter Test vor der Inbetriebnahme, Abnahmekriterien im Entwicklungsvertrag.
|
||||||
|
* **Grenzen von Programmtests:** Vollständiger Test in der Praxis nicht möglich.
|
||||||
|
* **Testfall:** Ausgangssituation, Testdaten, Sollwerte.
|
||||||
|
* **Eigenschaften eines guten Testfalls:** Fehlersensitiv, repräsentativ, redundanzarm.
|
||||||
|
|
||||||
|
**12. Black-Box-Test (Funktionstest)**
|
||||||
|
|
||||||
|
* Testfälle auf Basis der Spezifikation.
|
||||||
|
* **Verfahren zur Bestimmung von Testfällen:**
|
||||||
|
1. Funktionale Äquivalenzklassenbildung: Aufteilung der Eingaben in Äquivalenzklassen, Test eines Repräsentanten pro Klasse.
|
||||||
|
2. Grenzwertanalyse: Test von Elementen an den Grenzen von Äquivalenzklassen.
|
||||||
|
3. Zustandsbezogener Test: Modellierung des Systems mit Zustandsautomaten, Test aller Zustände und Zustandsübergänge.
|
||||||
|
4. Test spezieller Werte: Test mit Eingaben, die häufig Fehler aufdecken.
|
||||||
|
5. Zufallstest: Zufällige Generierung von Testfällen.
|
||||||
|
* **Property-based Testing:** Prüfung, ob ein Prädikat erfüllt ist: $\forall x.P(x, f_{SUT}(x))$.
|
||||||
|
|
||||||
|
**13. Testautomatisierung**
|
||||||
|
|
||||||
|
* Wiederholung von Tests (Fehlernachtest, Regressionstests) erfordert Testautomation.
|
||||||
|
* **JUnit-Framework:** Unterstützung bei der Erstellung und Durchführung von Programmtests.
|
||||||
|
* **JUnit 5:** Testplattform (Platform, Jupiter, Vintage, Extensions).
|
||||||
|
* **JUnit 5 - Testklasse:**
|
||||||
|
* Testmethoden werden durch die Annotation `@Test` ausgezeichnet.
|
||||||
|
* Vor der Ausführung jeder Testmethode wird eine neue Instanz der Testklasse erzeugt.
|
||||||
|
* Umfangreichere Initialisierungen können in eine mit `@BeforeEach` annotierte Methode ausgelagert werden.
|
||||||
|
* Die Freigabe von Ressourcen kann dann in einer mit `@AfterEach` annotierten Methode erfolgen.
|
||||||
|
* **Wichtige JUnit 5-Annotationen:** `@Test`, `@BeforeEach`, `@AfterEach`, `@BeforeAll`, `@AfterAll`, `@DisplayName("")`.
|
||||||
|
* **Assert-Methoden:** `assertEquals()`, `assertSame()`, `assertTrue()`, `assertNotNull()`.
|
||||||
|
* **Erwartete Ausnahmen:** Test mit `assertThrows()`.
|
||||||
|
* **Test-Suite:** Zusammenfassung von Testfällen (mit `@Test` annotierte Methoden) einer Testklasse.
|
||||||
|
* **Parametrisierte Testmethoden:** Mehrfacher Aufruf einer Testmethode mit unterschiedlichen Parametern.
|
||||||
|
* **Testbarkeit:**
|
||||||
|
* Dependency Injection (DI): Assoziationen zu anderen Objekten werden von außen injiziert.
|
||||||
|
* Stubs vs Mocks:
|
||||||
|
* Stubs: Entkopplung der zu testenden Einheiten von der Umgebung, Simulation der Fachlogik, Zustandstest.
|
||||||
|
* Mocks: Entkopplung, Kontrolle der Anzahl und Abfolge der Methodenaufrufe, keine/begrenzte Simulation der Fachlogik, Verhaltenstest.
|
||||||
|
* **EasyMock-Framework:** Generierung von Mock-Objekten aus Interfaces zur Testlaufzeit.
|
||||||
|
|
||||||
|
**14. Build-Automatisierung**
|
||||||
|
|
||||||
|
* Automatisierung des Build-Prozesses.
|
||||||
|
* **Build-Tools:** make, Ant, Maven.
|
||||||
|
* **make:** Bedingungsgesteuerte Ausführung von Shell-Skript-Kommandos.
|
||||||
|
* **Ant:** Plattformunabhängigkeit, Konfigurationsdatei `build.xml` im XML-Format.
|
||||||
|
* **Maven:** Deklarativer Ansatz, Standardisierung, Management von Abhängigkeiten, Erweiterungen über Plug-ins.
|
||||||
|
* Konfigurationsdatei `pom.xml` (Project Object Model).
|
||||||
|
* Maven-Verzeichnisstruktur.
|
||||||
|
* Management von Abhängigkeiten (groupId, artifactId, version, type).
|
||||||
|
* Life Cycle und Phasen (Default, Clean, Site).
|
||||||
|
* Projektvorlagen (Archetypes).
|
||||||
|
* Grundeinstellungen (Compiler-Plugin, Surefire-Plugin).
|
||||||
|
* Reports für die Qualitätssicherung (Javadoc, Surefire-Report, Project-Info).
|
||||||
|
|
||||||
|
**15. Glass-Box-Test (White-Box-Test) / Strukturtest**
|
||||||
|
|
||||||
|
* Überdeckung des Codes durch die Testfälle analysiert.
|
||||||
|
* **Kontrollflussgraph:** Anweisungen als Knoten, Kontrollfluss als Kanten.
|
||||||
|
* **Überdeckungskriterien:**
|
||||||
|
1. Anweisungsüberdeckung (statement coverage) / C0-Test: Jede Anweisung im Programm muss im Test mindestens einmal ausgeführt werden.gg im Programm wird im Test mindestens einmal ausgeführt.
|
||||||
|
2. Bedingungsüberdeckung: Überprüfung der Bedingungen im Test.
|
||||||
|
* Einfache Bedingungsüberdeckung: Alle atomaren Teilbedingungen müssen während des Tests einmal true und einmal false ergeben.
|
||||||
|
* Mehrfach-Bedingungsüberdeckung: Alle Variationen der Belegung der atomaren Teilbedingungen werden getestet.
|
||||||
|
* Minimale-Mehrfach-Bedingungsüberdeckung: Jede Teilbedingung muss mindestens einmal true und einmal false sein.
|
||||||
|
3. Datenflussbasierte Überdeckung (Defs-Uses-Überdeckung): Verwendung von Variablen wird analysiert.
|
||||||
|
* Definition (def) einer Variablen / Wertzuweisung.
|
||||||
|
* Verwendung einer Variablen in einem Ausdruck zur Berechnung eines Wertes (berechnende Benutzung, computational-use, c-use).
|
||||||
|
* Verwendung einer Variablen in Bedingungen bzw. Prädikaten zur Berechnung von Wahrheitswerten (prädikative Benutzung, predicate-use, p-use).
|
||||||
|
* All Definitions (All-defs): Die Testfälle durchlaufen für jede Definition einer Variablen einen definitionsfreien Pfad zu mindestens einem p-use oder c-use.
|
||||||
|
* All c-uses: Die Testfälle durchlaufen für jede Definition einer Variablen einen Pfad zu allen definitionsfrei erreichbaren c-uses.
|
||||||
|
* All p-uses: Die Testfälle durchlaufen für jede Definition einer Variablen einen Pfad zu allen definitionsfrei erreichbaren p-uses.
|
||||||
|
* All uses: Die Testfälle durchlaufen für jede Definition einer Variablen einen Pfad zu allen definitionsfrei erreichbaren p- und c-uses.
|
||||||
|
* All c, some p: Die Testfälle erfüllen das All-c-uses-Kriterium. Existiert zu einer Definition keine berechnende Nutzung, so wird zusätzlich mindestens ein definitionsfreier Pfad zu einer prädikativen Nutzung hinzugenommen.
|
||||||
|
* All p, some c: Analog zu All-c-some-p-Kriterium mit vertauschten Rollen.
|
||||||
|
|
||||||
|
**16. Test objektorientierter Programme**
|
||||||
|
|
||||||
|
* Berücksichtigung zusätzlicher Eigenschaften: Zustand des Objekts, Objekte als Parameter und Rückgabewerte, Vererbung, Assoziationen, Polymorphismus.
|
||||||
|
* **Arten von Klassen:** Normale Klassen, abstrakte Klassen und Schnittstellen, parametrisierte (generische) Klassen, Unterklassen.
|
||||||
|
* **Testen normaler Klassen:** Test zustandsverändernder Methoden, Test des Objektlebenszyklus.
|
||||||
|
* **Testen von Unterklassen:** Systematischer Test aller Methoden der Oberklasse und der Unterklassen.
|
||||||
|
* **Testen abstrakter Klassen:** Test einer möglichst einfachen Unterklasse, die die abstrakte Klasse implementiert.
|
||||||
|
* **Testen nicht sichtbarer Bestandteile:** Test privater Methoden und Attribute über die öffentliche Schnittstelle, Lockerung der Sichtbarkeit auf Paketebene, Extra Testzugang, Zugriff über Reflection.
|
||||||
|
|
||||||
|
**17. Statische Prüfung / Metriken**
|
||||||
|
|
||||||
|
* Finden von Fehlern oder fehlerträchtigen Stellen in einem Dokument durch Werkzeuge.
|
||||||
|
* **Beispiele:** Rechtschreib- und Grammatikprüfung, UML-Syntaxprüfung, Syntaxanalyse, Konformitäts-/Konventionsanalyse, Prüfung auf Kontrollfluss- und Datenflussanomalien.
|
||||||
|
* **Softwaremetriken:** Quantitative Bewertung von Software-Systemen mit Hilfe von Kenngrößen.
|
||||||
|
* **Unterteilung:** Quantitätsmetriken, Komplexitätsmetriken, Qualitätsmetriken.
|
||||||
|
* **Objekte der Softwaremessung:** Anforderungsdokumentation/Spezifikation, Entwurfsdokumentation, Code, Testware, Benutzerhandbücher.
|
||||||
|
* **Sichten auf die Objekte:** Sicht der Typen, Sicht des Zwecks, Sicht des Anwenders.
|
||||||
|
* **Quantitätsmetriken:** Entwurfsgrößen, Codegrößen.
|
||||||
|
* **Codekomplexität:**
|
||||||
|
* Halstead-Metriken:
|
||||||
|
* Operatoren: Schlüsselwörter, Operatoren, Präprozessoranweisungen.
|
||||||
|
* Operanden: Variablen, Konstanten, Bezeichner.
|
||||||
|
* Basisparameter: t (Anzahl der unterschiedlichen Operatoren), d (Anzahl der unterschiedlichen Operanden), nt (Gesamtzahl aller Operatoren im Programm), nd (Gesamtzahl aller Operanden im Programm).
|
||||||
|
* Berechnungen:
|
||||||
|
* Größe des Vokabulars: $G = t + d$
|
||||||
|
* Länge des Programms: $N = n_t + n_d$
|
||||||
|
* Volumen des Programms: $V = N \times log_2 G$
|
||||||
|
* Level: $L = V^* / V$
|
||||||
|
* Schwierigkeit: $D = 1 / L$
|
||||||
|
* Aufwand: $E = V \times D$
|
||||||
|
* McCabe-Metrik:
|
||||||
|
* Kontrollflussgraph.
|
||||||
|
* Zyklomatische Komplexität: $V(G) = |E| - |N| + 2$
|
||||||
|
* **Objektorientierte Metriken:** OV (Object Variables), CV (Class Variables), NOA (Number of Attributes), WAC (Weighted Attribute per Class), WMC (Weighted Method per Class), DOI (Depth Of Inheritance), NOD (Number of Descandants), NORM (Number of Redefined Methods).
|
||||||
|
* **Konformitäts-/Konventionsanalyse:** Prüfung auf Einhaltung von Codierungsrichtlinien.
|
||||||
|
* **Datenflussanomalieanalyse:** Prüfung auf unstimmige Variablenzugriffe.
|
||||||
|
* **Statische Analyse mit Werkzeugen:** PMD, Checkstyle, CodePro Audit/Metrik.
|
||||||
|
|
||||||
|
**18. Build-Automatisierung / CI**
|
||||||
|
|
||||||
|
* Kontinuierliche Integration (CI): Häufige Integration neuer Artefakte/Komponenten durch einen vollautomatischen Build-Prozess.
|
||||||
|
* **Ziele:** Reduzierung von Risiken, Verbesserung der Produktqualität, Transparenz/Übersicht.
|
||||||
|
* **CI-Server:** Laufzeitumgebung zur Durchführung des kompletten Integrationsprozesses.
|
||||||
|
* **Build-Prozess:** Vorbereitende Maßnahmen, Übersetzen, Statische Prüfungen, Dynamische Prüfungen, Paketierung, Erzeugung von Berichten und Dokumentation, Bereitstellung/Verteilung.
|
||||||
|
* **CI-Praktiken:** Gemeinsame Codebasis im SCM, Automatisierte Builds, Automatisierte Durchführung von dynamischen und statischen Prüfungen, Automatisches Berichtswesen, Häufige Integration, Schnelle Build-Zyklen, Einfacher Zugriff auf Build-Ergebnisse und Berichte, Automatische Verteilung.
|
||||||
|
|
||||||
|
**19. Konfigurationsmanagement**
|
||||||
|
|
||||||
|
* Aktive Verwaltung eines sich ändernden Softwaresystems mit Hilfe von Richtlinien, Prozessen und Werkzeugen.
|
||||||
|
* **Bereiche:** Änderungs-Management, Versions-Management, Build-Management, Release-Management.
|
||||||
|
|
||||||
|
**20. Wartung**
|
||||||
|
|
||||||
|
* Arbeit an einem bestehenden Software-System, die nicht von Beginn der Entwicklung an geplant war.
|
||||||
|
* **Arten der Wartung:** Adaptive Wartung (Anpassung), Korrektive Wartung (Korrektur).
|
||||||
|
* **Systematisches Vorgehen:** Dokumentation des Ausgangszustands, Identifizierung des zu modifizierenden Teils, Testfälle, Entnahme, Bearbeitung und lokale Prüfung der Komponenten, Integration und Test, Dokumentation des neuen Zustands, Erfassung des Aufwands.
|
||||||
|
* **Change Management:** Verwaltung von Änderungen mit Hilfe von Problemmeldungen (Software Problem Report, SPR) und Änderungsanträgen (Change Request, CR).
|
||||||
|
* **Logging:** Erzeugung von Kontrollausgaben zur Erleichterung der Wartung.
|
||||||
|
* Log-Level: DEBUG, INFO, WARN, ERROR, FATAL.
|
||||||
|
* Logging-Frameworks: log4j.
|
||||||
|
|
||||||
|
Ich hoffe, diese Zusammenfassung hilft Ihnen bei der Vorbereitung auf Ihre Prüfung! Viel Erfolg!
|
||||||
BIN
WS2425/SWT D/Praktikum/BuchRedesign.zip
Normal file
BIN
WS2425/SWT D/Praktikum/BuchRedesign.zip
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/buchv1.zip
Normal file
BIN
WS2425/SWT D/Praktikum/buchv1.zip
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/easymock-4.2.jar
Normal file
BIN
WS2425/SWT D/Praktikum/easymock-4.2.jar
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-01.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-01.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-02.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-02.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-04.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-04.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-05.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-05.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-06.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-06.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-07.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-07.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-08.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-08.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-09.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-09.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-10.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-10.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-11.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-11.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Praktikum/swtd-p-3.pdf
Normal file
BIN
WS2425/SWT D/Praktikum/swtd-p-3.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/BuchRedesign.pdf
Normal file
BIN
WS2425/SWT D/Uebung/BuchRedesign.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/BuchV1.pdf
Normal file
BIN
WS2425/SWT D/Uebung/BuchV1.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/Uebung4/Pru__fprotokoll.pdf
Normal file
BIN
WS2425/SWT D/Uebung/Uebung4/Pru__fprotokoll.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/Uebung4/SeminarverwaltungOOA.pdf
Normal file
BIN
WS2425/SWT D/Uebung/Uebung4/SeminarverwaltungOOA.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/Uebung4/swtd-ue-04-auftrag.pdf
Normal file
BIN
WS2425/SWT D/Uebung/Uebung4/swtd-ue-04-auftrag.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/Uebung4/swtd-ue-04.pdf
Normal file
BIN
WS2425/SWT D/Uebung/Uebung4/swtd-ue-04.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-01.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-01.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-02.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-02.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-05.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-05.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-06.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-06.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-07.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-07.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-08.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-08.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-09.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-09.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-10.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-10.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-11.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-11.pdf
Normal file
Binary file not shown.
BIN
WS2425/SWT D/Uebung/swtd-ue-3.pdf
Normal file
BIN
WS2425/SWT D/Uebung/swtd-ue-3.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user