aaaYaaa2 / SQA_CitySim

SQA deliverable 2
GNU General Public License v3.0
0 stars 0 forks source link

Requirements and dependency injection #1

Open asphaltpanthers opened 8 years ago

asphaltpanthers commented 8 years ago

Hello @Yuuki221,

Make sure you understand the requirements for CitySim9002. Some of the requirements are not met.

Your going to need to practice some dependency injection. As it is now, your random number generators are hard coded. This is going to make very difficult to create repeatable unit tests. Make sure you pass your random number generators into objects/methods as parameters so that they can be doubled.

asphaltpanthers commented 8 years ago

Hello @Yuuki221,

There are several issues with both the application and tests. I recommend you review my comments, ask me questions, and come to office hours. Your grade has been posted to CourseWeb.

Issues with messages:

According to the requirements, the argument should be accepted as input as a command line parameter like this "java -jar CitySim9002.jar 1". Also, the input should be validated as being correct. If it is incorrect the error string "Please enter one integer argument, seed" should be printed to the console.

Dependencies, such as the random number generator, should be injected into your methods as parameters. This is called dependency injection.

You should use mockito to create 3 doubles and 3 stubs. There are none of either.

Much of your code is not tested. There should be at least one test for each public method that returns a value.