320 likes | 334 Views
This template file outlines the importance of software testing, debugging facts, and the efficiency of testing in identifying defects and failures. It also covers the Traffic Principle, the transition from defects to failures, and strategies for searching in time and space. Additionally, it delves into automated debugging techniques and the significance of anomaly detection in error identification. The presentation aims to provide a comprehensive view of ensuring software quality through effective testing methods.
E N D
CEN 4072 Software Testing PPT1: How failures come to be PPT and video are due: no later than September 6, 5:00 PM Submit to: lpiegl@gmail.com This template file is just an outline of the presentation that you need to complete. Additional pages will be necessary to fully explore the topic above. Each page should contain adequate text as well as illustrations. You are free to use all publicly available information (text as well as graphics) as long as the sources are properly acknowledged.
Team members’ contributions Member [name]: Member [name]: Member [name]: Member [name]:
Golden rules Content outline: • Software testing begins with careful design • Explanation and examples
Golden rules Content outline: • Software that cannot be tested is useless • Explanation and examples
Facts on debugging Content outline: • Examples of software failures • Impacts of software failures
Facts on debugging Content outline: • Damages caused by software failures • Impacts on society
Facts on debugging Content outline: • Facts on debugging • Costs, validation and improvements
The TRAFFIC principle Content outline: • Track • Reproduce • Automate • Find origins • Focus • Isolate • Correct
From defect to failure Content outline: • A sequence of events causing the defect to become a failure • Explanation and illustration
Efficiency of testing Content outline: • How defects and failures are related? • Can testing show the absence of errors?
Efficiency of testing Content outline: • How infections and defects are related? • Explanation and illustration
Search in time and space Content outline: • Search from defect to failure in time and space • Illustration and explanation
Search in time and space Content outline: • Find transition from sane to infected • Illustration and explanation
Search in time and space Content outline: • Search from defect to failure: the principles • Examples of the complexity (number of variables and references among them)
Sample program - main int main(int argc, char *argv[]) { int *a; int i; a = (int *)malloc((argc - 1) * sizeof(int)); for (i = 0; i < argc - 1; i++) a[i] = atoi(argv[i + 1]); shell_sort(a, argc); printf("Output: "); for (i = 0; i < argc - 1; i++) printf("%d ", a[i]); printf("\n"); free(a); return 0; }
Sample program - sort static void shell_sort(int a[], int size) { int i, j; int h = 1; do { h = h * 3 + 1; } while (h <= size); do { h /= 3; for (i = h; i < size; i++) { int v = a[i]; for (j = i; j >= h && a[j - h] > v; j -= h) a[j] = a[j - h]; if (i != j) a[j] = v; } } while (h != 1); } There is a bug somewhere (main or shellsort). Find it using the principles below.
Find origins Content outline: • Deduce value origins • Separate relevant from irrelevant
Search in time Content outline: • Observe a transition from sane to infected • Example
Observing a run Content outline: • Trace the execution for all variables for all steps of execution • Illustration in time and space
Specific observations Content outline: • Observe the state at specific locations • Walk-through example
Specific observations Content outline: • Find the transition from sane to infected • Example steps
Specific observations Content outline: • Fix the defect • Regress or not to regress?
Finding causes Content outline: • Find the difference between infected and sane states • Search in time and space
Automated debugging: program slices Content outline: • Separate the part of the program that is relevant to the failure • Explanation and illustration
Automated debugging: observing state Content outline: • Stop the program to observe the entire state • Is this an option for large programs?
Automated debugging: watching state Content outline: • Watch a part of the state to find changes during execution • Examples and usefulness
Automated debugging: assertions Content outline: • Specify expected values and check for them • Do we really know the expected values?
Automated debugging: anomalies Content outline: • What is an anomaly? • Examples
Automated debugging: anomalies Content outline: • Observe the difference between passing the failing runs • Would this help with anomalies?
Automated debugging: cause-effect chains Content outline: • How many chains are there? • Is it reasonable to find THE cause-effect chain?
Automated debugging: cause-effect chains Content outline: • Identify which variable caused the failure • Note: causes are not necessarily errors!
Automated debugging: simplified input Content outline: • Simplify the input so that each part contributes to the failure