By: Team T11-3 Since: Sep 2019 Licence: MIT
- 1. Introduction
- 2. Setting up
- 3. Design (Not finished)
- 4. Implementation
- 5. Documentation
- 6. Testing (Check this section at end of project!)
- 7. Dev Ops
- Appendix A: Product Scope
- Appendix B: User Stories
- Appendix C: Use Cases (To Do)
- Appendix D: Non Functional Requirements
- Appendix E: Glossary
- Appendix F: Product Survey
- Appendix G: Instructions for Manual Testing (To Do)
Powerlifting Competition Coordinator is a free application for powerlifting competition event organizers that is simple, fast, and easy to use. It is targeted at organizers of small to medium sized powerlifting competitions who require a hassle-free way of managing and tracking the lifts of participants in and out of the powerlifting competitions. During competition mode, the system has real time maintenance of athlete rankings within their respective weight classes allowing the organizer track the participants' standings at all times throughout the duration of the competition.
Powerlifting Competition Coordinator was developed and is maintained by Team T11-3. Feel free to contact us for any enquries.
Powerlifting Competition Coordinator is an open source project and we would love to involve any contributor who has a passion for powerlifting. To get involved, start by reading Section 2, “Setting up”.
This section includes the instructions to set up your development environment.
Prior to setting up the project proper, make sure you have the following.
-
JDK
11or above -
IntelliJ IDE
ℹ️IntelliJ by default has Gradle and JavaFx plugins installed.
Do not disable them. If you have disabled them, go toFile>Settings>Pluginsto re-enable them.
To setup the project in IntelliJ, follow the steps below.
-
Fork this repo, and clone the fork to your computer.
-
Open IntelliJ (if you are not in the welcome screen, click
File>Close Projectto close the existing project dialog first). -
Set up the correct JDK version for Gradle.
-
Click
Configure>Project Defaults>Project Structure. -
Click
New…and find the directory of the JDK.
-
-
Click
Import Project. -
Locate the
build.gradlefile and select it. ClickOK. -
Click
Open as Project. -
Click
OKto accept the default settings. -
Open a console and run the command
gradlew processResources(Mac/Linux:./gradlew processResources). It should finish with theBUILD SUCCESSFULmessage.
This will generate all resources required by the application and tests.
To verify that the setup is completed successfully, you should:
-
Run the
seedu.address.MainAppand try a few commands. -
Run the tests to ensure they all pass.
This subsection includes configurations that you may find necessary or useful as you work on this project. We recommend that you make these configuration changes and additions before you start writing code.
This subsection includes configurations that you may find necessary or useful as you work on this project. We recommend that you make these configuration changes and additions before you start writing code.
This project follows oss-generic coding standards. IntelliJ’s default style is mostly compliant with ours but it uses a different import order from ours. Follow the instructions below to rectify this.
-
Go to
File>Settings…(Windows/Linux), orIntelliJ IDEA>Preferences…(macOS). -
Select
Editor>Code Style>Java. -
Click on the
Importstab to set the order.-
For
Class count to use import with '*'andNames count to use static import with '*': Set to999to prevent IntelliJ from contracting the import statements. -
For
Import Layout: The order isimport static all other imports,import java.*,import javax.*,import org.*,import com.*,import all other imports. Add a<blank line>between eachimport.
-
Optionally, you can follow the UsingCheckstyle.adoc document to configure Intellij to check style-compliance as you write code.
After forking the repo, links in the documentation will still point to the se-edu/addressbook-level3 repo.
If you plan to develop this as a separate product (i.e. instead of contributing to the se-edu/addressbook-level3) ,
you should replace the URL in the variable repoURL in DeveloperGuide.adoc and UserGuide.adoc with the
URL of your fork.
Set up Travis to perform Continuous Integration (CI) for your fork. See UsingTravis.adoc to l earn how to set it up.
After setting up Travis, you can optionally set up coverage reporting for your team fork (see UsingCoveralls.adoc).
This section documents the design and interaction of components in Powerlifting Competition Coordinator. Please take a moment to understand the different components before making any code changes.
The Architecture Diagram given above explains the high-level design of the App. Given below is a quick overview of each component.
|
💡
|
The .puml files used to create diagrams in this document can be found in the diagrams folder.
Refer to the Using PlantUML guide to learn how to create and edit diagrams.
|
-
At app launch: Initializes the components in the correct sequence, and connects them up with each other.
-
At shut down: Shuts down the components and invokes cleanup method where necessary.
Commons represents a collection of classes used by multiple other components.
The following class plays an important role at the architecture level:
-
LogsCenter: Used by many classes to write log messages to the App’s log file.
The rest of the App consists of four components.
Each of the four components
-
Defines its API in an
interfacewith the same name as the Component. -
Exposes its functionality using a
{Component Name}Managerclass.
For example, the Logic component (see the class diagram given below) defines it’s API in the Logic.java interface and exposes its functionality using the LogicManager.java class.
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command delete 1.
The sections below give more details of each component.
API : Ui.java
The UI consists of a MainWindow that is made up of parts e.g.CommandBox, ResultDisplay, PersonListPanel, StatusBarFooter etc. All these, including the MainWindow, inherit from the abstract UiPart class.
The UI component uses JavaFx UI framework. The layout of these UI parts are defined in matching .fxml files that are in the src/main/resources/view folder. For example, the layout of the MainWindow is specified in MainWindow.fxml
The UI component,
-
Executes user commands using the
Logiccomponent. -
Listens for changes to
Modeldata so that the UI can be updated with the modified data.
API :
Logic.java
-
Logicuses theAddressBookParserclass to parse the user command. -
This results in a
Commandobject which is executed by theLogicManager. -
The command execution can affect the
Model(e.g. adding a person). -
The result of the command execution is encapsulated as a
CommandResultobject which is passed back to theUi. -
In addition, the
CommandResultobject can also instruct theUito perform certain actions, such as displaying help to the user.
Given below is the Sequence Diagram for interactions within the Logic component for the execute("delete 1") API call.
|
ℹ️
|
The lifeline for DeleteCommandParser should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
|
API : Model.java
The Model,
-
stores a
UserPrefobject that represents the user’s preferences. -
stores the Address Book data.
-
exposes an unmodifiable
ObservableList<Person>that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. -
does not depend on any of the other three components.
API : Storage.java
The Storage component,
-
can save
UserPrefobjects in json format and read it back. -
can save the Address Book data in json format and read it back.
This section describes some noteworthy details on how certain features are implemented.
The undo/redo mechanism is facilitated by VersionedAddressBook.
It extends AddressBook with an undo/redo history, stored internally as an addressBookStateList and currentStatePointer.
Additionally, it implements the following operations:
-
VersionedAddressBook#commit()— Saves the current address book state in its history. -
VersionedAddressBook#undo()— Restores the previous address book state from its history. -
VersionedAddressBook#redo()— Restores a previously undone address book state from its history.
These operations are exposed in the Model interface as Model#commitAddressBook(), Model#undoAddressBook() and Model#redoAddressBook() respectively.
Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.
Step 1. The user launches the application for the first time. The VersionedAddressBook will be initialized with the initial address book state, and the currentStatePointer pointing to that single address book state.
Step 2. The user executes delete 5 command to delete the 5th person in the address book. The delete command calls Model#commitAddressBook(), causing the modified state of the address book after the delete 5 command executes to be saved in the addressBookStateList, and the currentStatePointer is shifted to the newly inserted address book state.
Step 3. The user executes add n/David … to add a new person. The add command also calls Model#commitAddressBook(), causing another modified address book state to be saved into the addressBookStateList.
|
ℹ️
|
If a command fails its execution, it will not call Model#commitAddressBook(), so the address book state will not be saved into the addressBookStateList.
|
Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the undo command. The undo command will call Model#undoAddressBook(), which will shift the currentStatePointer once to the left, pointing it to the previous address book state, and restores the address book to that state.
|
ℹ️
|
If the currentStatePointer is at index 0, pointing to the initial address book state, then there are no previous address book states to restore. The undo command uses Model#canUndoAddressBook() to check if this is the case. If so, it will return an error to the user rather than attempting to perform the undo.
|
The following sequence diagram shows how the undo operation works:
|
ℹ️
|
The lifeline for UndoCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
|
The redo command does the opposite — it calls Model#redoAddressBook(), which shifts the currentStatePointer once to the right, pointing to the previously undone state, and restores the address book to that state.
|
ℹ️
|
If the currentStatePointer is at index addressBookStateList.size() - 1, pointing to the latest address book state, then there are no undone address book states to restore. The redo command uses Model#canRedoAddressBook() to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
|
Step 5. The user then decides to execute the command list. Commands that do not modify the address book, such as list, will usually not call Model#commitAddressBook(), Model#undoAddressBook() or Model#redoAddressBook(). Thus, the addressBookStateList remains unchanged.
Step 6. The user executes clear, which calls Model#commitAddressBook(). Since the currentStatePointer is not pointing at the end of the addressBookStateList, all address book states after the currentStatePointer will be purged. We designed it this way because it no longer makes sense to redo the add n/David … command. This is the behavior that most modern desktop applications follow.
The following activity diagram summarizes what happens when a user executes a new command:
-
Alternative 1 (current choice): Saves the entire address book.
-
Pros: Easy to implement.
-
Cons: May have performance issues in terms of memory usage.
-
-
Alternative 2: Individual command knows how to undo/redo by itself.
-
Pros: Will use less memory (e.g. for
delete, just save the person being deleted). -
Cons: We must ensure that the implementation of each individual command are correct.
-
-
Alternative 1 (current choice): Use a list to store the history of address book states.
-
Pros: Easy for new Computer Science student undergraduates to understand, who are likely to be the new incoming developers of our project.
-
Cons: Logic is duplicated twice. For example, when a new command is executed, we must remember to update both
HistoryManagerandVersionedAddressBook.
-
-
Alternative 2: Use
HistoryManagerfor undo/redo-
Pros: We do not need to maintain a separate list, and just reuse what is already in the codebase.
-
Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as
HistoryManagernow needs to do two different things.
-
We are using java.util.logging package for logging. The LogsCenter class is used to manage the logging levels and logging destinations.
-
The logging level can be controlled using the
logLevelsetting in the configuration file (See Section 4.4, “Configuration”) -
The
Loggerfor a class can be obtained usingLogsCenter.getLogger(Class)which will log messages according to the specified logging level -
Currently log messages are output through:
Consoleand to a.logfile.
Logging Levels
-
SEVERE: Critical problem detected which may possibly cause the termination of the application -
WARNING: Can continue, but with caution -
INFO: Information showing the noteworthy actions by the App -
FINE: Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size
We use asciidoc for writing documentation.
|
ℹ️
|
We chose asciidoc over Markdown because asciidoc, although a bit more complex than Markdown, provides more flexibility in formatting. |
See UsingGradle.adoc to learn how to render .adoc files locally to preview the end result of your edits.
Alternatively, you can download the AsciiDoc plugin for IntelliJ, which allows you to preview the changes you have made to your .adoc files in real-time.
See UsingTravis.adoc to learn how to deploy GitHub Pages using Travis.
We use Google Chrome for converting documentation to PDF format, as Chrome’s PDF engine preserves hyperlinks used in webpages.
Here are the steps to convert the project documentation files to PDF format.
-
Follow the instructions in UsingGradle.adoc to convert the AsciiDoc files in the
docs/directory to HTML format. -
Go to your generated HTML files in the
build/docsfolder, right click on them and selectOpen with→Google Chrome. -
Within Chrome, click on the
Printoption in Chrome’s menu. You should see a pop-up similar to Figure 12 below. -
Set the destination to
Save as PDF, then clickSaveto save a copy of the file in PDF format. For best results, follow the settings as indicated in Figure 12.
This section includes some information that may be useful for testing the project.
There are three ways to run tests.
|
💡
|
The most reliable way to run tests is the 3rd one. The first two methods might fail some GUI tests due to platform/resolution-specific idiosyncrasies. |
Method 1: Using IntelliJ JUnit test runner
-
To run all tests, right-click on the
src/test/javafolder and chooseRun 'All Tests'. -
To run a subset of tests, you can right-click on a test package, test class, or a test and choose
Run 'ABC'.
Method 2: Using Gradle
-
Open a console and run the command
gradlew clean allTests(Mac/Linux:./gradlew clean allTests).
|
ℹ️
|
See UsingGradle.adoc for more info on how to run tests using Gradle. |
Method 3: Using Gradle (headless)
Thanks to the TestFX library we use, our GUI tests can be run in the headless mode. In the headless mode, GUI tests do not show up on the screen. That means the developer can do other things on the Computer while the tests are running.
To run tests in headless mode, open a console and run the command gradlew clean headless allTests
(Mac/Linux: ./gradlew clean headless allTests).
We have two types of tests:
-
GUI Tests - These are tests involving the GUI. They include:
-
System Tests that test the entire App by simulating user actions on the GUI. These are in the
systemtestspackage. -
Unit tests that test the individual components. These are in
seedu.address.uipackage.
-
-
Non-GUI Tests - These are tests not involving the GUI. They include:
-
Unit tests targeting the lowest level methods/classes.
e.g.seedu.address.commons.StringUtilTest -
Integration tests that are checking the integration of multiple code units (those code units are assumed to be working).
e.g.seedu.address.storage.StorageManagerTest -
Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
e.g.seedu.address.logic.LogicManagerTest
-
Problem: HelpWindowTest fails with a NullPointerException.
-
Reason: One of its dependencies,
UserGuide.htmlinsrc/main/resources/docsis missing. -
Solution: Execute Gradle task
processResources.
Problem: AddCommandSystemTest or SearchCommandSystemTest fails with a GuiRobot$EventTimeoutException.
-
Reason: The required data could not be fetched from the online service within 10s. The service could be down at the moment.
-
Solution: Check that you are connected to the Internet, or if you are, try again later.
This section contains some information or tools that may be useful for managing the project.
See UsingGradle.adoc to learn how to use Gradle for build automation.
We use CircleCI, Travis CI, and AppVeyor to perform Continuous Integration on our projects. See UsingCircleCI.adoc, UsingTravis.adoc, and UsingAppVeyor.adoc for more details.
We use Coveralls to track the code coverage of our projects. See UsingCoveralls.adoc for more details.
When a pull request has changes to asciidoc files, you can use Netlify to see a preview of how the HTML version of those asciidoc files will look like when the pull request is merged. See UsingNetlify.adoc for more details.
Here are the steps to create a new release.
-
Update the version number in
MainApp.java. -
Generate a JAR file using Gradle.
-
Tag the repo with the version number, e.g.
v0.1. -
Create a new release using GitHub and upload the JAR file you created.
A project often depends on third-party libraries. For example, PowerLifting Competition Coordinator depends on the Jackson library for XML parsing. We make use of Gradle to manage the project dependencies. Gradle can automate the downloading of these dependencies, saving us time and effort.
While strongly discouraged by us, you can nevertheless opt for one of the following alternatives.
-
Include those libraries in the repo (though this bloats the repo size).
-
Download those libraries manually (though this creates extra work for you).
Target user profile:
-
organizes small to medium sized powerlifting competitions
-
has a need to manage a significant number athletes during the competition
-
has a need to see the ranking of the participants of each competition
-
prefer desktop applicationss over other types
-
can type fast
-
prefers typing over mouse input
-
is reasonably comfortable using CLI apps
Value proposition: manage powerlifting competitions faster than a typical mouse/GUI driven app
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
|
new user |
see usage instructions |
refer to instructions when I forget how to use the App |
|
event organizer |
create a new competition |
start and organize a new competition |
|
event organizer |
find athletes according to their weight class |
see which athletes are in the same competition |
|
event organizer |
sort athletes according to their attempted weights for different lifting events |
adjust the weight on stage call for the next athlete to come and attempt their lift |
|
event organizer |
find which athletes are currently in the lead (individual lifts and aggregate score) |
so that I can let the competitors know who is in the lead for their resepective weight classes and let them calculate what they need to do to win the competition |
|
event organizer |
the relative position of an athlete as compared to other athletes in their weight class |
see which athletes are in the same competition |
|
event organizer |
edit the weight of a lifting attempt for an athlete |
so that the lifting order of athletes can be updated |
|
event organizer |
update an athlete’s score after a successful lift |
so that the ranking of the athletes can be updated |
|
event organizer |
edit an athlete’s name |
update the athlete’s name in case the athletes have change their names or they were inputted incorrectly previously |
|
event organizer |
input/edit an athlete’s body weight |
update the athlete’s weight so the athelete is taking part in the correct weight class |
|
event organizer |
record when a lifter fails/succeed in his/her lift |
update the athlete’s score and ranking accordingly and to keep a record for how each athlete’s score was derived |
|
event organizer |
input/edit an athlete’s country/club |
which country/club the athlete is representing |
|
event organizer |
know the rack height for bench press/squat |
the racks can be prepared before the athletes make their lifting attempt and save time |
|
user |
hide private contact details by default |
minimize chance of someone else seeing them by accident |
|
event organizer |
find which club/country an athlete is affiliated with |
so that I know which countries/clubs can be ranked across the various weight classess |
|
user with many persons in the address book |
sort persons by name |
locate a person easily |
{More to be added}
(For all use cases below, the System is the Powerlifting Competition Competitor and the Actor is the user, unless specified otherwise)
MSS
-
User requests to list all competitions in the system.
-
System shows a list of competitions held based on the files in the folder.
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
MSS
-
User requests for a new powerlifting competition to be started.
-
User inputs the initial competition data (e.g. name, particpants) to be inputted.
-
System adds the new competition to the user’s competition list.
-
System shows a success message.
Use case ends.
Extensions
-
2a. Competition data is invalid.
-
2a1. System shows an error message.
Use case resume at step 2.
-
-
2b. The competition name has already been used in user’s competition list.
-
2b1. System tells user that the competition is already in his competition list.
Use case ends.
-
MSS
-
User obtains a list of competitions by listing (UC1)
-
User requests for a new powerlifting competition to be deleted.
-
System adds the new competition to the user’s competition list.
-
System shows a success message.
Use case ends.
Extensions
-
2a. User gives an invalid index.
-
2a1. System shows an error message.
Use case resume at step 2.
-
MSS
-
User obtains a list of competitions by listing (UC1)
-
User requests to enter competition mode for a particular competition.
-
System enters competition mode for a particular competition.
Use case ends.
Extensions
-
2a. User gives an invalid index.
-
2a1. System shows an error message.
Use case resume at step 2.
-
MSS
-
User requests to list all athletes in the system.
-
Powerlifting Competition Coordinator shows a list of all athletes in the system.
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
MSS
-
User performs a search with some constraints (e.g. id, country, age, etc.).
-
System lists athletes satisfying all the constraints.
Use case ends.
Extensions
-
2a. System does not find any athletes satisfying all the constraints.
-
2a1. System shows an empty list.
-
MSS
Extensions
-
2a. System does not find the athlete in the list.
Use case restarts from step 1.
-
2b. User gives an invalid index.
-
2b1. System shows an error message.
Use case resumes at step 2.
-
Use case ends.
MSS
-
User requests for an athlete to be added.
-
User inputs athlete data.
-
User confirms that the addition of the athlete cannot be reversed.
-
System adds the new athlete to the user’s athlete list.
-
System shows a success message.
Use case ends.
Extensions
-
2a. Athlete data is invalid.
-
2a1. System shows an error message.
Use case resume at step 2.
-
-
2b. The athlete is already in user’s athlete list.
-
2b1. System tells user that the athlete is already in his athlete list.
Use case ends.
-
MSS
-
User views a specific athlete (UC7)
-
User requests certain data about the athlete to be updated.
-
System shows success message.
Use case ends.
Extensions
-
2a. User gives invalid data.
-
2a1. System shows an error message.
Use case resumes at step 2.
-
MSS
-
User views a specific athlete (UC7)
-
User requests for an athlete to be deleted from the athlete list.
-
System shows success message.
Use case ends.
MSS
-
User requests to list all participants in the competition.
-
System shows a list of all participants in the competition.
Use case ends.
Extensions
-
2a. The list is empty.
Use case ends.
MSS 1. User performs a search with some constraints (e.g. id, country, age, ranking criteria etc.). 2. System lists participants satisfying all the constraints.
+ Use case ends.
Extensions
-
2a. System does not find any athletes satisfying all the constraints.
-
2a1. System shows an empty list.
-
MSS
-
User obtains a list of athletes by listing (UC11). or searching (UC12).
-
User requests to view more information on a specific athlete in the list.
-
System shows detailed information of the book.
Use case ends.
Extensions
-
2a. System does not find the athlete in the list.
Use case restarts from step 1.
-
2b. User gives an invalid index.
-
2b1. System shows an error message.
Use case resumes at step 2.
-
Use case ends.
MSS
-
User views a specific athlete (UC13)
-
User requests certain data about the athlete to be updated.
-
System shows success message.
Use case ends.
Extensions
-
2a. User gives invalid data.
-
2a1. System shows an error message.
Use case resumes at step 2.
-
MSS
-
User views a specific participant (UC13)
-
User requests for a particular athlete to be disqualified from the competition.
-
System shows success message.
Use case ends.
MSS
-
User requests for next athlete to attempt lift.
-
System shows athlete that is lifting next.
-
User updates system after athlete attempts lift.
-
System shows success message.
Use case ends.
Extensions
-
2a. No more participants in lifting order.
Use case ends.
MSS
-
User requests to exit competition mode.
-
System exits competition mode.
Use case ends.
MSS
-
User requests to finalize competition data.
-
System finalizes competition and prevents any further updating of the competition data.
Use case ends.
Extensions
-
2a. There are still participants that have not finished their lifts
Use case ends.
{More to be added}
-
Should work on any mainstream OS as long as it has Java
1.8.0_60or higher installed. -
Should work on both 32-bit and 64-bit environments.
-
Should come with automated unit tests and open source code.
-
Should come with a user guide and a developer guide.
-
Should favor DOS style commands over Unix-style commands.
-
Should be intuitive such that a new user can learn to search and organize a powerlifting competition within 10 minutes.
-
A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse. {More to be added}
Given below are instructions to test the app manually.
|
ℹ️
|
These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing. |
-
Initial launch
-
Download the jar file and copy into an empty folder
-
Double-click the jar file
Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
-
-
Saving window preferences
-
Resize the window to an optimum size. Move the window to a different location. Close the window.
-
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
-
{ more test cases … }
-
Deleting a person while all persons are listed
-
Prerequisites: List all persons using the
listcommand. Multiple persons in the list. -
Test case:
delete 1
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated. -
Test case:
delete 0
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. -
Other incorrect delete commands to try:
delete,delete x(where x is larger than the list size) {give more}
Expected: Similar to previous.
-
{ more test cases … }
















