JMU CS345 - Software Engineering
Help Policies Solutions Study-Aids Syllabus Tools
Homework: Java Programming Review


1 Purpose

The primary purpose of this assignment is to help you review (and demonstrate that you have acquired) the knowledge and skills required to program in Java. From a language and algorithms perspective, there is nothing new in this assignment. There is also nothing new from a software engineering perspective.

This assignment will also help you gain some experience with the integrated development environment that you will be using this semester in this course. Some of the tools you will be using this semester will be new to some of you, and we will discuss aspects of them as the semester progresses. However, at this point, regardless of whether you have used the tools in the past, you should be able to figure out everything that you need for this assignment.

This asignment will also, hopefully, lead you to improve the process that you use during the construction phase of the software engineering lifecycle. For example, it will hopefully get you to start earlier, work on a regular schedule, test properly, and ask questions appropriately.

Finally, this assignment will expose you to the kinds of software engineering documents you will be reading and writing throughout the semester, and the kinds of questions that you may need to ask while carefully reading these documents.

2 Overview

SagaciousMedia is a (fictitious) company that develops educational hardware, software, and content for both the formal and informal education markets. SagaciousMedia's products are designed to excite and educate students, to inspire and assist teachers/instructors, and to help administrators.

SagaciousMedia has observed that schools are creating new and innovative grading systems that make use of very complicated rules for combining grades for a single student and/or cohorts of related students. They are developing a product called Transcriptz to support schools in these efforts.

3 Preparatory Tasks

Before you do anything else you should:
  • Install the basic components of the IDE on your computer. (See the course "Help" page for more information.)
  • Read all policies related to homework assignments (including style guides, submission requirements, collaboration rules, etc...).
  • 4 Documents

    We will be discussing several software development processes, including an agile process known as "scrum", and you will use scrum to complete the final project. Hence, to help you gain some experience with this process, all of the documents prepared for this assignment (and several subsequent assignments) assume that Sagacious Media uses scrum. As you complete these assignments, you should think about these documents and their origins. This will help you later in the semester when you will have to create documents like these on your own.

    The terms that SagaciousMedia uses when discussing Transcriptz and its functionality are described in the following document.

    When using scrum, time is divided into time intervals called sprints that typically last 1-2 weeks, and product features are organized into stories. SagaciousMedia categorizes stories as either epics (abstract stories that might take several releases, developed over the course of many months, to completely realize), and sprintable stories (that describe what will be completed in a single sprint and included in the product at the end of the sprint). The sprintable stories (which are what you are concerned with for this assignment) for Transcriptz have been collected in the following document (along with some epics that are not part of this assignment).

    The team you are working with at SagaciousMedia used the sprintable stories to create a set of tasks for this assignment. The other members of your team completed some of the tasks and have left others for you to complete. The complete set of tasks is contained in the following document.

    The tasks that are "checked" have already been completed by other team members, the evidence for which is contained in the following documents.

    You must complete the tasks that have not been "checked-off". The code you write must be consistent with the documents prepared by the team.

    5 Testing

    Some of the tasks that you must complete involve unit testing. You must use JUnit (v5) for this purpose. Your JUnit test suite should cover all statements and all branches (as measured by EclEmma) in all of the classes/enums you write. You should not write tests for the code that was provided to you. Your tests must be in a package named testing and each test class must include the word "Test" in its name.

    6 A Recommended Process

    The tasks are organized by story. Hence, though they are numbered (so that they can be referred to in documents and conversations), the numbers should not, in any way, influence the order in which you complete them. I would suggest you sequence your activities as follows.

    For any project you should start as follows:

    1. Read all of the documents.
    2. Review any source code you've been given (in this case, the TranscriptzH1 class and the JMUCourseTable class) so that you understand how the classes you are implementing will be used.
    3. Stub-out all of the components (classes, enums, etc.), including all comments. This will make it much easier for you to test and debug your code. (Your stubs should conform to the style guide. This will enable you to correct style defects incrementally, rather than at the last minute.)
    4. Complete several examples by hand so that you understand what each of the components will be used for and how they will be used. (In this case, you are given several integration/system tests. Make sure you can replicate the calculations by hand and then think about how the different components will be used to perform those calculations.)

    For this particular project, you should then:

    1. Implement the LetterGrade enum.
    2. Test and debug the LetterGrade enum.
    3. Implement the Numerics class.
    4. Test and debug the Numerics class.
    5. Implement the LabeledDouble class.
    6. Test and debug the LabeledDouble class.
    7. Implement the SizeException class.
    8. Implement the Calculator interface.
    9. Implement the WeightedAverageCalculator class.
    10. Test and debug the WeightedAverageCalculator class.
    11. Implement the WeightedTotalCalculator class.
    12. Test and debug the WeightedTotalCalculator class.
    13. Implement the Filter interface.
    14. Implement the ThresholdFilter class.
    15. Test and debug the ThresholdFilter class.
    16. Test and debug the complete system (using the main class named TranscriptzH1).

    7 Submission

    You must submit (using Gradescope) a .zip file that contains:
    1. Your implementation of the required interfaces/classes/enums in the appropriate package(s), including the JMUCourseTable class. Do not submit the main classes.
    2. JUnit tests for all of your classes/enums in a package named testing.

    The .zip file must contain the grading, math, and testing directories/folders at the top level.

    There is no limit on the number of submissions and no penalty for excessive submissions.

    Note that your submission will not be graded if it does not comply with the specifications. So, if you are unable to complete the assignment, your submission should include a stubbed-out version of all of the components. (This will allow you to get credit for the components that you do implement correctly.)

    8 Grading

    Your code will first be graded by Gradescope and then by the Professor. The grade you receive from Gradescope is the maximum grade that you can receive on the assignment.

    8.1 Gradescope Grading

    Your code must compile (in Gradescope, this will be indicated in the section on “Does your code compile?”) and all class names and method signatures must comply with the specifications (in Gradescope, this will be indicated in the section on “Do your class names, method signatures, etc. comply with the specifications?”) for you to receive any points on this assignment. Gradescope will then grade your submission as follows:
    • Conformity to the Style Guide (Style) - 10% (All or Nothing; Success Required)
    • Passing your Tests (SelfTests) - 10% (All or Nothing; Success Required)
    • Coverage of your Tests (Coverage) - 20% (Partial Credit Possible)
    • Correctness of your Code (OfficialTests) - 60% (Partial Credit Possible)

    Note that some of the criteria are described as "Success Required". This means that Gradescope will not assess subsequent criteria unless this criterion is satisfied (and you will receive a grade of 0 for the criteria that aren't assessed). So, for this assignment, if your code does not conform to the style guide then nothing else will be assessed (and you will receive a grade of 0 for the assignment)

    .

    Note also that, Gradescope will provide you with hints, but may not completely identify the defects in your code.

    8.2 Manual Grading

    After the due date, the Professor may manually review your code. At this time, points may be deducted for inelegant code, inappropriate variable names, bad comments, etc.

    9 Reminders

    Remember to read and follow all policies related to homework assignments (including style guides, submission requirements, collaboration rules, etc...).

    10 UML Stereotypes

    Different organizations use some UML stereotypes differently. For example, SagaciousMedia uses the <<Immutable>> stereotype to indicate that objects in the class will be immutable even if the class changes. So, some classes in the current design may be immutable but are not designated as <<Immutable>>. This is because the team wants to make it clear that these classes may not be immutable in future versions. So, the current version should not assume that they will be.

    11 Help

    You should be a fairly proficient object-oriented programmer at this point. However, in case you've forgotten some details, help is available.

    11.1 Help with Java

    This assignment is a review of the material covered in CS159 that you should already understand. The course "Help" pages (see the section on "Course Content") on Java and UML contain many useful references in case you need to refresh your memory. You also may want to refer to the "review lectures" at the top of the syllabus.

    Also, in case you haven't seen them before, the last parameter of a method can be of variable length. This is indicated in the declaration of the method with .... What is actually passed in is an array. So, for example, the constructor in the ThresholdFilter class can be implemented as follows:

    public class ThresholdFilter implements Filter
    {
      private int[] sign;
      private LabeledDouble threshold;
      
      public ThresholdFilter(final double threshold, final int... sign)
      {
        this.threshold = new LabeledDouble("Threshold", threshold);
        this.sign = sign;
      }
    }
        

    11.2 Help with Eclipse

    When you create your Java project, be careful that you have separate src and bin directories/folders, and that you do not put your code in modules. Help creating Java projects in Eclipse is available on the CS Department's Wiki.

    Before you create any classes, make sure that you first create the packages to hold them. Help creating packages in Eclipse is available on the CS Department's Wiki.

    When you create classes in Eclipse, be careful to put them in the appropriate package.

    The CS Department's Wiki provides help on many other Eclipse topics, including how to provide command-line arguments. You also may want to refer to and/or complete the "review labs" related to Eclipse that are at the top of the syllabus.

    11.3 Help with Testing

    We will be using JUnit all semester. For more information see:

    11.4 Help with Coverage

    In order to get 100% coverage, you sometimes have to be aware of some quirks of the language you are working in, and the tool set you are using. For more information, see:

    11.5 Help Creating the .zip File

    The directories/folders containing the packages must appear at the top of the .zip file. So, you must not compress the directory/folder containing these directories/folders, you must compress the directories/folders containing the packages. In other words, if you have a directory named src that contains the directories grading and math, you must not compress src, you must compress grading and math.

    Help with creating .zip files is available on the CS Wiki. In particular, see:

    11.6 Help with Gradescope

    General help with Gradescope is available on the CS Wiki. For more information, see:

    If Gradescope reports errors in the "CompileOfficialTests" section it means that your code does not conform to the specifications. In particular, if you get an error that says SizeException must be caught or re-thrown it means that your SizeException class is not unchecked (as required by the specifications).

    12 Questions to Think About

    You do not need to submit answers to the following questions, but you should think about them as the answers will be important throughout the semester.
    1. Were any of the documents prepared by your team members at SagaciousMedia unclear or incorrect?
    2. How did the quality of the documents impact you?
    3. How would you avoid these kinds of situations if you had to prepare documents like these (which you will)?
    4. When a specification was unclear or something was missing from the specifications did you ask a question or did you make an assumption? If you asked, did you do so before or after submitting your code and discovering it was incorrect?
    5. When you asked a question did you phrase it carefully and use clear and unambiguous language?
    6. Was the recommended process a good process? If so, why? If not, why not?
    7. How will you identify and/or create good processes for future assignments? (Remember, in this course, the processes is more important than the outcome! In other words, this is a "process course".)

    Copyright 2024