Oopm1516 Ex07

Zielsetzung für die Übung

  • Testen
    • Blackbox Testing
      • Testen anhand der Spezifikation
    • Glassbox Testing (Codeabdeckung)
      • alle Anweisungen
      • alle Zweige
      • alle Teilbedingungen (wdh. Shortcuts)
      • alle Pfaden



public String substring(int beginIndex)

Returns a new string that is a substring of this string. 
The substring begins with the character at the specified index and extends to the end of this string.


     "unhappy".substring(2) returns "happy"
     "Harbison".substring(3) returns "bison"
     "emptiness".substring(9) returns "" (an empty string)

    beginIndex - the beginning index, inclusive.
    the specified substring.
    IndexOutOfBoundsException - if beginIndex is negative or larger than the length of this String object.


A simple example:

Input: a, b integers

1        function compare(a, b)
2            if a > b then return "a is greater than b"
3            if a < b then return "b is greater than a"
4            if a = b then return "a is equal to b"


Input: a, b positive integers
Output: g and d such that g is odd and gcd(a, b) = g×2d

1        d := 0
2        while a and b are both even do
3            a := a/2
4            b := b/2
5            d := d + 1
6        while a ≠ b do
7            if a is even then a := a/2
8            else if b is even then b := b/2
9            else if a > b then a := (a – b)/2
10            else b := (b – a)/2
11        g := a
12        output g, d

Zielsetzung für das Programmierpraktikum

  • Implementation von numerischen Verfahren
    • Methoden ohne Verwendung der Bibliothek Math
    • Intervallschachtelung & Sinus-Funktion
      • Umgangsweise mit Delta