Github.com ids: Tristan Starck: ttstarck Kelly Bielaski: kbielaski
a) This is a program that given an input of gender, number of drinks (beer, wine, shots), hours spent drinking, and weight, outputs the BAC of the person, whether or not they are legal to drive, the symptoms the person might have, and how long before until they can legally drive.
b) As a driver, I can know how long it will take before I can legally drive after drinking. As a drunk, I can know what my symptoms are for drinking the amount of alcohol I consumed. As a friend of someone who consumes, I can make sure my friend isn't posing a danger to anyone or themselves from excess alcohol consumption. As someone about to drink, I can calculate how many drinks I should limit myself too.
c) The program runs without error. When run, the program opens a GUI window which has text fields and dropdown menus for inputing weight in pounds or kilograms, gender, number of beers, wine, and hard liquor shots, and how long they have drank. After inputing this information, you can click a Calculate BAC button that will display the BAC, whether you are legally able to drive, the symptoms of someone who drank the amount of alcohol, and how long until they can legally drive.
c) As someone currently drinking or about to drink, I can set a BAC limit and then calculate how many more drinks I can have in a specific amount of time with my current amount of alcohol consumed before I reach that limit. As someone about to drink, I can set a time when I want to be legally able to drive, and then calculate how many drinks I can have inorder to be legal to drive at the set time.
d) README.md doesn't state that the program outputs the symptoms according to how much alocohol was consumed. Besides that README.md has all the necessary material and descriptions, including a picture of the program running.
e) All targets have descriptions. Formatting looks good. Target "dist" doesn't do anything. No implemnetation for dist. URL for javadoc and jws is put into a file under issues. Should shorten length of javadoc URL. After typing "ant javadoc" and "ant jws" , URL is not correctly displayed to go to the javadoc/jws directly.
f) There are only two issues, and they both aren't very big issues. The 1st issue is clear in what must be done to resolve it but the second issue is vague and open ended. The first issue is a new feature that uses the same functions as current features to calculate when the driver can drive. The only major problem with this would be to add the component of the new feature to the GUI. The second issue should be more specific about what exactly needs to be done to resolve the issues, and what is stated isn't enough.
g)
h) Calc.java: This class has a private constructor and one public static method called BAC. Calc.java has excellent commenting and javadoc commenting. Calc.java's only funciton is to calculate the BAC. In our opinion, this class could be implemented as just a method in another class. Formatting of several if/else statements in BAC could be changed for better readability.
BACMessage.java: This class has a private constructor and one public static method called GUIMessage. This message returns a string that gives the information about the BAC level. There are several grammar errors in the message. Instead of having the messages all in the GUIMessage method, it would be better to put all the messages into an array and call the on the array in the method. This would increase readability of code. Also comments would help to understand what each if/else statement does without having to read the whole message.
CalcGui.java: This class has a main method that initializes JFrame and BACPanel and sets the JFrame to visible.
BACPanel.java: This class adds and formats all the components to the JFrame that are necessary for inputing/outputing the information. A main issue with this class is when adding an action listener to their Calculate BAC button, they had the definition of a new Action Listener class inside the parameter of the addActionLister() call. This is very ugly looking code and it would be much more readable if this was made into an inner class instead of inside the parameter of a method.
Summary: In general the code is easy to read and understand however there are several major glaring issues with the code. It is very apparent that some areas they made an effort to fix and refactor their code and other places they left it the way they first implmented it. Every class however does have correct javadoc comments.
i) There are JUnit tests however they are not testing everything they should. There needs to be test cases that test every line of code. They only cover some of the BAC ranges with specific message outputs. What we would change is that there would be a test case for every message for both Male and Female users, pounds and kilogram users, and tests for every number of drinks that could be inputed. This would require some for loops in the code but it would be the best way to know if there are any errors in the code.