Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Clarence Chew] iP #37

Open
wants to merge 78 commits into
base: master
Choose a base branch
from

Conversation

clarence-chew
Copy link

@clarence-chew clarence-chew commented Aug 19, 2022

Anthea


Ever felt you wanted to track your life better? Feeling confused about what you want to do?

Where am I? - Anthea

Not you, although you are the star of the show here, I mean you, dear reader.

Anthea is a chatbot that helps you keep track of your tasks.

But, I haven't done that before! - Anthea

Don't worry, you can access their filesystem if you need to record things for them.

What if I mess up? - Anthea

I'll help. For the people you are helping to track their tasks, they would also help you notice bugs.

Bugs? Oh no! - Anthea

Such is how it goes when it's code made by humans. You know that, don't you? You are made with Java, which looks something like this:

public static void main(String[] args) {
    System.out.println("Hello World!");
}

Hold up, I remember that.

In fact, I remember a lot of other things too, like the Todo, Deadline and Event classes.

  • The ToDo class helps you track a task.
  • The Deadline class helps you track a deadline, so you know when to rush.
  • The Event class helps you track events you might need to attend.

Yeah, that is in the code. There are also various prompts that you could respond to as well, such as

  1. list to list down all the tasks
  2. find to search for tasks containing a keyword
  3. delete to remove tasks
  4. mark and unmark to keep track of tasks.

Something like this:

  • A task
  • Another task
  • Visit this place to learn software engineering

I think you are getting it. 😄

Yes, I think I am ready. 🦌 - Anthea

Text entered by the user is stored and can be displayed.
We need a common interchange format for Tasks to interact with
files. We also need a way to extend the testing to deal with the
case where the file is missing.

Let's add common String[] method getAsStringArray() format for
Tasks. To make it easier to make the tasks, let's also add
TaskFactory to utilise the Factory design pattern.

Let's come up with a new encoding for the file. As Base64 methods
are available in Java 11, this can be done by encoding string
information for each file in Base64, and separated with commas on
a single line.

Let's run the test twice, once after deleting the duke.txt file and
once after not deleting the file. This would allow us to do
regression testing in both cases.
# Conflicts:
#	src/main/java/Deadline.java
#	src/main/java/Event.java
Packaging is good for organisation.

Another thing we need to do while packaging is to
update runtest.bat to compile code within the packages.
# Conflicts:
#	src/main/java/duke/Parser.java
#	src/main/java/duke/task/TaskList.java
# Conflicts:
#	src/main/java/duke/ConsoleUi.java
#	src/main/java/duke/task/Task.java
CommandMatcher is actually a subclass of StringMatcher<DukeResponse>.

By abstracting this out, more opportunities to use this pattern to parse
strings reveal themselves. This includes detecting keywords.

Let's take StringMatcher out of CommandMatcher and make it a superclass.
The code previously only supported a small number of date formats.
However, some date formats may need some processing to understand.

Adding natural dates makes the application more user-friendly.

Let's
* Increase the scope of parsing of dates by building an entire parsing
tool, spanning days of the week, months, years, times, dates.
* Write tests for the parsing of dates.
Notes are great to have.

To also ensure the code is cleaned, let's also
* Package exceptions
* Package notes
* Add tests to integration tests
* Maintain the same note/task numbers to aid in modification and
  deletion
The code has two "delete" commands. It isn't deleterious, since the
command detection is via running a Predicate to check, but it would be
nice to remove it to make the code cleaner.

Let's delete the delete for cleaner code.
The code needs better testing and documentation.

Let's
* update the files compiled for runtest
* add console mode option to Launcher
* clean up the documentation for one function in ParsedDateTime
Mac has this issue where double-clicked apps cannot make files in the
same directory. By changing instructions of how Mac users are to use the
application, this would improve user experience.
This may be the cause of why it failed automated smoke tests.

Let's remove it to check if it is the issue.
Some Booleans in ParsedDateTime are replaced with better names. Methods
in Parser are shortened by writing individual methods in Commands to
create each command separately. The other files have documentation
updates.

As a side effect, the test cases available only reschedule to years
instead of times.
The UI squashes and hides the text, making it unusable.

Removing the prefHeight property here helps make the UI usable.
There are lots of extra references to Duke.

Let's replace them with more generic names/Anthea depending on which is
more appropriate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants