Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Release date: Monday, 27.06.11 - Due date: Sunday, 03.07.11, 23:59
3 points |
---|
Given the following interface
public interface DateParser { /** * Interprets a date string of the form "day-month-year" * * Day and Month can have either one or two digits (with leading zero) * Year can have two or four digits, two digits represent 21. century dates * * If the Month is smaller than 1, January is used, values over 12 are interpreted as December * If the Day is smaller than 1, 1 is used, similar the last possible day number is taken for inputs larger than possible. * * @param input the date string that should be interpreted * @return the interpreted date (with time 12:00:00) or null in case of an invalid input */ java.util.Date parseDate(String input); }
4 points |
---|
Given is the following method sort which sorts a field of int variables with a bubble sort.
public int[] sort(int[] list) { // Nr. boolean change = true; // 1 if (list.length > 1) { // 2 while (change) { // 3 change = false; // 4 for (int i = list.length - 1; // 5 i > 0; // 6 i--) { // 7 int i1 = list[i]; // 8 int i2 = list[i – 1]; // 9 if (i1 < i2) { // 10 list[i] = i2; // 11 list[i – 1] = i1; // 12 change = true; // 13 } } } } return list; // 14 }
4 points |
---|
In this task you will compare the two different testing techniques Stubs and Mock Objects. See also the article Mocks Aren't Stubs by Martin Fowler and the Easymock documentation.
Download the project StubVsMock.zip and import it into an Eclipse workspace. It contains a small part of a CD player software. The class PlayController controls the player's hardware API defined by the interface CDPlayer.
tutorial
project and import it.src
.tst
folder.tst
folder.3 points |
---|
After you have solved this task, you should be able to understand and explain:
X1T01_AddressTest
in the package people
in the tst
folder.3 points |
---|
After you have solved this task, you should be able to understand and explain:
X1T02_NumberGeneratorTest
in the package numbers
in the tst
folder.4 points |
---|
After you have solved this task, you should be able to understand and explain:
X1T03_PersonsStudentsProfessors
in the package university
in the tst
folder.4 points |
---|
After you have solved this task, you should be able to understand and explain:
X1T04_StudentTest
in the package university
in the tst
folder.