Random thoughts, daily life, being a student, quantum computing.


Approaching HUnit

My January goals for LQPL include using TDD practices to create the code for the LQPL server. I am doing that, and at this point, I am starting to see some of the "warts" with the way I am tackling the TDD. For example, to be able to parse a set of five input text commands, I've created 56 cases (assertions).  Each case is a single line, but that is a lot of reading. For the "error out" cases, I created a function that improved the readability quite a bit.

    expectLeftString :: Either String a -> Bool
    expectLeftString (Left _)  = True
    expectLeftString _ = False
    makeBoolParseError :: String -> Assertion
    makeBoolParseError s = assertBool ("'"++s++"' returns error") (expectLeftString (getCommand s))
This gets used in the test creation like this:  

    "parseL3 " ~: makeBoolParseError "load"

For the positive cases, however, it becomes quite a bit messier. For example:

    "parseL2aSpace " ~: "'load     /x/xxx addint.qpo' returns QCLoad" ~:
               Right (QCLoad "/a/bc with space.qpo") @=? (getCommand "load /a/bc with space.qpo") 

Multiple lines of this become rather difficult to parse.

One solution would be to create a helper function for creating the positive assertions as well. I'll give that a shot and see how it looks!


Thesis, Here I come!

2012 is going to be a banner year for my research! I will be able to dedicate myself to it full-time starting in April, which is like a dream come true. To get ready for that, I've set myself some goals for the first three months of the year, while I am still working.

LQPL Goals:

  • January - Document new separated View and Controller interfaces for the new "server" type emulator.
  • January - Write tests in HUnit (or SmallCheck or QuickCheck) as part of the development of this server and client interface
  • January - Actually write the code!
  • January - Have Grover's Algorithm working as before.
  • February - Write a new HCAR entry
Inverse Categories Research Goals:

  • February - Review and update the proofs on lifting inverse product to a product and the equivalence proof
  • March - Beef up Inverse Co-Product paper
  • March - Get Inverse Products paper ready for submission to TAC
Other (things to support research):
  • Make physical fitness a habit.
  • Catch up on reading
  • Present something (Likely on reversible computing and linear logic)