260 likes | 301 Views
CEN 4072 Software Testing. PPT6: Scientific debugging. PPT and video are due: no later than October 11, 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
E N D
CEN 4072 Software Testing PPT6: Scientific debugging PPT and video are due: no later than October 11, 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]:
Errors Content outline: • What is an error in the software
Causes and effects Content outline: • What is the cause of a problem? • Examples
Causes and effects Content outline: • How to prove causality? • Example
Causality Content outline: • Repeating history • Can we repeat history in software?
Causality Content outline: • Repeating program runs • How much data and knowledge does it take?
Causes by intuition Content outline: • Can intuition be taught? • What is tacit knowledge and how one would acquire it?
Scientific method: what is it? Content outline: • Explanation and examples
Scientific method: main steps Content outline: • Steps and their explanations in using the scientific method
What is a theory? Content outline: • The road from hypothesis to theory
Scientific method of debugging Content outline: • Details, explanation and chart
Sample program revisited 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; } 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); }
Debugging with the scientific method Content outline: • Detailed steps of how to use the scientific method to debug the sample program
Explicit debugging Content: • Stating the problem explicitly can help solve the problem • The Teddy Bear principle of software
Keep a notebook Content outline: • Keep a record of each debugging session
Algorithmic debugging Content outline: • Steps of the algorithmic debugging
Example code for algorithmic debugging def insert(elem, list): if len(list) == 0: return [elem] head = list[0] tail = list[1:] if elem <= head: return list + [elem] return [head] + insert(elem, tail) def sort(list): if len(list) <= 1: return list head = list[0] tail = list[1:] return insert(head, sort(tail))
Algorithmic debugging session Content outline: • Step-by-step debugging of the sample code above • Include an explanation as well as a chart
Pros and Cons Content outline: • Pros and cons of the scientific debugging
Obtaining a hypothesis Content outline: • Observing a run • Deducing from the code • Problem report • Earlier hypotheses
Reasoning about the programs: deduction Content outline: • Details on how to use deduction • Example
Reasoning about the programs: observation Content outline: • Details on how to use observation • Example
Reasoning about the programs: induction Content outline: • Details on how to use induction • Example
Reasoning about the programs: experimentation Content outline: • Details on how to use experimentation • Example
Your code experimentations Content outline: • Share your experience(s) with experiments • Examples