It's UWAweek 47

help5501

This forum is provided to promote discussion amongst students enrolled in CITS5501 Software Testing and Quality Assurance. If posting a question, it's suggested you check first whether your question is answered in the unit Frequently Asked Questions (FAQ) list, and use the search box (on the right) to see if an answer to your question has already been posted.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Note that any posts must comply with the UWA Code of Conduct and the UWA Academic Conduct Policy. That means you should (a) treat everyone with respect and courtesy, and (b) not post your solutions to an assessment that's in progress.

If asking a programming question, it's recommended you read How do I ask a good question? If reporting or troubleshooting a bug in software used in the unit, it's recommend you read How to report bugs effectively.
Displaying selected article
Showing 1 of 135 articles.
Currently 24 other people reading this forum.


 UWA week 38 (2nd semester, week 8) ↓
SVG not supported

Login to reply

👍?
helpful
4:16pm Mon 16th Sep, Arran S.

Hi,

Thanks for pointing that out! You are correct - the method needs a return type, which should be void in this case. I'll add that.

It might be worth pointing out that documentation testing, which was mentioned in lectures, is a good way of avoiding problems like these, and it is used for the code in some labs (including lab 4, although not for the code fragment you pointed out).

Several of the code samples in the lab worksheet get automatically extracted and checked to make sure they compile – the source I use for the lab sheet contains Python code like the following to run tests:

from subprocess import run
try:
  run(["javac", "CollapseClass.java"], check=True)
except Exception as ex:
  print("\n\n***JAVAC FAILED: ", ex, "***", sep="");

However, the test code does add extra complexity, and developers need to remember to add it for all code snippets. In this case, setMinutes is a small fragment that I added to the solutions this year, and it doesn't include surrounding test code.

Cheers,

Arran

Another minor update to a labsheet I thought I'll mention, lab 4 at the bottom it has an example function:

" public setMinutes(int minutes) { this.minutes = minutes; } "

I believe the method signature should be: "void setMinutes(int minutes)"

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy