- 12:30 PM
12:45 PM
Senior Symposium Friday, April 16
1 2 Tuesday, April 13, 2010
Senior Symposium Friday, April 16 12:30 PM 12:45 PM 2 Tuesday, - - PowerPoint PPT Presentation
12:45 PM
1 2 Tuesday, April 13, 2010
public DnaStrand cutAndSplice(String enzyme, String splicee) {
recombStrand.append(dna.substring(enzymeEnd, enzymeStart)); recombStrand.append(splicee);
3 4 Tuesday, April 13, 2010
recombStrand.append(dna.substring(enzymeEnd, enzymeStart)); recombStrand.append(splicee);
recombStrand.append(dna.substring(enzymeEnd, enzymeStart)); recombStrand.append(splicee);
5 6 Tuesday, April 13, 2010
public DnaStrand cutAndSplice(String enzyme, String splicee) {
("Cannot cut and splice a link strand containing more than one node.");
private LinkedListDNAStrand append(String dna) {
}
7 8 Tuesday, April 13, 2010
recombStrand.append(dna.substring(enzymeEnd, enzymeStart)); recombStrand.append(splicee);
Demonstrate that the program is correct What does “correct” mean? It meets its specification What if the specification is wrong?!? NOT a proof that the program is correct! Specification: English description of what the program should do. 9 10 Tuesday, April 13, 2010
Want to generalize from the test input to make claims about all input Divide input into a set of equivalence classes Choose 1 (or a small number) of test input from each equivalence class Assume that if the program works on the test input, it will work on all input.
Black-box testing Examine the specification White-box testing Examine the code 11 12 Tuesday, April 13, 2010
Execute every statement Execute every true & false branch Loops: 0 iterations 1 iteration many iterations Boundary conditions: minimal values maximal values
/ / Return the index where the value is in a. Return -1 / / if the value is not in the array. / / Precondition: a must be sorted. int search (int[] a, int value) { for (int i = 0; i < a.length; i++) { if (a[i] == value) { return i; } }
}
13 14 Tuesday, April 13, 2010
/ / Return the index where the value is in a. Return -1 / / if the value is not in the array. / / Precondition: a must be sorted. int search (int[] a, int value) { int low = 0; int high = a.length - 1; int middle; while( low < high ) {
}
Unit testing - test individual class Integration testing - test groups of interacting classes System testing - test entire system integrated with real hardware, databases, etc. Acceptance testing - testing done by customer to decide if software does what they want
15 16 Tuesday, April 13, 2010
Allows us to find errors early Leaves less question about where the error
s probably in the code we just wrote. Test-driven development - develop test program BEFORE the code to be tested!
Carefully trace your code to be sure it does what you intend. Don’ t take shortcuts. Best to do with another person. Explain the code. Let the other person critique. 17 18 Tuesday, April 13, 2010
/ / Return the index where the value is in a. Return -1 / / if the value is not in the array. / / Precondition: a must be sorted. int search (int[] a, int value) { int low = 0; int high = a.length - 1; int middle; while( low < high ) {
}
19 Tuesday, April 13, 2010