SWEA 2019 Weekplan 8

The learning goals for Week 43 are:

Mon: (Week 43): (Video ONLY lectures) Systematic Testing: Equivalence Class Partitioning. Wed: (Video ONLY lectures) Code Coverage. Dependency Management.



Notes for this weekplan:

As I am in Berlin for a conference, there are no lectures this week. Instead you may visit E2018's lifesize recordings of the three lectures. The first video goes over some mandatory hints about the handling the constants in HotCiv (Last year ThetaCiv was about the Bomb unit, but the ideas applies well to B52).

  1. 22th Oct 2018 lecture 1 (The Systematic testing stuff starts around 13 minutes into the video).
  2. 22th Oct 2018 lecture 2.
  3. 24th Oct 2018 lecture 1.

There is no delivery of mandatory this week. Spend the time in the Lab on the exercises described in the exercise list; and you are of course also welcome to start working on the exercises for next week's mandatory delivery.

Additional exercises:

FRS exercises

25.2 (Proxy) 34.3 (EC on Breakthrough game (described in exercise 5.4))

Null Objects

The Null Object pattern is a much safer way to encode 'no behavior' than using null pointers.

Review your HotCiv code base for delegates that implement the Null Object pattern. There should be plenty!

Strengthen analyzability of your HotCiv codebase by refactoring/renaming those delegates to indicate that they are indeed nullobjects.

Dependency Management: WordUtils

Apache Commons is a project developing reusable Java units, and providing them as open source libraries. One of them is Apache Commons Text that contains string/text manipulation functions. An example is the 'initials()' method that given a name computes initials. This is part of the WordUtils class. For instance, running

    public static void main(String[] args) {
        String  message = "Henrik Bærbak Christensen";
        System.out.println("Name : " + message);
        System.out.println("Initials are: "
                           + WordUtils.initials(message, null));
will output something similar to:
csdev@m51f19hbc:~/proj/frsproject/wordutils$ gradle wordutil
Download https://jcenter.bintray.com/org/apache/commons/commons-text/1.8/commons-text-1.8.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-text/1.8/commons-text-1.8.jar

> Task :wordutil 
Name : Henrik Bærbak Christensen
Initials are: HBC

Download the wordutils zip file, and unzip it. It contains the above code fragment, and the Gradle build file, but the dependency section is empty. Update the build.gradle file with the proper dependency to make the code compile. Use maven repository (mvnrepository.org) to find the proper gradle setting. Test it by running the manual test case ('gradle wordutil').

Note: The solution is a one-liner in the build.gradle file, and thus getting the answer from your friend is not the learning goal. This is an exercise in searching for the right answer on the web - what is the name of the library, what versions exist, what is the dependency information?

Systematic Testing: Triangle problem

Download the triangle project: tri.zip. This is the classic triangle type problem referenced in many testing books:

Given three integers a, b, c, that are taken to be sides of a triangle, determine the type:
  • Equilateral (Ligesidet): All sides are of equal length
  • Isosceles (Ligebenet): Two sides are of equal length, but not the third
  • Scalene (?): All three sides are unequal length
  • NotATriangle: a, b, c, cannot form a triangle (sum of two shortest sides is less than the longest)

You will find a small set of test cases in the test folder, and two implementations. The test cases and one implementation, my own, has been developed using Test-Driven Development.

  1. Do an EC analysis of the triangle problem and generate test cases (without inspiration from my test cases :).
  2. Compare the generated testcases with the ones I made using TDD. Are mine adequate? Are there things you overlooked in your EC analysis?
  3. Jorgensen specifices a variant of the problem: All sides a, b, c, must be in the interval 1..200. Do a boundary value analysis of this variant, and document the additionally generated test cases.
  4. If you like an excuse to avoid spending time with your family and friends : Augment the implementation and test case to handle the Jorgensen variant.

Exam Rehearsal

Rehearse a systematic testing exam situation. Sit down and Spend 25 minutes to prepare a 10 minute oral presentation of an exercise in the example exam question set: demo-question-final-2018.pdf.

Next, do a 10 minute presentation at the whiteboard in front of your team.

The team provides constructive feedback on the presentation: Is your presentation clear and understandable, do you discuss the concepts and terms correctly, is you Java example code correct, etc. Swap and ensure all in the team gets a chance to rehearse the situation.

Legend: The typography bold, normal, (brackets), above indicate my perception of how important the exercises are from high to optional. However, solve the mandatory project first!.