Skip to content

Commit

Permalink
Merge pull request #36 from Celineyaa/master
Browse files Browse the repository at this point in the history
Update the version 1 user guide
  • Loading branch information
Celineyaa authored Apr 3, 2024
2 parents 01f0bee + 3f6cc69 commit 93e9e1d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 59 deletions.
62 changes: 37 additions & 25 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,35 +89,47 @@ The Storage Component:

### Testcase Component
# Proposed Implementation
The proposed test mechanism is facilitated by ProblemGeneratorTest, CheckerTest. It check the correctness of the generated problemsets' types,
number of questions and max digits, by comparing the generated output to the user input.
The proposed test mechanism is facilitated by ProblemGeneratorTest, CheckerTest. It check the correctness of the generated problemsets' types,
number of questions and max digits, by comparing the generated output to the user input.

ProblemGeneratorTest#operatorTest() — Test if the input operator type is align with the generated one.
ProblemGeneratorTest#numberTest() — Test if the input number of questions is align with the generated number of questions.
ProblemGeneratorTest#digitTest() — Test if the input max digits is align with the generated one.
ProblemGeneratorTest#parseCommand() — parse the input command to fit in the program.
ProblemGeneratorTest#parseNumber() — parse out the operands from a given problem.
ProblemGeneratorTest#operatorTest() — Test if the input operator type is align with the generated one.
ProblemGeneratorTest#numberTest() — Test if the input number of questions is align with the generated number of questions.
ProblemGeneratorTest#digitTest() — Test if the input max digits is align with the generated one.
ProblemGeneratorTest#parseCommand() — parse the input command to fit in the program.
ProblemGeneratorTest#parseNumber() — parse out the operands from a given problem.

Given below is an example usage scenario and how the test behaves.

Step 1. The user launch the ProblemGeneratorTest and run the operator testcase. The ProblemGeneratorTest#operatorTest() will loop through all the
commands in the data member "commands" and allocate each commands to its corresponding test case. During this process, a ProblemGenerator pb is
generated, and the problem sets it generates by calling ProblemGenerator#typeChoose will be store in variable #test#, then the problem set will be
extracted using Test#getProblem(). After that, for every problem in the generated problem set, the assertTrue will check if the type of these problem
matches with the user input type. If all of them matches, it will successfully output the generated dataset, else, it will output the problem with
incorrect format.

Step 2. The user launch the ProblemGeneratorTest and run the number testcase. The ProblemGeneratorTest#numberTest() will loop through all the commands
in the data member #commands# and call ProblemGeneratorTest#parseCommand to parse the input command to get a hashmap with the input type, number and digits
information. Then generate a new ProblemGenerator and use ProblemGenerator#typeChoose to collect the generated problem, then use assertEquals to compare
the user input number with the generated number of questions.

Step 3. The user launch the ProblemGeneratorTest and run the digit testcase. The ProblemGeneratorTest#digitTest() will loop through all the commands
in the data member #commands# and call ProblemGeneratorTest#parseCommand to parse the input command to get a hashmap with the input type, number and digits
information. Then generate a new ProblemGenerator and use ProblemGenerator#typeChoose to collect the generated problem,then for every problem, call
ProblemGeneratorTest#parseNumbers to extract the digits in the problem, then use assertTrue to verify if the input max digit is greater or equal to the digits
of every operands in the generated problems.

Step 1. The user launch the ProblemGeneratorTest and run the operator testcase. The ProblemGeneratorTest#operatorTest() will loop through all the
commands in the data member "commands" and allocate each commands to its corresponding test case. During this process, a ProblemGenerator pb is
generated, and the problem sets it generates by calling ProblemGenerator#typeChoose will be store in variable #test#, then the problem set will be
extracted using Test#getProblem(). After that, for every problem in the generated problem set, the assertTrue will check if the type of these problem
matches with the user input type. If all of them matches, it will successfully output the generated dataset, else, it will output the problem with
incorrect format.

Step 2. The user launch the ProblemGeneratorTest and run the number testcase. The ProblemGeneratorTest#numberTest() will loop through all the commands
in the data member #commands# and call ProblemGeneratorTest#parseCommand to parse the input command to get a hashmap with the input type, number and digits
information. Then generate a new ProblemGenerator and use ProblemGenerator#typeChoose to collect the generated problem, then use assertEquals to compare
the user input number with the generated number of questions.

Step 3. The user launch the ProblemGeneratorTest and run the digit testcase. The ProblemGeneratorTest#digitTest() will loop through all the commands
in the data member #commands# and call ProblemGeneratorTest#parseCommand to parse the input command to get a hashmap with the input type, number and digits
information. Then generate a new ProblemGenerator and use ProblemGenerator#typeChoose to collect the generated problem,then for every problem, call
ProblemGeneratorTest#parseNumbers to extract the digits in the problem, then use assertTrue to verify if the input max digit is greater or equal to the digits
of every operands in the generated problems.

The features going to be implement:
testcases for generating long problem sets questions and check answer, as well as the testcases for UI, Checker, and Storage.

Details for implementation:
1. Testcases for generating long problem sets questions:
implement specific input and call assertTrue to verify if the generated long problem sets has the desired format.
2. Testcases for checker :
provide answer to sample testcases and verify if the checker output the accurate correctness.
3. Testcases for UI:
verify the UI output's correctness.
4. Storage:
verify if the record file is created, and the content in the file is correct.

## Product scope
### Target user profile
Expand Down
83 changes: 49 additions & 34 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,57 @@
# User Guide

## Introduction

{Give a product intro}

## Quick Start

{Give steps to get started quickly}

1. Ensure that you have Java 11 or above installed.
1. Down the latest version of `Duke` from [here](http://link.to/duke).

## Features

{Give detailed description of each feature}

### Adding a todo: `todo`
Adds a new item to the list of todo items.

Format: `todo n/TODO_NAME d/DEADLINE`

* The `DEADLINE` can be in a natural language format.
* The `TODO_NAME` cannot contain punctuation.

Example of usage:

`todo n/Write the rest of the User Guide d/next week`

`todo n/Refactor the User Guide to remove passive voice d/13/04/2020`

# User Guide of MathGenius

## Get Start:
{input java mathGenius.java to get started
Type the command in the command box and press Enter to execute it.
e.g. typing help and pressing Enter will get the help message.}
Some example commands you can try:
1. generate: Generate problem set
2. pressing Enter/Return: submit your answer
3. judge: Judge the correctness of the input answer
4. exit: exit the main program
5. view: view all problems
6. speed: Show the speed of completing the problem set
7. accuracy: Show accuracy in completing the problem set
8. report: Show the performance report with respect to all completed problem sets.

## Feature:

### Show the Help: 'help'
show the message about the command you can use and the standard input format (e.g. input should be in fraction or in decimal form).
Format: 'help COMMAND_NAME'
* The 'COMMAND_NAME' can be commands like 'generate', 'records', 'exit'
Example of usage:
'help generate'
'help exit'
## FAQ

**Q**: How do I transfer my data to another computer?
### generate problem set: 'generate'
Generate the problem based on the +-*/ as well as the answer based on the random variable generation.
Format: 'generate -tOPERATOR -nNUMBER_OF_PROBLEMS -dMAXIMUM_DIGITS'
* 'OPERATOR' can be '+-*/'
* 'NUMBER_OF_PROBLEMS' can be any integers
* 'MAXIMUM_DIGITS' can be any integers
Example of usage:
'generate -t + -n 1 -d 1'
'generate -t * -n 3 -d 3'
## FAQ

**A**: {your answer here}
### Submit Answer: 'ENTER/RETURN'
type answer in terminal and press ENTER/RETURN
## FAQ

## Command Summary
### Judge Answer: NaN
After finishing all the problem sets, the program will automate judged the correctness and output the accuracy and speed.
## FAQ

{Give a 'cheat sheet' of commands here}
### View Problem Set: 'records'
Users can use this to view all the problems when answering the problem.
Format: 'records'
## FAQ

* Add todo `todo n/TODO_NAME d/DEADLINE`
### Exit: 'exit'
User can use this to exit the program.
Format: 'exit'
## FAQ

0 comments on commit 93e9e1d

Please sign in to comment.