This page describes the first practical for the Informatics Software Testing course. It will be marked out of 100 points, and is worth 12.5% of the assessment of the course. This practical should take approximately 20 hours of work to complete.
This practical was issued on Monday 18th January. The submission deadline for the practical is Monday 15th February at 16:00. The penalty for late submission follows the uniform policy described in the UG3 course guide. Please read that page, and pay particular attention to the section on plagiarism.
In this practical you will construct a test suite for a very small part of an educational software system that is reasonably mature and has been developed for use by students. The system is called VMAP (follow this link for an intro) and is intended to help users create “mindmaps”. For more explanation of what the system does see the introduction and help on the web page. There is also a link on the VMAP page that allows you to run VMAP from your web browser.
Note that VMAP is written for Java 1.4 and uses variable names incompatible with Java 1.5. You've a number of options to cope with this:
enum
. The below tar
file contains this modification, so if you use it then you should be
fine.
build.xml
to
include source="1.4"
. If you're using Eclipse, you need
to make the same change in the configuration.
enum
problem.
The system is open source and all of the source is available in a
range of formats from the project page. In addition the source code is
available locally as a tar file
compressed using bzip2 (extract with tar xjf
vmap-0.91.tar.bz2
).
You will probably need the following tools. You can choose either to use the Eclipse IDE or just to use JUnit on its own; I have no strong preference. You will need some of the following:
Now you should work through the following activities:
You should spend some time looking at the VMAP web page, and should consider what you need to download and begin to set up the environment to support you in the tasks given below.
Deliverables: None.
In this task you will generate a test suite in JUnit by first
constructing test case specifications using the category partition
approach. In this task you will test the method
String toRelativeURL(URL base, URL target)
that can be found in the file
vmap-0.91/vmap/main/Tools.java
. You should document the
following parts of the process:
toRelativeURL
method which your test set can
detect — i.e. two copies of toRelativeURL
which you've modified (in a small way) to introduce a bug that your
test suite will detect.
You should then implement your test case specification and test the code for the function. In giving a grade for this part of the practical I will take account of the performance of your test set on a collection of variants of the method.
Deliverables: A section in your report containing
your design rationale for the tests; a file Task1.java
that
contains the JUnit tests, and files Variant1.java
and
Variant2.java
, each containing one variant
toRelativeURL
method.
This article outlines the top ten most common Java coding errors. Read the article, then review your tests and the supplied code and suggest three additional tests you could add to your suite as a result of this. You may also want to look at Eric Allen's work on diagnosing Java — this is quite extensive and you should not read the articles in detail. Implement two of your test ideas.
Deliverables: A section in your report giving a
short rationale for adding three tests that have been
prompted by your reading for this section, and the file
Task2.java
containing implementations of
two of your test ideas.
Using some appropriate tool, assess the level of statement coverage achieved by your test suite. Examine the coverage data carefully. Then do one of the following:
Deliverables: A section in your report (include a
screenshot to help document the coverage you achieved), and a file named
Task3.java
if you developed any new tests.
After completing the practical you should have five or six files. It will help me with marking if you please exactly adhere to these names (including upper/lower case):
Please write your tests in the default package (i.e. no package).
To submit your work you should collect the files you wish to submit,
and execute this command (only including Task3.java
if you
have one!):
submit cs3 st cw1 report.pdf Task1.java Variant1.java Variant2.java Task2.java Task3.java
toRelativeURL()
from the
vmap source, and test it separately?
Version 1.5, 2010/02/03 19:01:32
Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: school-office@inf.ed.ac.uk Please contact our webadmin with any comments or corrections. Logging and Cookies Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh |