OBJECT ORIENTED PROGRAMMING (CSSE7023)
ASSIGNMENT 2—SEMESTER 1, 2025
Overview The client loved your solution to the original task,but has realised they didn’t specify it correctly! They actually wanted a GUI to interact with when allocating exams to venues and they wanted you to check and where possible fix the inputs to meet the specifications.They also want to be able to load all of the data in from a file (and save it too)and not have to have it all hardcoded into the program.
This assignment builds on Individual Assignment 1 and will extend your practical experience developing a Java program,including a GUI.Additionally,you must develop and submit JUnit 4 tests for some of the classes in the implementation.You are encouraged to write tests for all your classes and for the GUI part of your implementation as well,but you do not have to submit these.You willbe assessed on your ability to
·implement a program that complies with the specification,
·develop JUnit tests that can detect bugs in class implementations,
·and develop code that conforms to the style conventions of the course.
Task - Refactoring Object Oriented Classes In this assignment,you will update,modify and extend code written by others.You will modify and extend a command-line version of the ExamBlock packages,written by other programmers for Assignment 1,in order to extend the functionality to read and interpret(parse) input data into a registry(replacing the cumbersome Catalogue from assignment 1)and to provide a GUI for an interactive user to update the exam allocations.This will not only involve developing new interfaces and classes,but will also require you to modify existing code written by others.
Your submitted implementation will read and interpret initial input data in a supplied input text file,correcting any incorrect data formats,as required.Your submission will be tested against a number of input text files, not only the one included in the provided code.
Your implementation will also write output data files in the correct format to be used again later as input for the system to continue or modify the allocations.
Your new code will be tested against this specification and the supplied Javadoc.You are expected to test your code yourself.Any existing Gradescope tests are only to confirm that your submission compiles.The assessment tests will be conducted after all assignment submissions are complete (including all late submissions).
You will also write your own(assessed)tests for some of the classes in the implementation and include these in your submission.Only the tests for specific classes are to be submitted.Any test you write for other aspects of the project are not to be included in your submission.The required tests that you have designed and submitted will be assessed for their effectiveness against correct implementations of the code,as wellas a number of incorrect implementations specifically written by the staff to test your tests.
The required tests are for the Subject,Unit,Venue,Session,and Student classes.Your submitted test classes must be named SubjectTest,UnitTest,VenueTest,SessionTest,and StudentTest .Each class may contain whatever tests you deem appropriate,but all the tests for each class must be in a single Java class file.
The Javadoc describes the classes and interfaces that your assignment must implement.A number of classes have not been included in the provided code.You must develop and submit new classes for these.You should start with the classes from the example Individual Assignment 1 solution and update,modify and refactor as required to meet the new requirements and use the new methods now described in the supplied specification in the Individual Assignment 2 Javadoc.Don't forget to refactor any Javadoc comments within your new classes to match and enhance the provided Individual Assignment 2 Javadoc.
Download the bundle scripts to submit your complete assignment including your five test classes. Note that the“provided.zip”includes the bundle scripts and the Javadoc.
Common Mistakes Please carefully read Appendix A.It outlines common and critical mistakes which you must avoid to prevent a loss of grades.If at any point you are even slightly unsure,please check as soon as possible with course staff.
Plagiarism All work on this assignment is to be your own individual work.By submitting the assignment you are claiming it is entirely your own work.You may discuss the overall general design of the application with other students.Describing details of how you implement your design with another student is considered to be collusion and will be counted as plagiarism.
You may not copy fragments of code that you find on the Internet to use in your assignment.Code supplied by course staff (from this semester)is acceptable,but must be clearly acknowledged as described in the next paragraph.
You may find ideas of how to solve problems in the assignment through external resources(e.g.StackOver- flow,textbooks,ChatGPT,CoPilot..).If you use these ideas in designing your solution you must cite them. To cite a resource,provide the full bibliographic reference for the resource in file called refs.md.The refs.md file must be in the root folder of your project.For example:
cat refs.md
[1]E.W.Dijkstra, "Go To Statement Considered Harmful," Communications of the ACM, vol 11 no.3,pp 147-148,Mar.1968.Accessed:Mar.6,2024.[0nline].Available:
https://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD215.html
[2]B.Liskov and J.V.Guttag,Program development in Java:abstraction,
specification,and object-oriented design.Boston:Addison-Wesley,2001.
[3]T.Hawtin, "String concatenation:concat()vs '+'operator," stackoverflow.com, Sep.6,2008.Accessed:Mar.8,2024.Available:
https://stackoverflow.com/questions/47605/string-concatenation-concat-vs-operator
[4]ChatGPT-4,OpenAI, "How do I use invokeLater in Java Swing?" (no code copied), Accessed on:Sep.19,2024.[Online].Available:https://chat.openai.com/
>
In the code where you use the idea,cite the reference in a comment.For example:
/**
*What method1 does.
*[1]Used a method to avoid gotos in my logic.
*[2]Algorithm based on section 6.4.
*/
public void method1()...
/**
*What method2 does.
*/
public void method2(){
System.out.println( "Some"+"content. ") //[3]String concatenation using +operator.
}
You must be familiar with the university's policy on plagiarism.
https://uq.mu/r1553
If you have questions about what is acceptable,please ask course staff.
Generative Artificial Intelligence You are required to implement your solution on your own, without using code from generative artificial intelligence(AI)tools(e.g.ChatGPT or Copilot),the Internet,or any source other than the supplied code for the assignment.This is a learning exercise and you will harm your learning if you use AI tools inappropriately.Remember,you will be required to write code,by hand,in the final exam.
SPECIFICATION
The specification document is provided in the form of Javadocs.
o Implement the classes and interfaces exactly as described in the Javadocs.
o Details not described in the Javadocs may be implemented as you see fit to produce the desired outcome.
o Read the Javadocs carefully and understand the specification before programming.
o Do not change the public specification in any way, including changing the names of,or adding additional, public classes,interfaces,methods,or fields.
o You are encouraged to add additional private members,classes,or interfaces as you see fit.
o JUnit 4 test cases that you submit must only test the public and protected methods as specified in the Javadocs.They must not rely on any other members,classes,or interfaces you may have added to the classes being tested.You may create private members and other classes in your test code.
You can download the Javadoc specification from BlackBoard(Assessment→Individual Assignment 2) or access it at the link below.
https://csse7023.uqcloud.net/assessment/assign2/docs/
GETTING STARTED
To get started,download the provided code from BlackBoard(Assessment→Individual Assignment 2). Extract the archive in a directory and open it with IntelliJ.
GRADING
Five aspects of your solution will be considered in grading your submission:
1.Automated functionality test:the classes that you must implement willhave a number of JUnit unit tests associated with them that we willuse to test your implementation.The percentage of test cases that pass will be used as part of your grade calculation.Classes may be weighted differently depending on their complexity.
2.JUnittest cases:your JUnit test cases willbe assessed by testing both correct and faulty implementations. The percentage of implementations that are appropriately identified as correct or faulty will be used as part of your grade calculation.
3.Manual functionality test:to ensure that the look and feel of your GUI implementation is the same as thee original implementation,and to ensure that the Load/Open and Save menu options are properly invoked by the GUI,a smallscenario with a number of steps in it willbe manually executed by course staff.The faults identified during these steps will be used as part of your grade calculation.
4.Automated style check:Your grade for automated style checking is based on the number of style violations identified by the Checkstyle. tool.It will be run in the same environment as the JUnit automated functionality tests.Multiple style violations of the same type will each count as additional violations. Note: There is a plug-in available for IntelliJ that will highlight style. violations in your code.Instructions for installing this plug-in are available in the Java Programming Style Guide on BlackBoard (Learning Resources→Guides).If you correctly use the plug-in and follow the style. requirements,it should be relatively straightforward to get high grades for this section.
5.Manal style. check:as for Assignment 1,the style. and structure of your code will also be assessed by course staff.Your performance on these criteria will also be used as part of your grade calculation.It is therefore critically important that you read and understand the feedback for this part on Assignment 1,as soon as it is made available,so that you can address any issues in this assignment.See Appendix B for criteria that will be used to assess the readability of your code.
Appendix B shows how the above are combined to determine your grade for the assignment.
AUTOMATED ASPECTS OF THE ASSESSMENT
Three aspects of assessment willperformed automatically in a Linux environment:execution of JUnit test cases,running your JUnit test cases on correct and faulty implementations,and automated style check using Checkstyle.The environment will not be running Windows,and neither IntelliJ nor Eclipse(or any other IDE) will beinvolved.Open.JDK 21with the JUnit 4 library will be used to compile and execute your code and tests. To prevent infinite loops,or malicious code,from slowing down Gradescope,any test that takes longer than 10 seconds to execute will be killed and identified as failing.All tests should execute in a smallfraction of a second. Any test taking longer than a second to execute indicates faulty logic or malicious code.Similarly,any of your JUnit test cases that take longer than 20 seconds to execute on one of the correct/faulty implementations,or that consume more memory than is reasonable,will be stopped.
IDEs like IntelliJ provide code completion hints.When importing Java libraries they may suggest libraries that are not part of the standard library.These will not be available in the test environment and your code will not compile.When uploading your assignment to Gradescope,ensure that Gradescope says that your submission was compiled successfully.
Your code must compile.
If your submission does not compile,you will receive no marks.
SUBMISSION
Submission is via Gradescope.Submit your code to Gradescope early and often.Gradescope will give you some limited feedback on your code.Most importantly,it confirms that your code compiles and runs.
It willnot do extensive testing before assessment,and it is not a substitute for testing your code yourself!
What to Submit Your submission must have the following internal structure:
src/ Folders(packages)and.java files for classes that you modified or created for this assignment. test/ Folders(packages)and.java files for the JUnit tests that are required for this assignment.
refs.md File containing the references for any citations in your code.
Included in the root directory of the provided code are the files bundle.sh and bundle.cmd.For MacOS and Unix users,run the Sbash ./bundle.sh file to execute it.For Windows users,double-click or run the .\bundle.cmd file to execute it.This will create a submission.zip file for you to upload to Gradescope.
You can create the submission zip file yourself using a zip utility.If you do this, ensure that you do not miss any files or directories.Also ensure that you do not add any extra files.We recommend using the provided bundle scripts.
Ensure that your classes and interfaces correctly declare the package they are within.For example, Student.java should declare package examblock.model;.
Only submit the src and test folders and the refs.md file in the root directory of your project.
Do not submit any other files (e.g.no.class files or IDE files).
Provided tests A smallnumber of unit tests willbe provided in Gradescope to show your code compiled and can be tested.These are meant to provide you with an opportunity to receive feedback on whether the very basic functionality of your code works or not.Passing the provided unit tests does not guarantee that you will pass all the tests used for functionality grading.