CS 222 Spring 2016

Lab exercise for Simple Note Taker Assignment

Due: June 05, Tuesday, 23:55 pm.

Submission:

  • Your report WILL HAVE the name peerName_report.docx (write the person’s name whose code you’re reviewing in place of peerName)
  • Commit your code to SVN: https://srl.ozyegin.edu.tr/cs222hws/sum16/name.surname/SimpleNoteTaker/

Task 1

Examine the code that’s assigned to you carefully and evaluate the code according to criteria provded below: - Functionality - Clean Code

In you report, make 2 seperate sections for these criteria. For each section, write your observations for the evaluation items provided below:

FUNCTIONALITY

  • Proper note taking commands
    • Files containing notes are created and they are proper
    • Notes should be created in src not a static path they provide on their own computer
    • Text after #END appears in the note being taken (it should not)
    • Notes’ extention is .ncat. This is how they should be stored in the folder
    • Keeping notes in an internal data structure instead of writing to file
    • no #END usage
    • Ridiculously written algorithms: reading all note to a string and append to it and then writing it to a new file with the same name
  • Proper CLI commands
    • Loop breaks with invalid commands
    • Loop exits without comand “exit”
  • Wrong command detection and errors reported
    • Warning messages
    • Any missing methods?
    • Absence of command line

CLEAN CODE

  • FUNCTIONS
    • all code in main
    • methods > 20 lines
    • functions doing multiple tasks
    • indentation level > 3 (nested ifs, nested loops or a combination of these)
    • mixing abstraction levels (see slides and example codes)
    • number of function arguments > 2
    • crowded try-catch blocks (they should be extracted to functions)
    • code duplication
    • wrong usage of static (many/all method are static)
  • NAMING
    • Camel Notation
    • Class names starts with capital, they are nouns/noun phrases
    • Variables start with lowercase
    • File name (NoteCat.java) starts with capital
    • File name that contains main method other than NoteCat.java
    • methods are verbs, start with lowercase
    • constants all capital with underscore between words
    • if a variable is defined with contant’s name convention but not declared as final
    • numeric values in the code that should be constant (e.g. max # of arguments)
    • meaningful names
    • commands not listed as constants but appear as strings in the methods or #END
  • SMELLS
    • No leftover code
    • No unnecessary comments
    • Short and to-the-point comments
    • Code duplication, repeatitive methods/ code blocks

GRADING

5% of your assignment grade will come from this exercise